Controlled Posted January 18, 2014 Share Posted January 18, 2014 How would I transfer information that someone placed onto a GUI(Like a text or number) to server side? And how can I run something multiple times without spamming the script. For example removeElementData(thePlayer, "hello")*2 Would run that twice. Bit of a a bad example but I think you get the idea. That would run that removeElementData twice and save the space/time Link to comment
Anubhav Posted January 18, 2014 Share Posted January 18, 2014 1. triggerServerEvent 2. setTimer Link to comment
DiSaMe Posted January 18, 2014 Share Posted January 18, 2014 How would I transfer information that someone placed onto a GUI(Like a text or number) to server side? addEvent addEventHandler triggerServerEvent --or setElementData -- element data is synced if you set it for server-side elements unless you explicitly specify not to sync it And how can I run something multiple times without spamming the script. For example removeElementData(thePlayer, "hello")*2 Would run that twice. Bit of a a bad example but I think you get the idea. That would run that removeElementData twice and save the space/time Use loops for i = 1, 5 do outputChatBox(tostring(i)) end Outputs: 1 2 3 4 5 The code inside the loop block (therefore 'outputChatBox' too) will be executed 5 times, with different 'i' value every time. Link to comment
Controlled Posted January 18, 2014 Author Share Posted January 18, 2014 Alright so thanks for the help so far, my question about the GUI is answered. But I don't understand how I could get something like this to run a certain number of times. exports.global:giveItem(source, 115, weapon..":"..mySerial..":"..getWeaponNameFromID(weapon)) So for example that would run once, twice, or 3 times based on the number you put in the GUI. Link to comment
TAPL Posted January 19, 2014 Share Posted January 19, 2014 We don't give support with leaked scripts. Link to comment
Recommended Posts