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

help on playeradded function?

Asked by 10 years ago

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
Duplicate q.q HexC3D 830 — 10y

2 answers

Log in to vote
1
Answered by
HexC3D 830 Moderation Voter
10 years ago
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.

0
on line 3, do you mean StarterGui namelessassasin 30 — 10y
0
also how would i test this in solo, cause i heard pplayeradded wouldnot work in solo namelessassasin 30 — 10y
Ad
Log in to vote
-1
Answered by 10 years ago
game.Players.PlayerAdded:connect(function(player)
wait(1)
GUIX.visible = true
end

GUIX = game.StarterGui.NameofGui
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. Aethex 256 — 10y
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. Aethex 256 — 10y

Answer this question