Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make this countdown keep running even if player is killed or resets ?

Asked by
Krlos21 45
10 years ago
local Time = 30
local gui = script.Parent

for i = Time, 0, -1 do
    Time = i 
    gui.Text = tostring(Time) -- This will change the text to how much time is left
    wait(1)
end

What i am trying to do is that if you're playing and reset or your character gets killed the time keeps counting down, everything works okay but when I reset the player in test mode it sets the time back again to the beginning help

also i tried to when time reaches "0" it resets the player and start the time back again I tried

if i = 0 
then game.players.Humanoids.Heath = 0 
end

1 answer

Log in to vote
1
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
10 years ago

Hmm... You could change the StarterGui's ResetPlayerGuiOnSpawn setting through the Studio command bar;

game:GetService("StarterGui").ResetPlayerGuiOnSpawn = false

Ad

Answer this question