1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Skript to big?

Discussion in 'Skript' started by BedorvePeer, Oct 14, 2021.

  1. BedorvePeer

    BedorvePeer Member

    Joined:
    Oct 14, 2021
    Messages:
    1
    Likes Received:
    0
    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 (Text):
    1. on mine:
    2.     lore of player's tool contains "&7Miner 4"
    3.     set {_1} to location of event-block
    4.     set {_2} to location of event-block
    5.     add 2 to x-coord of {_1}
    6.     subtract 2 from x-coord of {_2}    
    7.     add 1 to z-coord of {_1}
    8.     subtract 1 from z-coord of {_2}
    9.     loop blocks within {_1} to {_2}:
    10.         set loop-block to air
    11.         set {_3} to location of event-block
    12.         set {_4} to location of event-block
    13.         add 2 to z-coord of {_3}
    14.         subtract 2 from z-coord of {_4}    
    15.         add 1 to x-coord of {_3}
    16.         subtract 1 from x-coord of {_4}
    17.         loop blocks within {_3} to {_4}:
    18.             set loop-block-2 to air
    19.             set {_5} to location of event-block
    20.             set {_6} to location of event-block
    21.             add 1 to z-coord of {_5}
    22.             subtract 1 from z-coord of {_6}    
    23.             add 1 to x-coord of {_5}
    24.             subtract 1 from x-coord of {_6}
    25.             add 1 to y-coord of {_5}
    26.             subtract 1 from y-coord of {_6}
    27.             loop blocks within {_5} to {_6}:
    28.                 set loop-block-3 to air
    29.                 set {_7} to location of event-block
    30.                 set {_8} to location of event-block
    31.                 add 3 to x-coord of {_7}
    32.                 subtract 3 from x-coord of {_8}
    33.                 loop blocks within {_7} to {_8}:
    34.                     set loop-block-4 to air
    35.                     set {_9} to location of event-block
    36.                     set {_10} to location of event-block
    37.                     add 3 to z-coord of {_9}
    38.                     subtract 3 from z-coord of {_10}
    39.                     loop blocks within {_9} to {_10}:
    40.                         set loop-block-5 to air
    41.                         set {_11} to location of event-block
    42.                         set {_12} to location of event-block
    43.                         add 1 to y-coord of {_11}
    44.                         subtract 1 from y-coord of {_12}
    45.                         add 2 to z-coord of {_11}
    46.                         subtract 2 from z-coord of {_12}
    47.                         loop blocks within {_11} to {_12}:
    48.                             set loop-block-6 to air
     
    #1 BedorvePeer, Oct 14, 2021
    Last edited: Oct 17, 2021 at 1:52 PM
  2. Reygon

    Reygon Member

    Joined:
    Sunday
    Messages:
    1
    Likes Received:
    0
    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.
     

Share This Page

Loading...