I'm using a timer to see if anyone can finish in 2 minutes for my obby game but when ever we die then the timer restarts. Can anyone help me I want the timer to continue. The script is
script.Parent.Parent.Play.MouseButton1Click:Connect(function() local seconds = script.Parent.Parent.Time script.Parent.Text = seconds.Value for i = 1,seconds.Value do wait(1) seconds.Value = seconds.Value - 1 script.Parent.Text = seconds.Value end if script.Parent.Text == "0" then script.Parent.Sound:Play() end end)
Btw I'm new to lua.
This doesn't require any scripting at all.
What you must do is go to the ScreenGui, and untick the ResetOnSpawn
property. This property determines if a new instance of the GUI should be given on respawn.
When you spawn, the contents of StarterGui are cloned into your player's PlayerGui. It's a different GUI you are seeing each time you reset.