Solved on chest open

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Apr 6, 2019
21
0
0
19
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:
on open of chest named "CRATES":
    open virtual chest inventory of size 6 named "&8CRATES"
and yeah. Any help?
 
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:
on open of chest named "CRATES":
    open virtual chest inventory of size 6 named "&8CRATES"
and yeah. Any help?
I would recommend that you do something else, do something like this:
code_language.skript:
on right click:
    if "%region at player%" contains "crates": #or the region of your crates warp.
        if event-block is coal block: #Or the block you want.
            set {_key} to Tripwire Hook named "&6&lCrate Key &aR&ba&cn&dd&eo&fm"
            enchant {_key} with unbreaking 9999
            if player's held item = {_key}:
                remove 1 of {_key} from event-player's inventory
                open chest with 6 rows named "&8Crates" to player
                #do stuff here.
 
I would recommend that you do something else, do something like this:
code_language.skript:
on right click:
    if "%region at player%" contains "crates": #or the region of your crates warp.
        if event-block is coal block: #Or the block you want.
            set {_key} to Tripwire Hook named "&6&lCrate Key &aR&ba&cn&dd&eo&fm"
            enchant {_key} with unbreaking 9999
            if player's held item = {_key}:
                remove 1 of {_key} from event-player's inventory
                open chest with 6 rows named "&8Crates" to player
                #do stuff here.
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""
 
Last edited:
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""
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.
[doublepost=1557179195,1557179009][/doublepost]
Edit: I'm using the skunity parser and it can't understand "if %region at player% contains "spawn""
What is the version of Skript and spigot that your server has?
 
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.
[doublepost=1557179195,1557179009][/doublepost]
What is the version of Skript and spigot that your server has?
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?
 
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?
1. If you want to store the keys, do not use local variables.
Example
code_language.skript:
set {key.random} to Tripwire Hook named "&6&lCrate Key &aR&ba&cn&dd&eo&fm"
#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?
 
You're talking about keys that are in your inventory, I need virtual keys.
That's why I say.

Use
code_language.skript:
set {key.daily} to tripwire hook named "&6&lCrate Key &e&lDaily"
enchant {key.daily} with unbreaking 9999

and then:

code_language.skript:
command /givekey [<string>]
    #do stuff#
    trigger:
        argument 1 is "daily":
            add 1 of {key.daily} to player
If this is not what you are asking for, specify your request.
 
I would recommend that you do something else, do something like this:
code_language.skript:
on right click:
    if "%region at player%" contains "crates": #or the region of your crates warp.
        if event-block is coal block: #Or the block you want.
            set {_key} to Tripwire Hook named "&6&lCrate Key &aR&ba&cn&dd&eo&fm"
            enchant {_key} with unbreaking 9999
            if player's held item = {_key}:
                remove 1 of {_key} from event-player's inventory
                open chest with 6 rows named "&8Crates" to player
                #do stuff here.
This is yours in worldcraft?
 
Status
Not open for further replies.