loop help

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

ShaneBee

Supporter +
Addon Developer
Sep 7, 2017
2,248
241
73
Vancouver, Canada
Hello

I am trying to create a loop, that when a player presses a button in a room, it can tell them how many air blocks are WITHIN the confinement of the walls

Ive tried doing a radius loop, but obviously its going to loop and count the air outside the walls.
Is there a way to stop the loop at the walls, and only count the air blocks within the room?
 
Basically yeah.
So far, I have set it up, LONG code it seems, but from the centre (machine) it loops out counting air blocks along x, y, z, and stops the loop as soon as it hits something that is not air.

So basically a room that is 10 x 10 (inside) and 3 blocks high, it would count back that its 300 blocks.
The problem is, if there is a break in the wall that is not lined up with the machine, the machine still thinks the room is air tight.

I was hoping there would be a way to do a radial loop for the air blocks in the room.
Is that possible?
 
There was a skript challenge to fill an enclosed area. You can view it in the skript challenge subforum and it may or may not help with what you’re trying to do
 
Status
Not open for further replies.