Hey! So as the title says, I can’t quite figure out how to create a time alive counter until you die which will then reset to 0. This is what I have so far
local canGet = true
game.Players.PlayerAdded:connect(function(player)
if player and canGet then
canGet = false
player.leaderstats.Timealive.Value = player.leaderstats.Timealive.Value + 1
wait(1)
canGet = true
end
end)
I have tried the while true loop, although that doesn’t seem to work. The script runs once and then just ends, giving the player one point. I also already created the leaderboard in another script.
Any help?