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

how to reset player's stats when they died ?

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?

3 comments

0

yes there is.

0

perhaps you can use a loop

0

Can you show me your script?

1 answer

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
char.Humanoid.Died:connect(function()
plr.leaderstats.STAT.Value = 0
end
end)
end)

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