gui = game.StarterGui.raidgui.raidtimer.raidtime
timevalue = script.Parent.TimeValue
maxtime = script.Parent.TimeValue.Value
for i = 1, timevalue.Value do
wait(1)
gui.Text = tostring(maxtime-timevalue.Value)
timevalue.Value = timevalue.Value - 1
end
I am using this code to make a timer and it worked when I pressed run but when I entered a game, it seemed like as soon as the server started, the timer started, but when a player enters, the timer stops. What can I do to change this?
Info: I am using StarterGui-ScreenGui-Frame for the Gui the TimeValue is in Workspace along with the script.

6 comments
Okay I will try this and see if it works.
I tried that but this time even the GUI was not changed. When I press run scripts, the IntValue changes like its supposed to but the Guis text does not.
That is because you're testing it by pressing Run, but scripts do not run in StarterGui. They only run in PlayerGui, and to have a PlayerGui you need a player. Try using PlaySolo instead.
Okay thanks.
THanks for the help it worked! I think I know how to make it start, end and reset on command but ill check back in if i need any help.
If you click the Accept Answer button we both get points!