Skript to big?

  • 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.

BedorvePeer

Member
Oct 14, 2021
1
0
1
25
So i made a enchant skript that when you mine it mines all of the blocks i said need to be but is it to mutch cuz when i mine i lagg and the server crashes. Server should need to bhe good enough. is there anyway to get it smaller maby or to let it lagg less?


Code:
on mine:
    lore of player's tool contains "&7Miner 4"
    set {_1} to location of event-block
    set {_2} to location of event-block
    add 2 to x-coord of {_1}
    subtract 2 from x-coord of {_2}    
    add 1 to z-coord of {_1}
    subtract 1 from z-coord of {_2}
    loop blocks within {_1} to {_2}:
        set loop-block to air
        set {_3} to location of event-block
        set {_4} to location of event-block
        add 2 to z-coord of {_3}
        subtract 2 from z-coord of {_4}    
        add 1 to x-coord of {_3}
        subtract 1 from x-coord of {_4}
        loop blocks within {_3} to {_4}:
            set loop-block-2 to air
            set {_5} to location of event-block
            set {_6} to location of event-block
            add 1 to z-coord of {_5}
            subtract 1 from z-coord of {_6}    
            add 1 to x-coord of {_5}
            subtract 1 from x-coord of {_6}
            add 1 to y-coord of {_5}
            subtract 1 from y-coord of {_6}
            loop blocks within {_5} to {_6}:
                set loop-block-3 to air
                set {_7} to location of event-block
                set {_8} to location of event-block
                add 3 to x-coord of {_7}
                subtract 3 from x-coord of {_8}
                loop blocks within {_7} to {_8}:
                    set loop-block-4 to air
                    set {_9} to location of event-block
                    set {_10} to location of event-block
                    add 3 to z-coord of {_9}
                    subtract 3 from z-coord of {_10}
                    loop blocks within {_9} to {_10}:
                        set loop-block-5 to air
                        set {_11} to location of event-block
                        set {_12} to location of event-block
                        add 1 to y-coord of {_11}
                        subtract 1 from y-coord of {_12}
                        add 2 to z-coord of {_11}
                        subtract 2 from z-coord of {_12}
                        loop blocks within {_11} to {_12}:
                            set loop-block-6 to air
 
Last edited:
The loops are looping themselves, you don't have the indents going back to the original ones, so basically, you're running those last lines of code 244140625 times.
 
Status
Not open for further replies.