Anti Swimming


#1

Keeps players from swimming

// NPC made by 2ndwolf
if (playerenters&&!isweapon){
  toweapons -antiswimming;
  timereverywhere;
  timeout = .5;
}
else if (playerenters){
  timereverywhere;
  timeout = .5;
}

if (timeout&&!strequals(#m,swim)&&!strequals(#m,drown)){
  this.regenx = playerx;
  this.regeny = playery;
  timereverywhere;
  timeout = .5;
}
else if(timeout&&strequals(#m,swim)||timeout&&strequals(#m,drown)) {
  sleep 2;
  setani drown,;
  freezeplayer 2;
  sleep 2;
  playerx = this.regenx;
  playery = this.regeny;
  hurt .5;
  timereverywhere;
  timeout = 1;
}

#2

^^ Thanks, will definitely put this to use out at sea.


#3

the timereverywhere thing is triggering me

also sleep is stupid because it makes the script literally stop running for however many seconds


#4

You’re making me wonder why it works now that I read it…