i have this script that increases a value when the local player dies (Local Script)
Script:
wait(2) local plr = game.Players.LocalPlayer local Hum = plr.Character.Humanoid Hum.Died:connect(function() print("You have died. Adding 1+ To Counter.") script.Parent.Value = script.Parent.Value + 1 print("Success") plr.PlayerGui.Main.Deaths.TextLabel.Text = script.Parent.Value end) print("Death Counter.exe Successfully Started")
Each time the player dies it gets a new character and the humanoid connection event no longer runs. You need to hook the humanoids death event to each time the players character is added like I did for you below.
wait(2) local plr = game.Players.LocalPlayer local Hum = plr.Character.Humanoid plr.CharacterAdded:Connect(function(char) Hum = char:WaitForChild("Humanoid"); Hum.Died:Connect(function() print("Death") end) end) print("Death Counter.exe Successfully Started")
I would try getting a player script importer like one of those ragdoll or shift2run scripts, and putting that code in it. That way, the script gets distributed to the player and redistributed after death.