Hey Devs
I have a part with this script, how could I make it so when you touch another part this scripts stops… cause it seems to never stop until player dies… I tried adding a
h.health + 6
stops the death but it still takes health. also I can’t do reset cause I need to save the position of player
function onTouched(hit)
local h = hit.Parent:findFirstChild("Humanoid")
while true do
if (h ~= nil) then
h.Health = h.Health - 6
wait(3)
end
end
end
script.Parent.Touched:connect(onTouched)