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.

Solved Auto-generation

Discussion in 'Skript' started by Flajakay, Jan 25, 2019.

Thread Status:
Not open for further replies.
  1. Flajakay

    Flajakay Active Member

    Joined:
    Jul 29, 2018
    Messages:
    55
    Likes Received:
    1
    Is it possible to make auto-generation of special blocks in caves?
     
  2. Best Answer:
    Post #2 by MusicManSK, Jan 25, 2019
  3. MusicManSK

    MusicManSK Active Member

    Joined:
    Nov 30, 2017
    Messages:
    232
    Likes Received:
    11
    Try:

    Code (Text):
    1.  
    2. on chunk generate:
    3.     if random integer between 0 and 10 is 1:
    4.         loop blocks within event-chunk:
    5.             if y-pos of loop-block is less than 60:
    6.                 if loop-block is air:
    7.                     if block under loop-block is stone:
    8.                         set {_c} to 0
    9.                         loop blocks in radius 2 of loop-block:
    10.                             if loop-block-2 is air:
    11.                                 add 1 to {_c}
    12.                         if {_c} is more than 3:
    13.                             if random integer between 0 and 200 is 1:
    14.                                 set loop-block to gold block
    15.                                 broadcast "&6Special block generated on &b%location of loop-block%&6!" to event-world
    16.                                 exit
    17.  
    You can change chance (in my example 200) of generating "special" blocks on line
    Code (Text):
    1. if random integer between 0 and 800 is 1:
    But do not use small number because there will be a lot of "special" blocks!
    And chance of choosing chunk (in my example 10):
    Code (Text):
    1. if random integer between 0 and 10 is 1:
     
    #2 MusicManSK, Jan 25, 2019
    Last edited: Jan 25, 2019
    • Like Like x 1
  4. Flajakay

    Flajakay Active Member

    Joined:
    Jul 29, 2018
    Messages:
    55
    Likes Received:
    1
    Thanks a lot!
     
  5. MusicManSK

    MusicManSK Active Member

    Joined:
    Nov 30, 2017
    Messages:
    232
    Likes Received:
    11
    You're welcome
     
Thread Status:
Not open for further replies.

Share This Page

Loading...