#The script in a GUI won't work when I enter something in a textbox

34 messages · Page 1 of 1 (latest)

upbeat wing
warm bolt
# upbeat wing
local textBox = script.Parent

-- Function to check the text value
local function checkTextValue()
    local textValue = textBox.Text
    local numberValue = tonumber(textValue)

    -- Check if the text is a number
    if numberValue then
        -- Check if the number is between 1 and 99
        if numberValue >= 1 and numberValue <= 99 then
            print("The number is valid: " .. numberValue)
        else
            print("Invalid number. Number must be between 1 and 99.")
        end
    else
        print("The text is not a number.")
    end
end

-- Connect the function to the TextBox's Changed event
textBox:GetPropertyChangedSignal("Text"):Connect(checkTextValue)
#

pls format code bef sending

upbeat wing
#
local textBox = script.Parent

-- Function to check the text value
local function checkTextValue()
    local textValue = textBox.Text
    local numberValue = tonumber(textValue)

    -- Check if the text is a number
    if numberValue then
        -- Check if the number is between 1 and 99
        if numberValue >= 1 and numberValue <= 99 then
            print("The number is valid: " .. numberValue)
        else
            print("Invalid number. Number must be between 1 and 99.")
        end
    else
        print("The text is not a number.")
    end
end

-- Connect the function to the TextBox's Changed event
textBox:GetPropertyChangedSignal("Text"):Connect(checkTextValue)
warm bolt
upbeat wing
#

oh

obtuse oxideBOT
#

studio** You are now Level 1! **studio

warm bolt
#

do u get errors

#

or what does it print?

upbeat wing
upbeat wing
#

heres the explorer

#

this is the gui

upbeat wing
upbeat wing
pure glacier
#

help me too

warm bolt
obtuse oxideBOT
#

studio** You are now Level 2! **studio

upbeat wing
upbeat wing
#

but a local script will make it only be deleted for me

warm bolt
#

that deletes the part

upbeat wing
upbeat wing
warm bolt
#

to communicate from client -> server or vice versa

upbeat wing
#

ok ty

upbeat wing
obtuse oxideBOT
#

studio** You are now Level 2! **studio