I'm trying to make a local script that resets some items in the player whenever they die. But for some reason, it functions only the first time the player dies and won't function after that.
local player = game.Players.LocalPlayer
repeat wait() until player.Character
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
humanoid.Died:connect(function()
player.LegBroken.Value = false
player.Bleeding.Value = false
player.PlayerScripts.SprintScript.Disabled = false
end)

8 comments
it's because the values are already set to false on any succeeding run
it sets them the first time and they stay like that with your script
But I always change it to test and it does not reset after the first time.
try using if statements before changing each value
if that doesn't work, capitalize connect()
use player.CharacterAdded:Wait() instead of a repeat loop
oh i skipped right over that
Thanks for your help.