1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Underwater

Discussion in 'Programming' started by Crazy Catiwis, Jun 26, 2013.

  1. There is some form to know if a player is underwater? I mean a function or something.

    Thanks.
     
  2. All I can think of is anims.
     
  3. I mean when scripting.
     
  4. Detect anims.
    Like those.


    Alternatively, you can look for when the animations are played.
     
  5. I'm trying to make what every 3-4 seconds you get 5 or 10 of damage when you are underwater. How can i do that using the anims?
     
  6. Fixed.

    Code:
    -- Called each tick.
    function PLUGIN:Tick()
    	if( !self.NextCheck or self.NextCheck < CurTime() )then
    		self.NextCheck = CurTime() + 3;
    		
    		for k,v in pairs(_player.GetAll())do
    			if (v:WaterLevel() == 3) then
    				v:TakeDamage(5, v, v);
    			end;
    		end;
    	end;
    end;
     

Previous Readers (Total: 0)