Is there a way to make it so as long as the player is touching an object, every 2 seconds he loses health.
Sort of like:
while script.Parent.Touched do
print("Hes touching it. ;-)")
end
Is there a way to make it so as long as the player is touching an object, every 2 seconds he loses health.
Sort of like:
while script.Parent.Touched do
print("Hes touching it. ;-)")
end
Erm, just an experiment. Try this in your desired part:
script.Parent.Touched:connect(function (hit)
if not hit.Parent:FindFirstChild("Humanoid") then return end
repeat
hit.Parent.Humanoid:TakeDamage(10)
wait(2)
until script.Parent.TouchEnded
end)
Don't downvote on this, it's purely experimental for me too.
If it worked, leave a +1
This discussion is preserved as it was. New answers, comments, and votes are closed.