Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I change a string value to an int value?

local check = script.Parent.Parent.AnswerBox.Text:toNumber()

AnswerBox is a TextBox where the user will input a number, that I'm going to compare in a separate function with another int, but I can't use the string value that that variable is giving me, and :toNumber() doesn't seem to work.

1 answer

✓ Accepted answer

That's not the right way of doing it, sir. Try this: local check = tonumber(script.Parent.Parent.AnswerBox.Text)

1 comment

0

thanks a bunch! code seems to work now :)

This discussion is preserved as it was. New answers, comments, and votes are closed.