Jump to content

number.....


Deepu

Recommended Posts

Posted

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.

Posted
  
text = guiGetText(EditBoxName) 
  
function addText() 
if text then  
tonumber(text) 
setElementData(localPlayer, "drugs", text) 
end 
  

Not sure about this script

  • Moderators
Posted

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 

  Tutorials  4x 

 

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...