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

Timer GUI not updating on screen, only in properties. Why is that?

I am trying to make my own timer with the knowledge I have as of right now and it all seems fine to me but for some reason the label on screen is not updatind as well as not turning invisible while, but in properties it is. Could I get some help or explanation as to why it's behaving like that? All of the printing works as well.

All of the code bellow is placed in ServerScriptService

wait(10)

local timerLabel = game.StarterGui.timerGUI.timerLabel

local timer = 30
local timerEnd = -1

repeat
	timerLabel.Text = timer
	print(timer)
	wait(1)
	timer = timer - 1
	
until timer == -1

timerLabel.Visible = false

print("Timer ended!")

1 answer

You cant change the player's gui from StarterGui. You need to change it from the PlayerGui in each client. The StarterGui is used to replicate the Gui to the player's PlayerGui when they join.

game.Players.PlayerAdded:Connect(function(player)
	wait(10)

	local timerLabel = player.PlayerGui.timerGUI.timerLabel

	local timer = 30
	local timerEnd = -1

	repeat
    	timerLabel.Text = timer
  	  print(timer)
   	 wait(1)
   	 timer = timer - 1

	until timer == -1

	timerLabel.Visible = false

	print("Timer ended!")
end

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