so this is the code i have for
local player
script.Parent.Touched:connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = 0
player = game.Players:GetPlayerFromCharacter(hit.Parent)
player.leaderstats.lives.Value = player.leaderstats.lives.Value - 1
end
end)
but when i run the code and try it, it kills me but when i look at the leaderboard it can reduce my lives up to 4 times for one death i have tried a lot of things but im not sure what to do or how do i make it so the code is only run once

3 comments
here is the link if you want to play the game also im coming out with an update on my birthday 5/27/2020 (tomorrow)
https://www.roblox.com/games/5046873350/New-Impossible-Obby-BETA-LEVEL-3-IS-OUT?refPageId=2f032af0-5d23-477b-a5e6-2c380f79839f
i would love to hear feedback