So lately Ive been trying to make an ocean work so it kills you over time. I have a debounce that is checked when you touch the ocean, if it is false, it will set it to true and damage you (and wait 0.5 seconds to reset debounce to false) but for some reason, you have to jump for it to take damage on you again. I swear I've used this method before and have it work perfectly. Help would be great! (script is serversided, and inside the ocean part (canTouch is on))
local debounce = false
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
if debounce == false then
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 10
debounce = true
wait(0.5)
debounce = false
end
end
end)
