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 Crate not working

Discussion in 'Skript' started by dxcf, May 17, 2020.

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

    dxcf Member

    Joined:
    Apr 8, 2020
    Messages:
    26
    Likes Received:
    0
    Code (Skript):
    1. command /announce <text>:
    2.     executable by: console
    3.     usage: /announce <text>
    4.     trigger:
    5.         broadcast " "
    6.         broadcast "&3&lBROADCAST &8» &7%coloured arg-1%"
    7.         broadcast " "
    8. on rightclick on ender chest:
    9.     name of player's tool is "&a&lMonthly &6&lKey"
    10.     player's tool is tripwire hook
    11.     block's position is {monthly}
    12.     cancel event
    13.     remove 1 of player's tool from player
    14.     chance of 20%:
    15.         set {_reward} to "$50M In-game cash"
    16.         add 50000000 to player's balance
    17.         send "&7You should see your in-game cash goes up by 50M, If not please contact smikkelmax or dxcf."
    18.         log "%player% - 50M in-game cash" to "monthly-crate.log"
    19.     else if chance of 5%:
    20.         set {_reward} to "x2 Monthly crate key"
    21.         give player 2 tripwire hook named "&a&lMonthly &6&lKey" with lore "&7Use it on &a&lMonthly &6&lCrate &7located at /spawn."
    22.         send "&7You should receive x2 Monthly key, If not please contact smikkelmax or dxcf."
    23.         log "%player% - x2 Monthly key" to "monthly-crate.log"
    24.     else if chance of 50%:
    25.         set {_reward} to "Permission to /kit gapple"
    26.         make console execute command "lp user %player% permission set essentials.kits.gapple true"
    27.         send "&7You should be able to execute /kit Gapple, If not please contact dxcf."
    28.         log "%player% - Permission to kit gapple" to "monthly-crate.log"
    29.     else:
    30.         set {_reward} to "x10 Kill crate"
    31.         give player 10 tripwire hook named "&4&lKill &6&lKey" with lore "&7Use it on &4&lKill &6&lCrate &7located at /spawn."
    32.         send "&7You should receive x10 Kill key, If not please contact smikkelmax or dxcf."
    33.         log "%player% - x10 Kill key" to "monthly-crate.log"
    34.     send "&6&lCRATE &8» &7You've opened &a&lMonthly &6&lCrate &7and won &e%{_reward}%&7!"
    35.     make console execute "announce &e%player% &awon &e%{_reward}% &afrom &a&lMonthly &6&lCrate&a!"
    36. command /keyall [<text>]:
    37.     executable by: console
    38.     trigger:
    39.         if arg-1 is "kill":
    40.             loop all players:
    41.                 give loop-player 1 tripwire hook named "&4&lKill &6&lKey" with lore "&7Use it on &4&lKill &6&lCrate &7located at /spawn."
    42.         if arg-1 is "monthly":
    43.             loop all players:
    44.                 give loop-player 1 tripwire hook named "&a&lMonthly &6&lKey" with lore "&7Use it on &a&lMonthly &6&lCrate &7located at /spawn."
    45. on leftclick on ender chest:
    46.     block's position is {monthly}
    47.     cancel event
    48.     send "&a&lMonthly &6&lCrate &aRewards:"
    49.     send "&e - 50M In-game cash"
    50.     send "&e - x2 Monthly crate key"
    51.     send "&e - x10 Kill crate key"
    52.     send "&e - Permission to /kit gapple"
    53.     send "&aThis crate is obtainable in Monthly kit."
    54. command /key [<text>] [<player>]:
    55.     executable by: console
    56.     trigger:
    57.         if arg-1 is "kill":
    58.             give arg-2 1 tripwire hook named "&4&lKill &6&lKey" with lore "&7Use it on &4&lKill &6&lCrate &7located at /spawn."
    59.         if arg-1 is "monthly":
    60.             give arg-2 1 tripwire hook named "&a&lMonthly &6&lKey" with lore "&7Use it on &a&lMonthly &6&lCrate &7located at /spawn."
    61. on rightclick on ender chest:
    62.     name of player's tool isn't "&a&lMonthly &6&lKey"
    63.     block's position is {monthly}
    64.     cancel event
    65.     send "&6&lCRATE &8» &7You need &a&lMonthly &6&lKey &7to open this crate! &7(/kit monthly)"
    66.     push player backwards at speed 1
    67.     play "ENTITY_VILLAGER_NO" to player at volume 5
    68. #kill
    69. on rightclick on chest:
    70.     name of player's tool is "&4&lKill &6&lKey"
    71.     player's tool is tripwire hook
    72.     location of target block is location at -83.5, 93.5, 255.5 of the world "world"
    73.     cancel event
    74.     remove 1 of player's tool from player
    75.     chance of 20%:
    76.         set {_reward} to "$50 In-game cash"
    77.         add 50 to player's balance
    78.     else if chance of 1%:
    79.         set {_reward} to "x1 Monthly crate key"
    80.         give player 1 tripwire hook named "&a&lMonthly &6&lKey" with lore "&7Use it on &a&lMonthly &6&lCrate &7located at /spawn."
    81.         make console execute "announce &e%player% &ajust got &e1 Monthly crate key &afrom &4&lKill &6&lCrate&a! &7(1%% Chance)"
    82.     else if chance of 20%:
    83.         set {_reward} to "diamond sword (sharpness 5)"
    84.         give player 1 diamond sword of sharpness 5
    85.     else:
    86.         set {_reward} to "x2 Kill crate"
    87.         give player 2 tripwire hook named "&4&lKill &6&lKey" with lore "&7Use it on &4&lKill &6&lCrate &7located at /spawn."
    88.     send "&6&lCRATE &8» &7You've opened &4&lKill &6&lCrate &7and won &e%{_reward}%&7!"
    89. on leftclick on chest:
    90.     location of target block is location at -83.5, 93.5, 255.5 of the world "world"
    91.     cancel event
    92.     send "&4&lKill &6&lCrate &aRewards:"
    93.     send "&b - 1 monthly crate key &8[&5&lRARE&8]"
    94.     send "&e - Diamond sword (Sharpness 5)"
    95.     send "&e - 2 Kill crate key"
    96.     send "&e - 50 In-game cash"
    97.     send "&aWhen you kill a player, You have 20%% chance to get this crate."
    98. on rightclick on chest:
    99.     name of player's tool isn't "&4&lKill &6&lKey"
    100.     location of target block is location at -83.5, 93.5, 255.5 of the world "world"
    101.     cancel event
    102.     send "&6&lCRATE &8» &7You need &4&lKill &6&lKey &7to open this crate! &7(20%% chance when killing player)"
    103.     push player backwards at speed 1
    104.     play "ENTITY_VILLAGER_NO" to player at volume 5
    105. on death:
    106.     chance of 20%:
    107.         make console execute "key kill %attacker%"
    108.         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
    --- Double Post Merged, May 17, 2020, Original Post Date: May 17, 2020 ---
    global region have no flags

     
  2. Best Answer:
    Post #4 by Deleted member 9590, May 19, 2020
  3. do you have spawn protection disabled?
     
  4. dxcf

    dxcf Member

    Joined:
    Apr 8, 2020
    Messages:
    26
    Likes Received:
    0
    Nope, Ill try turning it off.
     
  5. 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.
     
  6. dxcf

    dxcf Member

    Joined:
    Apr 8, 2020
    Messages:
    26
    Likes Received:
    0
    Works, thanks
     
Thread Status:
Not open for further replies.

Share This Page

Loading...