How to make the script repeat after death?

Hello, I want to make the script repeat after death. How to do it?

This is a script:
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild(“Humanoid”) ~= nil then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player.leaderstats.Speed.Value = player.leaderstats.Speed.Value + 1
script.Sound:Play()
script.Disabled = true
end
end)

… just remove the script.Disabled = true

After that script will be repeated again and again, point is to give me +1 speed only once so when player dies they give +1 again…

1 Like

Add a debounce find more here

Instead of disabling the script

1 Like

you could use the .Died event on the humanoid learn more here Humanoid.Died

that could work too yeah
(char limit’s a bitch aint gon lie)

1 Like

The reason why he’s disabling the script is probably because the .Touched event is fired multiple times (for each limb and it fires pretty much if you move)

yeah, but he could’ve just used debounce, as you said.

1 Like

I know about that, but with that I can only limit it in terms of time, I need him to give me +1 speed and then repeat it again only after he dies.

add the player to a table when they touch it

if player is NOT in table, give them speed

when they die, remove them from the table