Detect if player inside area

thedeibo

Staff member
Department Head
Community Moderator
#1
Description: To be able to Detect if player is inside a chosen set area with cords.

Make sure you put the correct cords in the right place for it to work.
The "min" and "max" variables are the variables to edit. to make this work.

Code:
let %minX% = 10
let %minY% = 10
let %minZ% = 10
let %maxX% = 200  
let %maxY% = 200
let %maxZ% = 200
let %status% = playerstatus(%p%)
let %playerX% = %status%[\"x\"]
let %playerY% = %status%[\"y\"]
let %playerZ% = %status%[\"z\"]
if (%playerX% >= %minX%) and (%playerX% <= %maxX%) and (%playerY% >= %minY%) and (%playerY% <= %maxY%) and (%playerZ% >= %minZ%) and (%playerZ% <= %maxZ%) then goto 14
message %p% Outside of area
exit
message %p% Inside of Area
exit
This is more of a template for you to do the features that you wish to do. :) Enjoy