Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

If textbox has no text, changes text?

Asked by 8 years ago

What I'm trying to do is make a GUI where you enter a Player's name and a Reason for their admittance (Hospital), but when I try to make sure the name and reason is valid, I come to a halt.

script.Parent.MouseButton1Click:connect(function()
    if game.Players:FindFirstChild(script.Parent.Parent.Patient.Text) == nil then
        script.Parent.Text = "Please enter a valid name"
        wait(2)
        script.Parent.Text = "Send report"
    else
        if script.Parent.Text == "" then
            script.Parent.Text = "Please enter a valid reason"
            wait(2)
            script.Parent.Text = "Send report"
        else
            script.Parent.Text = "Submitted"
            wait(5)
            script.Parent.Parent.Parent.Admit.Visible = false
            script.Parent.Parent.Parent.Button.Visible = true
    end
end)

Answer this question