How to take continous damage with cooldown while touching a part, but it going away after you stop touching it?

As the title says, i want to make a spin aiblity that deals damage continous damage while youre touching the hitbox, but it can go away if you stop touching it

1 Like

What do you have so far? chars chasr

1 Like

maybe you can do when the spins touched the player,checking if the hitbox.parent find humanoid and do a while(),and when the spins stop touching the player,do a condition in the loop that is breaking the loop?

spin.Touched:Connect(function()
while wait()
if not hitbox:findfirstchild(“Humanoid”) then
break
end
hitbox:FindFirstChild(“Humanoid”):TakeDamage(dmg)
task.wait(1)

end
end)

1 Like