Armitxes 36 Posted December 11, 2013 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
fusion13 11 Posted December 11, 2013 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
albertfish 11 Posted December 11, 2013 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
tryteyker 28 Posted December 11, 2013 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
Armitxes 36 Posted December 11, 2013 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