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

Why wont this script work?

Asked by 7 years ago

I have no idea why this wont work. Im not getting any errors in the output, but its not working :(

game.Players.PlayerAdded:connect(function(player)
    local intro = player.PlayerGui:WaitForChild("Intro")
    local XPgui = player.PlayerGui:WaitForChild("XpBar").Frame

    while true do
        wait(0.1)
        if intro then
            XPgui.Visible = false
        else
            XPgui.Visible = true
            wait(0.1)
            script.Parent.GuiVisibleAfterIntro:Destroy()
        end
    end
end)

Answer this question