so i have a leaderstat in my game called "Lives" but i dont know how to lower it by 1 whenever the player dies, i dont know where to start so i made this script which is probably not even close. also the amount of lives the player starts with is 25 if it helps.
local player = game.Players.LocalPlayer
local lives = player.leaderstats.Lives
if player.Humanoid.Health = 0 then
lives.Value = lives.Value - 1
end
thanks

1 comment
Made a mistake to the code, and I've edited it