okay, so im making a game when you touch the brick, it will damage you by 5 every second. but when you stop touching it, it stops damaging you. but my script doesn't stop it from damaging the player AND it doesn't even damage it every second. i cant seem to figure out how to do this though. please help!
function touch(hit)
while true do
hit.Parent:FindFirstChild("Humanoid").Health = hit.Parent:FindFirstChild("Humanoid").Health -5
wait (1)
end
end
script.Parent.Touched:connect(touch)

1 comment
try this: