Hey!
I need help solving this issue I am having or really just support on how to execute this idea that I have.
I want to use a text box as some sort of volume changer for a sound I have in the game and I need to detect if the player typed in a number that is 1-100, let me show you my script.
local number = {1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100}
local box = script.Parent:WaitForChild("TextBox")
local submit = script.Parent:WaitForChild("TextButton")
submit.MouseButton1Click:Connect(function()
if box.Text == #number then
print(box.Text)
else
print("You have to type a number.")
end
end)
In this script I’m basically using a table to try to detect if a user imputed one of the numbers in that table into the text box, if anyone could help me on this please let me know.
Thank you!