waqaarali Posted May 19, 2014 Share Posted May 19, 2014 Well i know i posted a couple of threads now but yestarday i finally created a working script =D (( ' Never give up ' )). Well i really wanted to move off the basic stuff and learn how to connect client-side and server-side together so all GUI things are on client-side and when the button is clicked it is on server-side any help or functions pleasee !!! =D Link to comment
TAPL Posted May 19, 2014 Share Posted May 19, 2014 Use trigger: triggerClientEvent -- from server to client. triggerServerEvent -- from client to server. Link to comment
waqaarali Posted May 19, 2014 Author Share Posted May 19, 2014 So basically addEvent("name",true) and triggerClientEvent -- from server to client. triggerServerEvent -- from client to server. ?? Link to comment
TAPL Posted May 19, 2014 Share Posted May 19, 2014 Example: This the client side: addEventHandle("onClientGUIClick", root, function() if source == YourButtonHere then triggerServerEvent("AnyNameToTheEvent", localPlayer, "Hello!", "ZzZzZz") end end) And this the server side: addEvent("AnyNameToTheEvent", true) addEventHandler("AnyNameToTheEvent", root, function(arg1, arg2) outputChatBox(getPlayerName(source).." has clicked the button and say "..arg1.." and say "..arg2) end) Try it. Link to comment
waqaarali Posted May 19, 2014 Author Share Posted May 19, 2014 TAPL do you have skype? Link to comment
EH10 Posted May 19, 2014 Share Posted May 19, 2014 Example:This the client side: addEventHandle("onClientGUIClick", root, function() if source == YourButtonHere then triggerServerEvent("AnyNameToTheEvent", localPlayer, "Hello!", "ZzZzZz") end end) And this the server side: addEvent("AnyNameToTheEvent", true) addEventHandler("AnyNameToTheEvent", root, function(arg1, arg2) outputChatBox(getPlayerName(source).." has clicked the button and say "..arg1.." and say "..arg2) end) Try it. Error , addEventHandle> addEventHandler Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now