Jump to content

GUI with trigger


huyjvguyen

Recommended Posts

  
client: 
function tesst() 
wwindow = guiCreateWindow(100, 100, 100,100,"tesst gui" , false) 
edit = guiCreateEdit(10, 20, 20, 20,"", fasle, wwindow) 
btn = guiCreateButton(10, 25, 10, 10,"test btn", wwindow) 
addEventHandler("onClientGUIClick", btn, testbtn, false) 
end 
bindKey("l", "down", tesst) 
  
function testbtn() 
leb = guiGetText(edit) 
triggerServerEvent("trigger", getLocalPlayer(), player, leb) 
  
end 
server: 
function trig(player, leb) 
  
outputChatBox("say"..tostring(leb), source) 
outputChatBox("say"..tostring(leb), player) 
  
end 
addEvent("trigger", true) 
addEventHandler("trigger", getRootElement(), trig) 
  

debug is : bad arg??

Link to comment
Which line or side the error exist? and what you're trying to do

i think , error in function testbtn, this function not trigger id leb

We are not thinking about errors, check debugscript 3 by typing: /debugscript 3

and tell us what you want to make , i mean tell us about your project idea

Link to comment

My ideas are very difficult to explain,

but i got a problem:

when i make 3 client function

function1 --> function2 -->function3 ( the element function 1 not send to function3)

but when i make just 2 funtion

function1 -- > function2 ( the element on function 1 when send to function2 and trigger server function)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...