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

How to keep a text box's characters, to just 1, 2, 3, and 4? (Solved)

So, in my game, this is for the lobby. When they make a lobby, they can make it 1 - 4 players. But text boxes can have letters, numbers, and lots of them. Is there a way to make it only be able to have 1 - 4, just once. So not 11 22 33, etc... I found some code, but it doesn't work.

local TextBox = script.Parent
TextBox:GetPropertyChangedSignal("Text"):Connect(function()
    if tonumber(TextBox.Text) then
        script.Parent.Number.Value = script.Parent.Text
    else
        TextBox.Text = "1" 
    end
end)

1 answer

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