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.

Chest Loot

Discussion in 'Skript' started by Fridious, Jun 25, 2017.

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

    Fridious Member

    Joined:
    Jun 23, 2017
    Messages:
    33
    Likes Received:
    0
    I have a question, how can i do that the chestfill fills the chest every 10 seconds?

    My script:

    Code (Skript):
    1.  
    2. on load:
    3.     delete {random.item.list::*}
    4.     add 2 diamond to {random.item.list::*}
    5.     add 2 iron ingot to {random.item.list::*}
    6.     add 2 leather to {random.item.list::*}
    7.     add 2 tnt to {random.item.list::*}
    8.     add 1 flint and steel to {random.item.list::*}
    9.     add 1 golden apple to {random.item.list::*}
    10.     add 4 cooked beef to {random.item.list::*}
    11.     add 32 stone to {random.item.list::*}
    12.     add 32 cobblestone to {random.item.list::*}
    13.     add 4 cooked porkchop to {random.item.list::*}
    14.     add 32 planks to {random.item.list::*}
    15.     add 2 apple to {random.item.list::*}
    16.     add 1 stone sword to {random.item.list::*}
    17.     add 1 stone pickaxe to {random.item.list::*}
    18.     add 1 stone axe to {random.item.list::*}
    19.     add 1 leather leggings to {random.item.list::*}
    20.     add 1 leather boots to {random.item.list::*}
    21.     add 1 leather chestplate to {random.item.list::*}
    22.     add 1 leather helmet to {random.item.list::*}
    23.     add 4 snowball to {random.item.list::*}
    24.     add 4 arrow to {random.item.list::*}
    25.     add 1 bow to {random.item.list::*}
    26.     add 1 iron sword to {random.item.list::*}
    27.     add 1 iron pickaxe to {random.item.list::*}
    28.     add 1 iron axe to {random.item.list::*}
    29.     add 1 iron leggings to {random.item.list::*}
    30.     add 1 iron boots to {random.item.list::*}
    31.     add 1 iron chestplate to {random.item.list::*}
    32.     add 1 iron helmet to {random.item.list::*}
    33.     add 1 diamond sword to {random.item.list::*}
    34.     add 1 diamond pickaxe to {random.item.list::*}
    35.     add 1 diamond axe to {random.item.list::*}
    36.     add 1 diamond boots to {random.item.list::*}
    37.     add 1 diamond leggings to {random.item.list::*}
    38.     add 1 diamond helmet to {random.item.list::*}
    39.     add 1 diamond chestplate to {random.item.list::*}
    40.     wait 1 tick
    41.     execute console command "/chest"
    42.     create timer "chestzeit" for 10 seconds
    43. command /chest:
    44.     trigger:
    45.         loop blocks in radius 1 around {chestloc}:
    46.             if loop-block is a chest:
    47.                 clear loop-block's inventory
    48.                 set {_item} to a random number between 3 and 6
    49.                 loop {_item} times:
    50.                     set {_randomitem} to random element out of {random.item.list::*}
    51.                     add {_randomitem} to the loop-block's inventory
    52. command /setloc:
    53.     trigger:
    54.         set {chestloc} to player's position
    55.  
    56. on timer complete:
    57.     stop timer "chestzeit"
    58.     execute console command "/chest"
    59.     create timer "chestzeit" for 10 seconds

    Thank you
     
    #1 Fridious, Jun 25, 2017
    Last edited: Jun 25, 2017
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Impossible to read your code. Use

    Code (Skript):
    1. [CODE=SKRIPT]CODE INSIDE[ /CODE]
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Code (Skript):
    1. on load:
    2.     delete {random.item.list::*}
    3.     add 2 diamond to {random.item.list::*}
    4.     add 2 iron ingot to {random.item.list::*}
    5.     add 2 leather to {random.item.list::*}
    6.     add 2 tnt to {random.item.list::*}
    7.     add 1 flint and steel to {random.item.list::*}
    8.     add 1 golden apple to {random.item.list::*}
    9.     add 4 cooked beef to {random.item.list::*}
    10.     add 32 stone to {random.item.list::*}
    11.     add 32 cobblestone to {random.item.list::*}
    12.     add 4 cooked porkchop to {random.item.list::*}
    13.     add 32 planks to {random.item.list::*}
    14.     add 2 apple to {random.item.list::*}
    15.     add 1 stone sword to {random.item.list::*}
    16.     add 1 stone pickaxe to {random.item.list::*}
    17.     add 1 stone axe to {random.item.list::*}
    18.     add 1 leather leggings to {random.item.list::*}
    19.     add 1 leather boots to {random.item.list::*}
    20.     add 1 leather chestplate to {random.item.list::*}
    21.     add 1 leather helmet to {random.item.list::*}
    22.     add 4 snowball to {random.item.list::*}
    23.     add 4 arrow to {random.item.list::*}
    24.     add 1 bow to {random.item.list::*}
    25.     add 1 iron sword to {random.item.list::*}
    26.     add 1 iron pickaxe to {random.item.list::*}
    27.     add 1 iron axe to {random.item.list::*}
    28.     add 1 iron leggings to {random.item.list::*}
    29.     add 1 iron boots to {random.item.list::*}
    30.     add 1 iron chestplate to {random.item.list::*}
    31.     add 1 iron helmet to {random.item.list::*}
    32.     add 1 diamond sword to {random.item.list::*}
    33.     add 1 diamond pickaxe to {random.item.list::*}
    34.     add 1 diamond axe to {random.item.list::*}
    35.     add 1 diamond boots to {random.item.list::*}
    36.     add 1 diamond leggings to {random.item.list::*}
    37.     add 1 diamond helmet to {random.item.list::*}
    38.     add 1 diamond chestplate to {random.item.list::*}
    39.     wait 1 tick
    40.     execute console command "/chest"
    41.     create timer "chestzeit" for 10 seconds
    42.    
    43. command /chest:
    44.     trigger:
    45.         loop blocks in radius 1 around {chestloc}:
    46.             if loop-block is a chest:
    47.                 clear loop-block's inventory
    48.                 set {_item} to a random number between 3 and 6
    49.                 loop {_item} times:
    50.                     set {_randomitem} to random element out of {random.item.list::*}
    51.                     add {_randomitem} to the loop-block's inventory
    52. command /setloc:
    53.     trigger:
    54.         set {chestloc} to player's position
    55.  
    56. on timer complete:
    57.     stop timer "chestzeit"
    58.     execute console command "/chest"
    59.     create timer "chestzeit" for 10 seconds
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    What doesn't work?

    If the items just aren't being added to the chest try doing this instead of adding {_randomitem} to the chest's inventory
    Code (Skript):
    1. set {_slot} to random integer between 0 and 27
    2. set slot {_slot} of loop-block's inventory to {_randomitem}
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234

    So I have edit the code. Sorry
     
Thread Status:
Not open for further replies.

Share This Page

Loading...