I wanna stop it when it reaches a number

i want to know if player typed a text that is more than 900
for example if someone typed a number that is higher than 900 in my textbox i want the script to disable
i really forgot how

Check when text has been written using GetPropertyChangedSignal("Text"), check if what was given is a number, and if it was, check if that number is greater than 900

local textbox = --Your textbox

textbox:GetPropertyChangedSignal("Text"):Connect(function()
	local textNumber = tonumber(textbox.Text)
	
	if not textNumber or textNumber <= 900 then
		return
	end
	
	--Code to do if they input a number greater than 900
end)

If you’re doing this with a button instead, you can just replace the GetPropertyChangedSignal Event with the button event of your choice

tysm i appreciate your help and support

1 Like