Solved On holding more than one crate key it doesn't work anymore

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

DrunkSheep73

Member
May 29, 2023
24
2
3
22
Hi everyone!

I have made a skript for crates:
Code:
options:



# KEYS:
    keytype: tripwire hook
    keyname: "&aCommon &7Key"
    keylore: "&cUse /warp crates to open!"


on rightclick:
    if event-block is shulker box:
        if block below event-block is fence:
            cancel event
            if player is holding {@keytype} named {@keyname} with lore {@keylore}:
                set {_random} to a random integer from 1 to 100
                if {_random} is between 1 and 50:
                    set {_item} to netherite sword
                if {_random} is between 51 and 80:
                    set {_item} to netherite axe
                if {_random} is between 81 and 100:
                    set {_item} to netherite pickaxe
                give player 1 of {_item}
                send "&4BMJbox » &eYou got 1 &a%{_item}%&e!" to player
                remove 1 {@keytype} named {@keyname} with lore {@keylore} from player's inventory
command /commonkey:
    permission: op
    trigger:
        give player 1 {@keytype} named {@keyname} with lore {@keylore}

The command is because it don't work with a normal tripwire hook.

The problem is:

If I want to copy it with middle mouse button, it doesn't work anymore.

No errors.

Thank you for helping!
[doublepost=1685981686,1685978585][/doublepost]Update:

It is if the amount is more than 1 it doesn't work.