I'm making this script where when I stand in this water it makes the player lose 5 health every 1 second they stand in the water.
wait(1)
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then
h.Health = h.Health -5
end
end
script.Parent.Touched:connect(onTouched)

1 comment
Accept incapaz's answer, it's more advanced