Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make an active script function post respawn?

Asked by 7 years ago

This script works fine, that is, until you die. It's a one trick pony and I can't figure a way around it. It isn't just this one, either. I have this problem with a lot of scripts.

I have found similar questions on this website BUT they don't apply to a script that isn't a touch interest.

The script itself is to heal me rapidly post damage.

I've tried using Character/PlayerAdded but to no avail, as that becomes the new primary event to be fired and the healing would only happen if damage happened during spawn.

wait()
local play = game.Players.LocalPlayer
hum = play.Character.Humanoid
hum.HealthChanged:connect(function()
if hum.Parent.Name == "Player1" or hum.Parent.Name == "pmcdonough" then
if hum.Health < 100 then
repeat
hum.Health = hum.Health + .01
wait(.0005)
until hum.Health == 100
end
end
end)

Answer this question