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

how to reset player's stats when they died ?

Asked by 4 years ago
Edited 4 years ago

i want to reset player's stats when player died. Stats not saved data will be lost and stats saved data will not be reset. I can create a script that sets the value to 0 for each stats type when the player dies, but I have many types of stats, is there a way to solve this problem faster?

0
yes there is. greatneil80 2647 — 4y
0
perhaps you can use a loop HappyTimIsHim 652 — 4y
0
Can you show me your script? rabbi99 714 — 4y

1 answer

Log in to vote
0
Answered by
Robowon1 323 Moderation Voter
4 years ago
Edited 4 years ago
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
char.Humanoid.Died:connect(function()
plr.leaderstats.STAT.Value = 0
end
end)
end)
Ad

Answer this question