So i’m not sure why but this died event only runs once, Why?
player.Character.Humanoid.Died:Connect(function()
script.Parent.Parent.Text = "Equip"
end)
So i’m not sure why but this died event only runs once, Why?
player.Character.Humanoid.Died:Connect(function()
script.Parent.Parent.Text = "Equip"
end)
When you die after a few seconds it calls Destroy
on the player’s character, which also calls Destroy
on the descendants of the character, so your Died event only runs once because the event no longer exists after death.
Judging by the fact you use Text
, you’re using a gui, so you would have to listen for CharacterAdded as well
local function onDeath()
script.Parent.Parent.Text = "Equip"
end
player.Character.Humanoid.Died:Connect(onDeath)
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
humanoid.Died:Connect(onDeath)
end)