Controlled Posted January 18, 2014 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
Anubhav Posted January 18, 2014 Posted January 18, 2014 1. triggerServerEvent 2. setTimer See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
DiSaMe Posted January 18, 2014 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. -
Controlled Posted January 18, 2014 Author 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.
Recommended Posts