I've got this script:
local part = script.Parent
part.Touched:Connect(function(h)
local humanoid = h.Parent:FindFirstChild("Humanoid")
while humanoid do
humanoid:TakeDamage(0.3)
wait(0.5)
end
end)
When the part is touched, humanoid is supposed to take damage while character is touching the part, but when the touch ends, the damage taking is supposed to stop. That won't work. I've tried saying this:
part.TouchEnded:Connect(function(h)
end)
underneath that but it wouldn't work either.
I'd also like one more thing. When the part is being stood on the damage increases and I don't want that. This is not necessary but if you can do it I'd be very thankful.
Thanks ^^

3 comments
https://developer.roblox.com/recipes/How-to-disconnect-an-event-connection
or break
May be simple, but I still dont understand ;-;