String Value -> Number Value

So I’m making a thing where players transfer money to other players. They input how much they want to transfer into a text box. So how do you take the string value from the TextBox into Number Value that I can use in a variable?

1 Like

There is a global function called tonumber() that converts strings into numbers.

5 Likes

So i do?

local number = tonumber(Texbox.Text)
1 Like

Yes, that is how you use it. Here is the link to all the Lua globals which documents how to use tonumber() and other functions.

2 Likes