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.
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.