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.

Why does it not work? :o

Discussion in 'Skript' started by Auswahluhr6004, Aug 16, 2017.

Tags:
Thread Status:
Not open for further replies.
  1. Auswahluhr6004

    Joined:
    Mar 1, 2017
    Messages:
    109
    Likes Received:
    1
    Hello, my problem is that the case doesn't show the items in the cooldown time (sorry for my bad english)

    Code:
    Code (Skript):
    1. on rightclick with a chest:
    2.     if player is holding a chest named "&4Waffen &8&7Case":
    3.         open chest with 3 rows named "&4Waffen &8&7Case" to player
    4.         wait 3 ticks
    5.         if inventory name of player's current inventory is "&4Waffen &8&7Case":
    6.             loop {@animation-length} times:
    7.                 set {opening.%player%} to true
    8.                 set {CrateTyp.%player%} to "Waffen"
    9.                 set {virtualcrate.%player%} to "Waffen"
    10.                 play raw sound "note.pling" at player with pitch 1 volume 10
    11.                 format slot 0 of player with black stained glass pane to be unstealable
    12.                 format slot 1 of player with {@animation-item1} to be unstealable
    13.                 format slot 2 of player with {@animation-item1} to be unstealable
    14.                 format slot 3 of player with {@animation-item1} to be unstealable
    15.                 format slot 4 of player with torch to be unstealable
    16.                 format slot 5 of player with {@animation-item1} to be unstealable
    17.                 format slot 6 of player with {@animation-item1} to be unstealable
    18.                 format slot 7 of player with {@animation-item1} to be unstealable
    19.                 format slot 8 of player with black stained glass pane to be unstealable
    20.                 format slot 9 of player with black stained glass pane to be unstealable
    21.                 set {_randomprize1.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
    22.                 format slot 10 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize1.%player%}%} to be unstealable
    23.                 set {_randomprize2.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
    24.                 format slot 11 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize2.%player%}%} to be unstealable
    25.                 set {_randomprize3.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
    26.                 format slot 12 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize3.%player%}%} to be unstealable
    27.                 set {_randomprize4.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
    28.                 format slot 13 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize4.%player%}%} to be unstealable
    29.                 set {_randomprize5.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
    30.                 format slot 14 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize5.%player%}%} to be unstealable
    31.                 set {_randomprize6.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
    32.                 format slot 15 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize6.%player%}%} to be unstealable
    33.                 set {_randomprize7.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
    34.                 format slot 16 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize7.%player%}%} to be unstealable
    35.                 format slot 17 of player with black stained glass pane to be unstealable
    36.                 format slot 18 of player with black stained glass pane to be unstealable
    37.                 format slot 19 of player with {@animation-item1} to be unstealable
    38.                 format slot 20 of player with {@animation-item1} to be unstealable
    39.                 format slot 21 of player with {@animation-item1} to be unstealable
    40.                 format slot 22 of player with torch to be unstealable
    41.                 format slot 23 of player with {@animation-item1} to be unstealable
    42.                 format slot 24 of player with {@animation-item1} to be unstealable
    43.                 format slot 25 of player with {@animation-item1} to be unstealable
    44.                 format slot 26 of player with black stained glass pane to be unstealable
    45.                 play raw sound "note.harp" at player with pitch 1 volume 10
    46.                 wait 0.3 seconds
    47.                 format slot 0 of player with black stained glass pane to be unstealable
    48.                 format slot 1 of player with {@animation-item1} to be unstealable
    49.                 format slot 2 of player with {@animation-item1} to be unstealable
    50.                 format slot 3 of player with {@animation-item1} to be unstealable
    51.                 format slot 4 of player with torch to be unstealable
    52.                 format slot 5 of player with {@animation-item1} to be unstealable
    53.                 format slot 6 of player with {@animation-item1} to be unstealable
    54.                 format slot 7 of player with {@animation-item1} to be unstealable
    55.                 format slot 8 of player with black stained glass pane to be unstealable
    56.                 format slot 9 of player with black stained glass pane to be unstealable
    57.                 set {_randomprize8.%player%} to {_randomprize1.%player%}
    58.                 format slot 11 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize8.%player%}%} to be unstealable
    59.                 set {_randomprize9.%player%} to {_randomprize2.%player%}
    60.                 format slot 12 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize9.%player%}%} to be unstealable
    61.                 set {_randomprize10.%player%} to {_randomprize3.%player%}
    62.                 format slot 13 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize10.%player%}%} to be unstealable
    63.                 set {_randomprize11.%player%} to {_randomprize4.%player%}
    64.                 format slot 14 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize11.%player%}%} to be unstealable
    65.                 set {_randomprize12.%player%} to {_randomprize5.%player%}
    66.                 format slot 15 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize12.%player%}%} to be unstealable
    67.                 set {_randomprize13.%player%} to {_randomprize6.%player%}
    68.                 format slot 16 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize13.%player%}%} to be unstealable
    69.                 set {_randomprize1.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
    70.                 format slot 10 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize1.%player%}%} to be unstealable
    71.                 format slot 17 of player with black stained glass pane to be unstealable
    72.                 format slot 18 of player with black stained glass pane to be unstealable
    73.                 format slot 19 of player with {@animation-item1} to be unstealable
    74.                 format slot 20 of player with {@animation-item1} to be unstealable
    75.                 format slot 21 of player with {@animation-item1} to be unstealable
    76.                 format slot 22 of player with torch to be unstealable
    77.                 format slot 23 of player with {@animation-item1} to be unstealable
    78.                 format slot 24 of player with {@animation-item1} to be unstealable
    79.                 format slot 25 of player with {@animation-item1} to be unstealable
    80.                 format slot 26 of player with black stained glass pane to be unstealable
    81.                 play raw sound "note.pling" at player with pitch 1 volume 10
    82.                 wait 0.3 second
    83.                 format slot 0 of player with black stained glass pane to be unstealable
    84.                 format slot 1 of player with {@animation-item3} to be unstealable
    85.                 format slot 2 of player with {@animation-item3} to be unstealable
    86.                 format slot 3 of player with {@animation-item3} to be unstealable
    87.                 format slot 4 of player with torch to be unstealable
    88.                 format slot 5 of player with {@animation-item3} to be unstealable
    89.                 format slot 6 of player with {@animation-item3} to be unstealable
    90.                 format slot 7 of player with {@animation-item3} to be unstealable
    91.                 format slot 8 of player with black stained glass pane to be unstealable
    92.                 format slot 9 of player with black stained glass pane to be unstealable
    93.                 set {_randomprize14.%player%} to {_randomprize3.%player%}
    94.                 format slot 12 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize14.%player%}%} to be unstealable
    95.                 set {randomprize15.%player%} to {_randomprize4.%player%}
    96.                 format slot 13 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{randomprize15.%player%}%} to be unstealable
    97.                 set {_randomprize16.%player%} to {_randomprize5.%player%}
    98.                 format slot 14 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize16.%player%}%} to be unstealable
    99.                 set {_randomprize17.%player%} to {_randomprize6.%player%}
    100.                 format slot 15 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize17.%player%}%} to be unstealable
    101.                 set {_randomprize18.%player%} to {_randomprize7.%player%}
    102.                 format slot 16 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize18.%player%}%} to be unstealable
    103.                 set {_randomprize2.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{virtualcrate.%player%}%}%}
    104.                 format slot 11 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize1.%player%}%} to be unstealable
    105.                 set {_randomprize1.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
    106.                 format slot 10 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize1.%player%}%} to be unstealable
    107.                 format slot 17 of player with black stained glass pane to be unstealable
    108.                 format slot 18 of player with black stained glass pane to be unstealable
    109.                 format slot 19 of player with {@animation-item3} to be unstealable
    110.                 format slot 20 of player with {@animation-item3} to be unstealable
    111.                 format slot 21 of player with {@animation-item3} to be unstealable
    112.                 format slot 22 of player with torch to be unstealable
    113.                 format slot 23 of player with {@animation-item3} to be unstealable
    114.                 format slot 24 of player with {@animation-item3} to be unstealable
    115.                 format slot 25 of player with {@animation-item3} to be unstealable
    116.                 format slot 26 of player with black stained glass pane to be unstealable
    117.                 play raw sound "note.harp" at player with pitch 1 volume 10
    118.                 wait 0.2 second
    119.             make player execute "guirandomtry2"
    120.            
    121.            
    122. command /guirandomtry2:
    123.     trigger:
    124.         if {opening.%player%} is true:
    125.             if {CrateItemChance.%{CrateTyp.%player%}%::%{randomprize15.%player%}%} is set:
    126.                 delete {opening.%player%}
    127.                 set {randomprize15.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateTyp.%player%}%}
    128.                 set {randomchance.%player%} to random integer between 0 and 100
    129.                 if {randomchance.%player%} is less or equal to {CrateItemChance.%{CrateTyp.%player%}%::%{randomprize15.%player%}%}:
    130.                     format slot 13 of player with {CrateItem.%{CrateTyp.%player%}%::%{randomprize15.%player%}%} to be unstealable
    131.                     set {winplayer} to "%player%"
    132.                     if {@open-messages} is true:
    133.                         broadcast " {@prefix} &a%player% &ehas won &a%{CrateItem.%{CrateLocation.%player's target block's location%}%::%{randomprize15.%player%}%}'s name%&e!"
    134.                     if {CrateItemCommand.%{CrateTyp.%player%}%::%{randomprize15.%player%}%} is set:
    135.                         if {@giveonwincommand} is true:
    136.                             if {CrateItemLimit.%{CrateTyp.%player%}%.%{randomprize15.%player%}%} is higher than 0:
    137.                                 give {CrateItem.%{CrateTyp.%player%}%::%{randomprize15.%player%}%} to player
    138.                             else if {CrateItemLimit.%{CrateTyp.%player%}%.%{randomprize15.%player%}%} isn't set:
    139.                                 give {CrateItem.%{CrateTyp.%player%}%::%{randomprize15.%player%}%} to player
    140.                         set {CrateCommand.%player%} to "%{CrateItemCommand.%{CrateLocation.%player's target block's location%}%::%{randomprize15.%player%}%}%"
    141.                         replace "PLAYER" in {CrateCommand.%player%} with "%player's name%"
    142.                         if {CrateItemLimit.%{CrateTyp.%player%}%.%{randomprize15.%player%}%} is higher than 0:
    143.                             execute console command "%{CrateCommand.%player%}%"
    144.                             remove 1 from {CrateItemLimit.%{CrateTyp.%player%}%.%{randomprize15.%player%}%}
    145.                         else if {CrateItemLimit.%{CrateTyp.%player%}%.%{randomprize15.%player%}%} isn't set:
    146.                             execute console command "%{CrateCommand.%player%}%"
    147.                         else:
    148.                             message " {@prefix} &c&lSorry! This item isn't available. :("
    149.                     else:
    150.                         if {CrateItemLimit.%{CrateTyp.%player%}%.%{randomprize15.%player%}%} is higher than 0:
    151.                             give {CrateItem.%{CrateTyp.%player%}%::%{randomprize15.%player%}%} to player
    152.                             remove 1 from {CrateItemLimit.%{CrateTyp.%player%}%.%{randomprize15.%player%}%}
    153.                         else if {CrateItemLimit.%{CrateTyp.%player%}%.%{randomprize15.%player%}%} isn't set:
    154.                             give {CrateItem.%{CrateTyp.%player%}%::%{randomprize15.%player%}%} to player
    155.                         else:
    156.                             message " {@prefix} &c&lSorry! This item isn't available. :("
    157.                 else:
    158.                     make player execute "guirandomtry"
    159.             else:
    160.                 format slot 13 of player with {CrateItem.%{CrateTyp.%player%}%::%{randomprize15.%player%}%} to be unstealable
    161.                
    162. command /additem <text> <text>:
    163.     permission: op
    164.     trigger:
    165.         add 1 to {CrateItemsTotal.%arg 1%}
    166.         set {chance} to "%arg 2%" parsed as integer
    167.         message " {@prefix} &eYou've successfully added new item to crate &a%arg 2%&e!"
    168.         message " {@prefix} &eChance: &a&l%arg 2% %%"
    169.         if player's tool's name isn't set:
    170.             set {name} to "%player's tool%"
    171.         if player's tool's name is set:
    172.             set {name} to "%player's tool's name%"
    173.         set {lore} to "%player's tool's lore%"
    174.         set {CrateItemChance.%arg 1%::%{CrateItemsTotal.%arg 1%}%} to "%arg 2%" parsed as integer
    175.         set {lore} to "%player's tool's lore%"
    176.         set {CrateItem.%arg 1%::%{CrateItemsTotal.%arg 1%}%} to "%player's tool%" parsed as item
    177.         set name of {CrateItem.%arg 1%::%{CrateItemsTotal.%arg 1%}%} to "%{name}%"
    178.         set lore of {CrateItem.%arg 1%::%{CrateItemsTotal.%arg 1%}%} to "%{lore}%"
    179.         remove {chance} from {chancetotal.%arg 1%}
    180.         if {CrateItemsTotal.%arg 1%} is 0 or 1:
    181.             add 1 to {CrateItemsTotal.%arg 1%}
    182.         if player's tool's name isn't set:
    183.             set {name} to "%player's tool%"
    184.         if player's tool's name is set:
    185.             set {name} to "%player's tool's name%"
    186.         set {lore} to "%player's tool's lore%"
    187.         set {CrateItemChance.%arg 1%::%{CrateItemsTotal.%arg 1%}%} to "%{chance}%" parsed as integer
    188.         set {lore} to "%player's tool's lore%"
    189.         set {CrateItem.%arg 1%::%{CrateItemsTotal.%arg 1%}%} to "%player's tool%" parsed as item
    190.         set name of {CrateItem.%arg 1%::%{CrateItemsTotal.%arg 1%}%} to "%{name}%"
    191.         set lore of {CrateItem.%arg 1%::%{CrateItemsTotal.%arg 1%}%} to "%{lore}%"
    Best regards, Auswahluhr6004
     
Thread Status:
Not open for further replies.

Share This Page

Loading...