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

How to make a "survived time" timer?

I am making a game where the objective is to survive the longest. I do not even know where to start for making a script that starts a timer for every player and then the timer stop for a player when they have died or they are the last one standing.

I thought of using remote event, however I relised it would be impractical.

1 answer

I think I found out a way to make this: Put a local script in StarterCharacterScripts and name it whatever you want. Create a NumberValue in the workspace and name it SurviveTime

local Humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
local Timer = game.Workspace.SurviveTime

while true do
	for i=1, 1, 1 do
		if Humanoid.Health >= 1 then
			Timer.Value = Timer.Value+1
		else
			Timer.Value = Timer.Value+0
		end
	end
end

Hope this helps! Leave a comment if there is anything wrong or anything I should add.

2 comments

0

N o. This code is full of redundancies and serious contradictions.

0

I dont know what that means

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