Hello, my problem is that the case doesn't show the items in the cooldown time (sorry for my bad english)
Code:
Best regards, Auswahluhr6004
Code:
code_language.skript:
on rightclick with a chest:
if player is holding a chest named "&4Waffen &8❘ &7Case":
open chest with 3 rows named "&4Waffen &8❘ &7Case" to player
wait 3 ticks
if inventory name of player's current inventory is "&4Waffen &8❘ &7Case":
loop {@animation-length} times:
set {opening.%player%} to true
set {CrateTyp.%player%} to "Waffen"
set {virtualcrate.%player%} to "Waffen"
play raw sound "note.pling" at player with pitch 1 volume 10
format slot 0 of player with black stained glass pane to be unstealable
format slot 1 of player with {@animation-item1} to be unstealable
format slot 2 of player with {@animation-item1} to be unstealable
format slot 3 of player with {@animation-item1} to be unstealable
format slot 4 of player with torch to be unstealable
format slot 5 of player with {@animation-item1} to be unstealable
format slot 6 of player with {@animation-item1} to be unstealable
format slot 7 of player with {@animation-item1} to be unstealable
format slot 8 of player with black stained glass pane to be unstealable
format slot 9 of player with black stained glass pane to be unstealable
set {_randomprize1.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
format slot 10 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize1.%player%}%} to be unstealable
set {_randomprize2.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
format slot 11 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize2.%player%}%} to be unstealable
set {_randomprize3.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
format slot 12 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize3.%player%}%} to be unstealable
set {_randomprize4.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
format slot 13 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize4.%player%}%} to be unstealable
set {_randomprize5.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
format slot 14 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize5.%player%}%} to be unstealable
set {_randomprize6.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
format slot 15 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize6.%player%}%} to be unstealable
set {_randomprize7.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
format slot 16 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize7.%player%}%} to be unstealable
format slot 17 of player with black stained glass pane to be unstealable
format slot 18 of player with black stained glass pane to be unstealable
format slot 19 of player with {@animation-item1} to be unstealable
format slot 20 of player with {@animation-item1} to be unstealable
format slot 21 of player with {@animation-item1} to be unstealable
format slot 22 of player with torch to be unstealable
format slot 23 of player with {@animation-item1} to be unstealable
format slot 24 of player with {@animation-item1} to be unstealable
format slot 25 of player with {@animation-item1} to be unstealable
format slot 26 of player with black stained glass pane to be unstealable
play raw sound "note.harp" at player with pitch 1 volume 10
wait 0.3 seconds
format slot 0 of player with black stained glass pane to be unstealable
format slot 1 of player with {@animation-item1} to be unstealable
format slot 2 of player with {@animation-item1} to be unstealable
format slot 3 of player with {@animation-item1} to be unstealable
format slot 4 of player with torch to be unstealable
format slot 5 of player with {@animation-item1} to be unstealable
format slot 6 of player with {@animation-item1} to be unstealable
format slot 7 of player with {@animation-item1} to be unstealable
format slot 8 of player with black stained glass pane to be unstealable
format slot 9 of player with black stained glass pane to be unstealable
set {_randomprize8.%player%} to {_randomprize1.%player%}
format slot 11 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize8.%player%}%} to be unstealable
set {_randomprize9.%player%} to {_randomprize2.%player%}
format slot 12 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize9.%player%}%} to be unstealable
set {_randomprize10.%player%} to {_randomprize3.%player%}
format slot 13 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize10.%player%}%} to be unstealable
set {_randomprize11.%player%} to {_randomprize4.%player%}
format slot 14 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize11.%player%}%} to be unstealable
set {_randomprize12.%player%} to {_randomprize5.%player%}
format slot 15 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize12.%player%}%} to be unstealable
set {_randomprize13.%player%} to {_randomprize6.%player%}
format slot 16 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize13.%player%}%} to be unstealable
set {_randomprize1.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
format slot 10 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize1.%player%}%} to be unstealable
format slot 17 of player with black stained glass pane to be unstealable
format slot 18 of player with black stained glass pane to be unstealable
format slot 19 of player with {@animation-item1} to be unstealable
format slot 20 of player with {@animation-item1} to be unstealable
format slot 21 of player with {@animation-item1} to be unstealable
format slot 22 of player with torch to be unstealable
format slot 23 of player with {@animation-item1} to be unstealable
format slot 24 of player with {@animation-item1} to be unstealable
format slot 25 of player with {@animation-item1} to be unstealable
format slot 26 of player with black stained glass pane to be unstealable
play raw sound "note.pling" at player with pitch 1 volume 10
wait 0.3 second
format slot 0 of player with black stained glass pane to be unstealable
format slot 1 of player with {@animation-item3} to be unstealable
format slot 2 of player with {@animation-item3} to be unstealable
format slot 3 of player with {@animation-item3} to be unstealable
format slot 4 of player with torch to be unstealable
format slot 5 of player with {@animation-item3} to be unstealable
format slot 6 of player with {@animation-item3} to be unstealable
format slot 7 of player with {@animation-item3} to be unstealable
format slot 8 of player with black stained glass pane to be unstealable
format slot 9 of player with black stained glass pane to be unstealable
set {_randomprize14.%player%} to {_randomprize3.%player%}
format slot 12 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize14.%player%}%} to be unstealable
set {randomprize15.%player%} to {_randomprize4.%player%}
format slot 13 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{randomprize15.%player%}%} to be unstealable
set {_randomprize16.%player%} to {_randomprize5.%player%}
format slot 14 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize16.%player%}%} to be unstealable
set {_randomprize17.%player%} to {_randomprize6.%player%}
format slot 15 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize17.%player%}%} to be unstealable
set {_randomprize18.%player%} to {_randomprize7.%player%}
format slot 16 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize18.%player%}%} to be unstealable
set {_randomprize2.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{virtualcrate.%player%}%}%}
format slot 11 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize1.%player%}%} to be unstealable
set {_randomprize1.%player%} to random integer between 1 and {CrateItemsTotal.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%}
format slot 10 of player with {CrateItem.%{%{CrateTyp.%player%}%.%{CrateTyp.%player%}%}%::%{_randomprize1.%player%}%} to be unstealable
format slot 17 of player with black stained glass pane to be unstealable
format slot 18 of player with black stained glass pane to be unstealable
format slot 19 of player with {@animation-item3} to be unstealable
format slot 20 of player with {@animation-item3} to be unstealable
format slot 21 of player with {@animation-item3} to be unstealable
format slot 22 of player with torch to be unstealable
format slot 23 of player with {@animation-item3} to be unstealable
format slot 24 of player with {@animation-item3} to be unstealable
format slot 25 of player with {@animation-item3} to be unstealable
format slot 26 of player with black stained glass pane to be unstealable
play raw sound "note.harp" at player with pitch 1 volume 10
wait 0.2 second
make player execute "guirandomtry2"
command /guirandomtry2:
trigger:
if {opening.%player%} is true:
if {CrateItemChance.%{CrateTyp.%player%}%::%{randomprize15.%player%}%} is set:
delete {opening.%player%}
set {randomprize15.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateTyp.%player%}%}
set {randomchance.%player%} to random integer between 0 and 100
if {randomchance.%player%} is less or equal to {CrateItemChance.%{CrateTyp.%player%}%::%{randomprize15.%player%}%}:
format slot 13 of player with {CrateItem.%{CrateTyp.%player%}%::%{randomprize15.%player%}%} to be unstealable
set {winplayer} to "%player%"
if {@open-messages} is true:
broadcast " {@prefix} &a%player% &ehas won &a%{CrateItem.%{CrateLocation.%player's target block's location%}%::%{randomprize15.%player%}%}'s name%&e!"
if {CrateItemCommand.%{CrateTyp.%player%}%::%{randomprize15.%player%}%} is set:
if {@giveonwincommand} is true:
if {CrateItemLimit.%{CrateTyp.%player%}%.%{randomprize15.%player%}%} is higher than 0:
give {CrateItem.%{CrateTyp.%player%}%::%{randomprize15.%player%}%} to player
else if {CrateItemLimit.%{CrateTyp.%player%}%.%{randomprize15.%player%}%} isn't set:
give {CrateItem.%{CrateTyp.%player%}%::%{randomprize15.%player%}%} to player
set {CrateCommand.%player%} to "%{CrateItemCommand.%{CrateLocation.%player's target block's location%}%::%{randomprize15.%player%}%}%"
replace "PLAYER" in {CrateCommand.%player%} with "%player's name%"
if {CrateItemLimit.%{CrateTyp.%player%}%.%{randomprize15.%player%}%} is higher than 0:
execute console command "%{CrateCommand.%player%}%"
remove 1 from {CrateItemLimit.%{CrateTyp.%player%}%.%{randomprize15.%player%}%}
else if {CrateItemLimit.%{CrateTyp.%player%}%.%{randomprize15.%player%}%} isn't set:
execute console command "%{CrateCommand.%player%}%"
else:
message " {@prefix} &c&lSorry! This item isn't available. :("
else:
if {CrateItemLimit.%{CrateTyp.%player%}%.%{randomprize15.%player%}%} is higher than 0:
give {CrateItem.%{CrateTyp.%player%}%::%{randomprize15.%player%}%} to player
remove 1 from {CrateItemLimit.%{CrateTyp.%player%}%.%{randomprize15.%player%}%}
else if {CrateItemLimit.%{CrateTyp.%player%}%.%{randomprize15.%player%}%} isn't set:
give {CrateItem.%{CrateTyp.%player%}%::%{randomprize15.%player%}%} to player
else:
message " {@prefix} &c&lSorry! This item isn't available. :("
else:
make player execute "guirandomtry"
else:
format slot 13 of player with {CrateItem.%{CrateTyp.%player%}%::%{randomprize15.%player%}%} to be unstealable
command /additem <text> <text>:
permission: op
trigger:
add 1 to {CrateItemsTotal.%arg 1%}
set {chance} to "%arg 2%" parsed as integer
message " {@prefix} &eYou've successfully added new item to crate &a%arg 2%&e!"
message " {@prefix} &eChance: &a&l%arg 2% %%"
if player's tool's name isn't set:
set {name} to "%player's tool%"
if player's tool's name is set:
set {name} to "%player's tool's name%"
set {lore} to "%player's tool's lore%"
set {CrateItemChance.%arg 1%::%{CrateItemsTotal.%arg 1%}%} to "%arg 2%" parsed as integer
set {lore} to "%player's tool's lore%"
set {CrateItem.%arg 1%::%{CrateItemsTotal.%arg 1%}%} to "%player's tool%" parsed as item
set name of {CrateItem.%arg 1%::%{CrateItemsTotal.%arg 1%}%} to "%{name}%"
set lore of {CrateItem.%arg 1%::%{CrateItemsTotal.%arg 1%}%} to "%{lore}%"
remove {chance} from {chancetotal.%arg 1%}
if {CrateItemsTotal.%arg 1%} is 0 or 1:
add 1 to {CrateItemsTotal.%arg 1%}
if player's tool's name isn't set:
set {name} to "%player's tool%"
if player's tool's name is set:
set {name} to "%player's tool's name%"
set {lore} to "%player's tool's lore%"
set {CrateItemChance.%arg 1%::%{CrateItemsTotal.%arg 1%}%} to "%{chance}%" parsed as integer
set {lore} to "%player's tool's lore%"
set {CrateItem.%arg 1%::%{CrateItemsTotal.%arg 1%}%} to "%player's tool%" parsed as item
set name of {CrateItem.%arg 1%::%{CrateItemsTotal.%arg 1%}%} to "%{name}%"
set lore of {CrateItem.%arg 1%::%{CrateItemsTotal.%arg 1%}%} to "%{lore}%"
Best regards, Auswahluhr6004