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

Why do my GUI's only show up for one player? [closed]

Asked by 9 years ago

Hi

I have a normal game script in the workspace that changes gui's visible/non visible status. It works for one player only, the other players just have no GUI on their screen. I want them to show up for every player. Heres a snippet of my code:




for i,v in pairs(game.Players:GetPlayers()) do v.PlayerGui.Choosabel.BackgroundFrame.Visible = true wait(10) v.PlayerGui.Choosabel.BackgroundFrame.Visible = false end
0
BUMP Alvin_Blox 52 — 9y
0
I would assume that this code runs before the second player is registered in the game; therefore the for loop would only be able to find one player. I suggest that you add some type of wait or repeat loop. RedCombee 585 — 9y
0
Proper indentation is key. User#21908 42 — 5y
0
You can't access playergui from a server script Vulkarin 581 — 5y

Locked by evaera

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
1
Answered by
Emg14 10
9 years ago

Maybe you could try this:

game.Players.PlayerAdded:connect(function(Player)
    Player.PlayerGui.Choosabel.BackgroundFrame.Visible = true
    wait(10)
    Player.PlayerGui.Choosabel.BackgroundFrame.Visible = false
end)

Pls vote if it works!!!

1
He cannot vote. He has negative reputation User#21908 42 — 5y
Ad