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

Why won't my GUI work when I access it from ServerScriptService?

Asked by 9 years ago
function Start()
    for i = 10, 0, -1 do
        game.StarterGui.Intermission.TextLabel.Text = "Game beginning in "..i
        wait(1)
    end
end


while true do
    if game.Players.NumPlayers >= 3 then
        wait(1)
        Start()
    end
    wait()
end

1 answer

Log in to vote
2
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
9 years ago

StarterGui contains GUI object, but it is not what the player is seeing. A player sees everything inside PlayerGui. Each time a player's character respawns, everything in StarterGui is cloned into PlayerGui. In studio, we can see things in StarterGui for editing purposes, but the player only sees what is currently in his PlayerGui.

To get this to work, use a for loop to loop through each player's PlayerGui and edit it.

for index,player in pairs(game.Players:GetPlayers()) do
    player:WaitForChild("PlayerGui").Intermission.TextLabel.Text = "hola senor!"
end
0
It did not work, please edit my script so it will work rather than making a new one. Irreconcilable 30 — 9y
Ad

Answer this question