So basically I am trying to make a brick that slowly reduces your health but if you are not touching it anymore, you stop losing health. This is my attempt but it doesnt work.
function damageplr(hit)
wait(1.5)
if hit.Parent.Head then
hit.Parent:FindFirstChild("Humanoid").Health = hit.Parent:FindFirstChild("Humanoid").Health - 5
end
end
function TouchEnd(hit)
end
script.Parent.Touched:connect(function(hit)
wait()
repeat damageplr() until TouchEnd()
hit.Anchored = false
end)
script.Parent.TouchEnded:connect(TouchEnd)
script.Parent.Touched:connect(damageplr)

1 comment
you went all out like you overcooked da chicken