Jump to content
Sign in to follow this  
Armitxes

Disable or Prevent Drowning

Recommended Posts

Hello fellow scripters!

I'm working on a prison mission and I've got the problem that prisoners can break the roleplay by simply suiciding via diving.

Is there a way to prevent a player from drowning or atleast to detect if he's drowning?

The allowDamage function and the HandleDamage event sadly don't work here and I can't find any alternative so far :/

Share this post


Link to post
Share on other sites

You tried unit allowDamage false and then jusy try ti disabke the suicide button if possible..

Share this post


Link to post
Share on other sites

You can get the remaining oxygen of a unit to determine if they are drowning with this, or you can set they oxygen levels to prevent it with this.

Share this post


Link to post
Share on other sites

while {!isTouchingGround player} do {
player setOxygenRemaining 100;
};

Haven't tested it but that should, in theory, work. Execute it server-side.

Share this post


Link to post
Share on other sites

Aww so there are no by the player triggered Events available? I hate (ab)using infinite while loops for something that (might) never happen. But thanks for the help, must do it that way then.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×