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:
1 | while script.Parent.Touched do |
2 | print ( "Hes touching it. ;-)" ) |
3 | end |
Erm, just an experiment. Try this in your desired part:
1 | script.Parent.Touched:connect( function (hit) |
2 | if not hit.Parent:FindFirstChild( "Humanoid" ) then return end |
3 | repeat |
4 | hit.Parent.Humanoid:TakeDamage( 10 ) |
5 | wait( 2 ) |
6 | until script.Parent.TouchEnded |
7 | end ) |
Don't downvote on this, it's purely experimental for me too.
If it worked, leave a +1