Solved Crate not working

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

dxcf

Member
Apr 8, 2020
26
0
1
23
code_language.skript:
command /announce <text>:
    executable by: console
    usage: /announce <text>
    trigger:
        broadcast " "
        broadcast "&3&lBROADCAST &8» &7%coloured arg-1%"
        broadcast " "
on rightclick on ender chest:
    name of player's tool is "&a&lMonthly &6&lKey"
    player's tool is tripwire hook
    block's position is {monthly}
    cancel event
    remove 1 of player's tool from player
    chance of 20%:
        set {_reward} to "$50M In-game cash"
        add 50000000 to player's balance
        send "&7You should see your in-game cash goes up by 50M, If not please contact smikkelmax or dxcf."
        log "%player% - 50M in-game cash" to "monthly-crate.log"
    else if chance of 5%:
        set {_reward} to "x2 Monthly crate key"
        give player 2 tripwire hook named "&a&lMonthly &6&lKey" with lore "&7Use it on &a&lMonthly &6&lCrate &7located at /spawn."
        send "&7You should receive x2 Monthly key, If not please contact smikkelmax or dxcf."
        log "%player% - x2 Monthly key" to "monthly-crate.log"
    else if chance of 50%:
        set {_reward} to "Permission to /kit gapple"
        make console execute command "lp user %player% permission set essentials.kits.gapple true"
        send "&7You should be able to execute /kit Gapple, If not please contact dxcf."
        log "%player% - Permission to kit gapple" to "monthly-crate.log"
    else:
        set {_reward} to "x10 Kill crate"
        give player 10 tripwire hook named "&4&lKill &6&lKey" with lore "&7Use it on &4&lKill &6&lCrate &7located at /spawn."
        send "&7You should receive x10 Kill key, If not please contact smikkelmax or dxcf."
        log "%player% - x10 Kill key" to "monthly-crate.log"
    send "&6&lCRATE &8» &7You've opened &a&lMonthly &6&lCrate &7and won &e%{_reward}%&7!"
    make console execute "announce &e%player% &awon &e%{_reward}% &afrom &a&lMonthly &6&lCrate&a!"
command /keyall [<text>]:
    executable by: console
    trigger:
        if arg-1 is "kill":
            loop all players:
                give loop-player 1 tripwire hook named "&4&lKill &6&lKey" with lore "&7Use it on &4&lKill &6&lCrate &7located at /spawn."
        if arg-1 is "monthly":
            loop all players:
                give loop-player 1 tripwire hook named "&a&lMonthly &6&lKey" with lore "&7Use it on &a&lMonthly &6&lCrate &7located at /spawn."
on leftclick on ender chest:
    block's position is {monthly}
    cancel event
    send "&a&lMonthly &6&lCrate &aRewards:"
    send "&e - 50M In-game cash"
    send "&e - x2 Monthly crate key"
    send "&e - x10 Kill crate key"
    send "&e - Permission to /kit gapple"
    send "&aThis crate is obtainable in Monthly kit."
command /key [<text>] [<player>]:
    executable by: console
    trigger:
        if arg-1 is "kill":
            give arg-2 1 tripwire hook named "&4&lKill &6&lKey" with lore "&7Use it on &4&lKill &6&lCrate &7located at /spawn."
        if arg-1 is "monthly":
            give arg-2 1 tripwire hook named "&a&lMonthly &6&lKey" with lore "&7Use it on &a&lMonthly &6&lCrate &7located at /spawn."
on rightclick on ender chest:
    name of player's tool isn't "&a&lMonthly &6&lKey"
    block's position is {monthly}
    cancel event
    send "&6&lCRATE &8» &7You need &a&lMonthly &6&lKey &7to open this crate! &7(/kit monthly)"
    push player backwards at speed 1
    play "ENTITY_VILLAGER_NO" to player at volume 5
#kill
on rightclick on chest:
    name of player's tool is "&4&lKill &6&lKey"
    player's tool is tripwire hook
    location of target block is location at -83.5, 93.5, 255.5 of the world "world"
    cancel event
    remove 1 of player's tool from player
    chance of 20%:
        set {_reward} to "$50 In-game cash"
        add 50 to player's balance
    else if chance of 1%:
        set {_reward} to "x1 Monthly crate key"
        give player 1 tripwire hook named "&a&lMonthly &6&lKey" with lore "&7Use it on &a&lMonthly &6&lCrate &7located at /spawn."
        make console execute "announce &e%player% &ajust got &e1 Monthly crate key &afrom &4&lKill &6&lCrate&a! &7(1%% Chance)"
    else if chance of 20%:
        set {_reward} to "diamond sword (sharpness 5)"
        give player 1 diamond sword of sharpness 5
    else:
        set {_reward} to "x2 Kill crate"
        give player 2 tripwire hook named "&4&lKill &6&lKey" with lore "&7Use it on &4&lKill &6&lCrate &7located at /spawn."
    send "&6&lCRATE &8» &7You've opened &4&lKill &6&lCrate &7and won &e%{_reward}%&7!"
on leftclick on chest:
    location of target block is location at -83.5, 93.5, 255.5 of the world "world"
    cancel event
    send "&4&lKill &6&lCrate &aRewards:"
    send "&b - 1 monthly crate key &8[&5&lRARE&8]"
    send "&e - Diamond sword (Sharpness 5)"
    send "&e - 2 Kill crate key"
    send "&e - 50 In-game cash"
    send "&aWhen you kill a player, You have 20%% chance to get this crate."
on rightclick on chest:
    name of player's tool isn't "&4&lKill &6&lKey"
    location of target block is location at -83.5, 93.5, 255.5 of the world "world"
    cancel event
    send "&6&lCRATE &8» &7You need &4&lKill &6&lKey &7to open this crate! &7(20%% chance when killing player)"
    push player backwards at speed 1
    play "ENTITY_VILLAGER_NO" to player at volume 5
on death:
    chance of 20%:
        make console execute "key kill %attacker%"
        send "&6&lCRATE &8» &7Given &4&lKill &6&lKey&7, Go to spawn to open the crate!"

When player rightclick/leftclick the crate nothing happens
I have worldguard here are the flags
upload_2020-5-17_13-8-23.png

[doublepost=1589701854,1589695730][/doublepost]global region have no flags
 
Nope, Ill try turning it off.

It's just, I had a similar issue, and when I turned spawn protection off in my servers configuration files, the crates plugin worked just fine.
 
Status
Not open for further replies.