I have a TextBox, that can be edited. I have a problem though, I want it to be editable, but numbers only. I tried using :Tonumber as suggested by someone (I forgot who), but apparently didn't work...
OUTPUT
Players.Player1.PlayerGui.ScreenGui.GemsToDiamonds.Custom.S:5: attempt to call method 'Tonumber' (a nil value)
What I want is A TextBox be able to type numbers only, then put that number as a Value in TextBox. But is didn't work, someone help please?

3 comments
Or simply just "return string.match(txt, '%d+') ~= txt"
' I think that there is an easier way to check for this, but I can't remember what it is. '
Confusing, Also, I can't see how I can set the number in the textbox as a value (NumberValue) as the Textbox's Child. So I have a textbox, and in it I have a script and the Value.