Hallo, I made a countdown that shows the time left until the round is over but when I “Play test” the game as a player, the UI does not update unless I reset while it works perfectly fine if I were to just “Run test” it.
*The game’s rounds still work perfectly fine as it’s just the client side that is not showing the updated countdown
Here’s a sample of the code: (I’m learning)
Time = 1 --Time is meant to be seconds
minutes = 0
while true do
local gui = game:GetService("StarterGui")
gui:WaitForChild("ScreenGui")
Time -= 1
--Intermission
if Time == 0 and minutes == 0 then
print("Intermission Loop started")
timetext = ("0"..minutes..":0"..Time)
for i = 1, 30 do
timetext = ("Intermission (".. 31-i ..")")
gui.ScreenGui.Time.Text = timetext
wait(1)
end
Time = 11
minutes = 9
elseif Time < 10 and Time ~= 0 then
timetext = ("0"..minutes..":0"..Time)
print("seconds are defined by 1 digit")
elseif Time == 0 then
minutes -= 1
Time = 59
timetext = ("0"..minutes..":"..Time)
print("seconds are now defined by 2 digits")
else
timetext = ("0"..minutes..":"..Time)
end
print(timetext)
gui.ScreenGui.Time.Text = timetext
wait(.1)
end
Ahhhhhh. This is because you refer to starter gui. Dont use starter gui. Use game.Players.LocalPlayer.PlayerGui.MyGUI.
Please dont use starter gui. The reason it works in test run is because studio isnt a player so it defaults to using starter gui. But for players they use something called player gui. Each player gui has there own player gui folder. Your script is working the only thing you havw to change is the startergui thing.