Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

help on playeradded function?

can someone give me an example of a script that works that makes a gui visible after a second or so when the player joins? im not requesting, i just need an example so i can apply the knowledge to what i have

1 comment

1

Duplicate q.q

2 answers

game.Players.PlayerAdded:connect(function(plr)
wait(2)
plr:WaitForChild("PlayerGui").ScreenGui.Frame.Visible = false -- Change the names if necessary.
end)

Tada, use this as a example

+1 if this helped.

2 comments

0

on line 3, do you mean StarterGui

0

also how would i test this in solo, cause i heard pplayeradded wouldnot work in solo

game.Players.PlayerAdded:connect(function(player)
wait(1)
GUIX.visible = true
end

GUIX = game.StarterGui.NameofGui

2 comments

0

That variable should be declared above the function in the case that the function is called before the variable is declared. Also, I should mention that making something in the StarterGui visible doesn't make it visible for the player. You would have to make it visible in the player's PlayerGui.

0

An example to fix it would be to put the variable in the function at the top and say "local GUIX = player.PlayerGui.GUINAME". Also, I should mention that this script must be in the Workspace since you didn't mention that.

This discussion is preserved as it was. New answers, comments, and votes are closed.