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

GUi showing does not work?

Asked by 10 years ago

this is a simple question, why doesnt this script work..its so when a player joins the textlabel waits 1 second b4 showing

function Playerjoin()
    wait(1)
    script.Parent.Visible = true
end
script.Parent.Parent.Parent.Parent.Parent.Players.PlayerAdded:connect(Playerjoin) --heirachy is script<textlabel<Frame<ScreenGui<starterGui<game... then i go down..>Players>PlayerAdded

3 answers

Log in to vote
1
Answered by
Sublimus 992 Moderation Voter
10 years ago

Instead of:

script.Parent.Parent.Parent.Parent.Parent.Players.PlayerAdded:connect(Playerjoin) 

Why not just:

game.Players.PlayerAdded:connect(Playerjoin)
Ad
Log in to vote
-1
Answered by 10 years ago
function MakeVisible(gui, bool)
    if bool == true then -- checks if you want it to be visible or not
        gui.Visible = true -- Makes the gui visible
    elseif bool == false then  -- checks if you want it to be visible or not
        gui.Visible = false -- Makes the gui invisible
    else -- if something went wrong then it will tell you
        error("Please make sure you have enetered a correct boolen must be a true or false")
    end
end

game.Players.PlayerAdded:connect(function(player) -- checks if a player is added
    repeat wait() until player.Character -- another way of waiting for the player's data
    MakeVisible(script.Parent, true) -- true if you want it to show, false if you want it to hide
end)
Log in to vote
-1
Answered by 10 years ago
function MV(gui, bool)
    if bool == true then
        gui.Visible = true
    elseif bool == false then
        gui.Visible = false
    end
end

game.Players.PlayerAdded:connect(MV)function(player)
    repeat wait() until game.Players.PlayerAdded
    MV(script.Parent, true)
end)

did not copy I just learned the same way fire did.

0
why wouldn't my way work though? namelessassasin 30 — 10y

Answer this question