I want users to be able to type numbers into a TextBox, and then use the Inputted numbers as number values rather than string values. How can I convert Strings into Numbers?
What I have now may work, but I realized that if the User inputs a non-numeric character the script will attempt to perform mathematics on a letter.
What I have so far:
if player.Coins.Value >= script.Parent.Parent.CoinConvert.Text then
if script.Parent.Parent.CoinConvert.Text/25 == 1 then
player.Coins.Value = player.Coins.Value - script.Parent.Parent.CoinConvert.Text
player.Points.Value = player.Points.Value + (script.Parent.Parent.CoinConverter.Text/25)
end
end
--This isn't the full script, just a portion of it.
--CoinConvert is the name of the TextBox.
Also, how can I check if the Text of a TextBox is changed? I would assume that the .Changed event doesn't work, as it only works on Values.

1 comment
Thanks!