Quote:
|
Originally Posted by EmpireOwnsYou
I wrote up some temp code for when I would make the TNT for my server for mining, and well its tnt only so the code is sort of important to make sure rocks dont end up on walls... and also so people can not spam tnt and block area's in. For some reason onwall2 tells me that every single tile is on a wall, no matter where it is... Maybe I scripted it wrong, or maybe theres something wrong with the command? I was hoping someone could tell me.
|
You could do a few things to improve this. First, onwall2 is measured in tiles, not pixels, so you are measuring a 32x32 tile area for one blocking tile

.
The second is minor: Put a semicolon after the join command. Remember, it's like you're creating an npc with the script being whatever is inside the brackets. You're creating an npc with one command, join, and it isn't properly terminated with a semicolon.
Also, it looks like you want to just create this.rocks rocks, but the way you are doing it seems a little cumbersome. Instead, you could try something like this:
NPC Code:
while (this.rocks > 0) {
if (not onwall){
//place rock
this.rocks--;
}
}
I wouldn't try it in a level with a ton of blocking tiles though (for your way or my way).