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

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

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

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

1 comment

0

It did not work, please edit my script so it will work rather than making a new one.

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