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 on chest open

Discussion in 'Skript' started by [Why is this here] fdsfd, May 5, 2019.

Thread Status:
Not open for further replies.
  1. [Why is this here] fdsfd

    Joined:
    Apr 6, 2019
    Messages:
    21
    Likes Received:
    0
    I'm making a crates skript and I don't know the event on when a player opens a chest named "CRATES"
    Here's what I'm doing.
    Code (Text):
    1. on open of chest named "CRATES":
    2.     open virtual chest inventory of size 6 named "&8CRATES"
    and yeah. Any help?
     
  2. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    I would recommend that you do something else, do something like this:
    Code (Skript):
    1.  
    2. on right click:
    3.     if "%region at player%" contains "crates": #or the region of your crates warp.
    4.         if event-block is coal block: #Or the block you want.
    5.             set {_key} to Tripwire Hook named "&6&lCrate Key &aR&ba&cn&dd&eo&fm"
    6.             enchant {_key} with unbreaking 9999
    7.             if player's held item = {_key}:
    8.                 remove 1 of {_key} from event-player's inventory
    9.                 open chest with 6 rows named "&8Crates" to player
    10.                 #do stuff here.
    11.  
    12.  
     
  3. Runakai

    Moderator Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    use the on inventory open event and get the name
     
  4. CharcoalToast

    CharcoalToast Member

    Joined:
    Mar 10, 2018
    Messages:
    23
    Likes Received:
    4
    You want to get the rightclick event so the inventory opens....
     
  5. [Why is this here] fdsfd

    Joined:
    Apr 6, 2019
    Messages:
    21
    Likes Received:
    0
    I see where you're going with this, but I'm using local variables to store keys as they are virtual.
    Edit: I'm using the skunity parser and it can't understand "if %region at player% contains "spawn""
     
    #5 [Why is this here] fdsfd, May 6, 2019
    Last edited: May 6, 2019
  6. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    It's because that condition is an addon, if I'm not mistaken.
    And if you store those keys, then just do not use local variables.
    --- Double Post Merged, May 6, 2019, Original Post Date: May 6, 2019 ---
    What is the version of Skript and spigot that your server has?
     
  7. [Why is this here] fdsfd

    Joined:
    Apr 6, 2019
    Messages:
    21
    Likes Received:
    0
    1. Which addon?
    2. Skript version is 2.3.6 and Spigot 1.13
    Edit: 3. How should I store the keys if I don't use local variables?
     
  8. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    1. If you want to store the keys, do not use local variables.
    Example
    Code (Skript):
    1. set {key.random} to Tripwire Hook named "&6&lCrate Key &aR&ba&cn&dd&eo&fm"
    2. #do more
    2. I just realized that you do not need an addon to use that condition, however, you said that you had checked it out in SkUnity Parser. But did you check it on your server?
     
  9. [Why is this here] fdsfd

    Joined:
    Apr 6, 2019
    Messages:
    21
    Likes Received:
    0
    You're talking about keys that are in your inventory, I need virtual keys.
     
  10. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    That's why I say.

    Use
    Code (Skript):
    1.  
    2. set {key.daily} to tripwire hook named "&6&lCrate Key &e&lDaily"
    3. enchant {key.daily} with unbreaking 9999
    4.  
    and then:

    Code (Skript):
    1.  
    2. command /givekey [<string>]
    3.     #do stuff#
    4.     trigger:
    5.         argument 1 is "daily":
    6.             add 1 of {key.daily} to player
    7.  
    If this is not what you are asking for, specify your request.
     
  11. Runakai

    Moderator Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    He wants to detect when an inventory is opening.
     
  12. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    344
    Likes Received:
    22
    This is yours in worldcraft?
     
  13. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    Yeah, that's what I did.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...