I want players to only be able to type numbers into a textbox. The function runs when Textbox.Changed is triggered, and instantly deletes any letters it detects. The problem is that deleting any letter input re-triggers the Textbox.Changed property(Line 4), which then leads to a recursion. Is there any alternatives to this code?
Textbox.Changed:Connect(function(input)
if input == "Text" then
if not tonumber(Textbox.Text) then
Textbox.Text = Textbox.Text:sub(1,#Textbox.Text-1)
end
end
end)

2 comments
thank u kind sir, have a great day
No problem.