Deepu Posted February 25, 2014 Posted February 25, 2014 How to show in lua that if the text in the gui is a number then set element's Data to that number written in the edit box ? URGENT PLS HELP WANT SCRIPTS? I SELL LIKE AN ANIMATED CUSTOMISED GUI FOR 5USD AND AN RPG GAMEMODE FOR 30USD ONLY. IF YOU NEED SPECIAL SCRIPTS THEN I SELL EACH FOR 5 USD.
Anubhav Posted February 25, 2014 Posted February 25, 2014 text = guiGetText(EditBoxName) function addText() if text then tonumber(text) setElementData(localPlayer, "drugs", text) end Not sure about this script 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
Moderators IIYAMA Posted February 25, 2014 Moderators Posted February 25, 2014 You have to return the result of the tonumber function back in to the variable text. text = tonumber(text) end -- and "end" @Deepu Also you have to call the function. It would be better by setting the elementdata at serverside. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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