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 this script edit TextLabel?

Problem : Gui won't change

** Script Below**

Btw: This script is in the server script service. and is a regular script


function Intermission()
			local IntermissionTime = 1
			wait(.1)
		while IntermissionTime ~= 0 do
			for _, player in pairs(game.Players:GetChildren()) do
			wait(.1)
		local playergui = player.PlayerGui
		local text = playergui.ScreenGui:WaitForChild('TextLabel')
				wait(.5)
				text.Text = "Intermission: " .. IntermissionTime
				wait(.3)
				IntermissionTime = IntermissionTime - 1
			end
		end
	
	
	
end

2 comments

0

Make sure you wait for all your variables, and if it still doesn't work, come back.

0

i just did, added wait between playergui and test variables

1 answer

Use GetPlayers.

function Intermission()
	local IntermissionTime = 1
	wait()
	while IntermissionTime ~= 0 do
		for _,plr in next, game.Players:GetPlayers() do
			local playergui = plr.PlayerGui
			local text = playergui.ScreenGui:WaitForChild("TextLabel")
			wait(.5)
			text.Text = "Intermission: ".. IntermissionTime
			wait(.5)
			IntermissionTime = IntermissionTime - 1
		end
	end
end

2 comments

0

it works on solo but not online

0

Are you using FilteringEnabled?

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