I've seen things like this before but they've all been no use. Here is my code, can someone help me reset the 'Time alive' counter when the player dies? if you need a better understanding of why I'll need this, here's the link to my game:
https://web.roblox.com/games/4959857494/Dash-BETA
Here is my script:
game.Players.PlayerAdded:connect(function(player)
local Stats = Instance.new("Model", player)
Stats.Name = "leaderstats"
local Timer = Instance.new("IntValue", Stats)
Timer.Name = "Time Alive"
Timer.Value = 0
while true do
wait(1)
Timer.Value = Timer.Value +1
end
end)

1 comment
https://developer.roblox.com/en-us/api-reference/event/Humanoid/Died