Generation

  • 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 community!

    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!

famous

New Member
Oct 25, 2024
6
0
1
Having issues with this line, still new to skript and trying to get it it simply generates a grid

[06:16:48 INFO]: Line 12: (generation.sk)
[06:16:48 INFO]: There's no loop that matches 'loop-number - 1'
[06:16:48 INFO]: Line: set {_x} to (loop-number - 1) * {@grid-size}
[06:16:48 INFO]:
[06:16:48 INFO]: Line 13: (generation.sk)
[06:16:48 INFO]: There's no loop that matches 'loop-number is 19'
[06:16:48 INFO]: Line: if loop-number is 1 or loop-number is {@grid-size} or loop-number-2 is 1 or loop-number-2 is {@grid-size}:
[06:16:48 INFO]:
[06:16:48 INFO]: Line 15: (generation.sk)
[06:16:48 INFO]: 'else' has to be placed just after another 'if' or 'else if' section
[06:16:48 INFO]: Line: else:
[06:16:48 INFO]:
[06:16:48 INFO]: [Skript] Encountered 3 errors while reloading generation.sk! (10853ms)


Code:
options:

    grid-size: 19

    quadrants: 750

    outline-color: white_concrete

    fill-color: green_concrete

    grid-height: 0



on load:

    loop {@quadrants} times:

        set {_z} to (loop-number - 1) * {@grid-size}

        loop {@grid-size} times:

            set {_x} to (loop-number - 1) * {@grid-size}

            if loop-number is 1 or loop-number is {@grid-size} or loop-number-2 is 1 or loop-number-2 is {@grid-size}:

                set block at ({_x}, {@grid-height}, {_z}) to {@outline-color}

            else:

                set block at ({_x}, {@grid-height}, {_z}) to {@fill-color}
 
Last edited:
Can you share your whole code? I'll try to find a solution to the problem.
And do you have any skript addons installed? If yes, can you list them with the version?
 
Having lots of errors trying to fix it, I have: Skript, SkQuery, SkBee, skRayFall
I want a map to be generated randomly similar to gen pvp servers (picture for refernce but I want bigger cubes, more connected cubes, ect) but was too complex so I tried just making a grid which failed too (which is this). If you had any idea on how to make the cubes too that would be nice too ty

Screenshot 2024-10-27 181937.png


code:
options:
grid-size: 19
quadrants: 750
outline-color: white_concrete
fill-color: green_concrete
grid-height: 0

on load:
loop {@quadrants} times:
set {_z} to (loop-number - 1) * {@grid-size}
loop {@grid-size} times:
set {_x} to (loop-number - 1) * {@grid-size}
if loop-number is 1 or loop-number is {@grid-size} or loop-number-2 is 1 or loop-number-2 is {@grid-size}:
set block at ({_x}, {@grid-height}, {_z}) to {@outline-color}
else:
set block at ({_x}, {@grid-height}, {_z}) to {@fill-color}
 
Last edited: