What could I change or add to make it so when the humanoid stops touching the part it will stop healing them?

local Enabled = true

 

script.Parent.Touched:Connect(function(Hit)

    if Hit.Parent:FindFirstChild("Humanoid") and Enabled == true then

        Enabled = false

        repeat

        wait(0.2)

        Hit.Parent.Humanoid.Health = Hit.Parent.Humanoid.Health + 10

        until Hit.Parent.Humanoid.Health <= 0

        Enabled = true

    end

end)

6 comments

0

i have an idea

0

pput around the brick invisible walls if u touch them they will disable the script so it will stop heal

0

and if u touch the heal block it wll enable the script ;DD!!! if u dont know what disabled and enabled means looks at properties of script and look for Disabled u can turn it off and on

0

No. Just have another touched event from the same script with invisible blocks.

0

So you used my script but you gave someone else the "Correct Answer" :?

0

sorry INOOBE i fixed the correct answer sorry I messed up :/