Originally Posted by
owner erde
how can i make a single area to a multi area
that means if a npc or player is in a single area only 1 can atk but in a multi more can atk
pls help i need that for godwars place
Well first off...
You need to declare a boolean like this
Code:
public boolean inmulti() {
if(absX >= xminimum && absX <= xmaximum && absY >= yminimum && absY <= yminimum || absX >= xminimum && absX <= xmaximum && absY >= yminimum && absY <= yminimum) { // to seperate zones add a || after the y minimum and created another, this void has 2 zones
return true;
} else {
return false;
}
}
then in your attacking npc, and attacking player, and magic on npc and magic on player you need to overide the only be able to attack one.
so like
Code:
if(inmulti() && incombat == true) {
attack coding here
} else if(!inmulti() && incombat == true) {
sendMessage("You are already in combat.");
other coding here
}
and progressivly code it based off the inmulti boolean