So i need the loop to keep damaging the player every let's say .5 seconds while he is touching a certain part, and when he stops for it to stop as well. I am not asking for someone to make the whole script for me, i need someone to help me make it. I'd really appreciate if someone told me what to do and maybe linked me the developer wiki article connected to that.
You could do something like this.
local part = workspace.BRICK local touch = false -- Debounce part.Touched:Connect(function(hit) touch = true while touch do wait(.5) -- Delay -- Code here part.TouchEnded:Connect(function() touch = false end) end end)
If this helped you please mark as answered :)