SpiralAPI
(SFAST_Arlo)
October 25, 2020, 4:56pm
1
I have a textbox that is only compatible with numbers (code below) but how would I make it so it can only go up to 10000, and then past that you can’t type anymore. Thanks
input:GetPropertyChangedSignal("Text"):Connect(function()
input.Text = input.Text:gsub('%D+', '');
end)
Blockzez
(Blockzez)
October 25, 2020, 5:02pm
2
Use math.min, as strings and numbers gets implicitly converts to each other when doing mostly anything, you don’t need tosrting.
input.Text = math.min(input.Text:gsub('%D+', ''), 10000)
input:GetPropertyChangedSignal("Text"):Connect(function()
if tonumber(input.Text) < 100000 then
--Its under 100000 do stuff
end
end)
1 Like