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 our 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 Adding items to a chest

Discussion in 'Skript' started by BrownMee, Sep 10, 2018.

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

    BrownMee Well-Known Member

    Joined:
    Apr 16, 2018
    Messages:
    63
    Likes Received:
    4
    Code (Skript):
    1. on break of stone:
    2.     wait 2 ticks
    3.     set location of targeted block to {treasure}
    4.     set {treasure} to chest
    5.     wait 5 ticks
    6.     add 5 torch to {treasure}'s inventory
    Not sure why this doesn't work. HMMM?

     
  2. Best Answer:
    Post #12 by Dabriel, Sep 10, 2018
  3. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    1,234
    Likes Received:
    71
    Medals:
    This maybe:
    Code (Skript):
    1. on break of stone:
    2.     wait 2 ticks
    3.     set {treasure} to targeted block
    4.     wait 5 ticks
    5.     add 5 torch to {treasure}'s inventory
     
  4. BrownMee

    BrownMee Well-Known Member

    Joined:
    Apr 16, 2018
    Messages:
    63
    Likes Received:
    4
    Worst. Now it doesn't even spawn the chest...
     
  5. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    1,234
    Likes Received:
    71
    Medals:
    Well it's hard to help someone when they don't explain their problem:
    Code (Skript):
    1. on break of stone:
    2.     wait 2 ticks
    3.     set {treasure} to targeted block
    4.     set block at {treasure} to chest
    5.     wait 5 ticks
    6.     add 5 torch to {treasure}'s inventory
     
  6. BrownMee

    BrownMee Well-Known Member

    Joined:
    Apr 16, 2018
    Messages:
    63
    Likes Received:
    4
    I want the 5 torch to add into the chest that spawned.
     
  7. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    1,234
    Likes Received:
    71
    Medals:
    So what's it doing now?
     
  8. BrownMee

    BrownMee Well-Known Member

    Joined:
    Apr 16, 2018
    Messages:
    63
    Likes Received:
    4
    No error. The chest spawned but the items are not in the chest.
     
  9. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    1,234
    Likes Received:
    71
    Medals:
    What Skript + MC version are you using?
     
  10. BrownMee

    BrownMee Well-Known Member

    Joined:
    Apr 16, 2018
    Messages:
    63
    Likes Received:
    4
    latest bensku and latest 1.12.2 spigot
     
  11. Dabriel

    Dabriel Well-Known Member

    Joined:
    Aug 13, 2018
    Messages:
    45
    Likes Received:
    5
    try this. didn't test it but try it
    Code (Skript):
    1. on break of stone:
    2.     wait 2 ticks
    3.     set {treasure} to event-block's location
    4.     set block at {treasure} to chest
    5.     wait 5 ticks
    6.     set {treasureblock} to block at {treasure}
    7.     add 5 torch to {treasure}'s inventory
     
  12. BrownMee

    BrownMee Well-Known Member

    Joined:
    Apr 16, 2018
    Messages:
    63
    Likes Received:
    4
    Tried. Empty chest :emoji_frowning:
     
  13. Dabriel

    Dabriel Well-Known Member

    Joined:
    Aug 13, 2018
    Messages:
    45
    Likes Received:
    5
    Code (Skript):
    1. on break of stone:
    2.     wait 2 ticks
    3.     set {treasure} to event-block's location
    4.     set block at {treasure} to chest
    5.     wait 5 ticks
    6.     set {treasureblock} to block at {treasure}
    7.     add 5 torch to {treasureblock}'s inventory
    I tested this, it works
     
  14. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    1,234
    Likes Received:
    71
    Medals:
    I tested this one and it works for me
     
  15. BrownMee

    BrownMee Well-Known Member

    Joined:
    Apr 16, 2018
    Messages:
    63
    Likes Received:
    4
    T
    Thanks!!
     
    • Like Like x 1
  16. Dabriel

    Dabriel Well-Known Member

    Joined:
    Aug 13, 2018
    Messages:
    45
    Likes Received:
    5
    No problem :emoji_relaxed:
     
Thread Status:
Not open for further replies.
Loading...