- command /crate [<text>] [<text>] [<player>] [<integer>]:
- aliases: /c
- trigger:
- if player have permission "admin.crate":
- if arg-1 is not set:
- send "&8&l| &a&lCRATE &8&l| &7Kommando'er"
- send " &7- &a/crate key <crate navn> <navn> <antal>"
- send " &7- &a/crate chest <crate navn>"
- if arg 1 is not "key" or "chest":
- send "&8&l| &a&lCRATE &8&l| &7Ukendt Kommando"
- if arg 1 is "chest":
- if arg 2 is "iron", "gold" or "diamond":
- send "&8&l| &a&lCRATE &8&l| &7Du fik &6%arg 2%"
- give player 1 chest named "&6%arg 2%"
- else:
- send "&8&l| &a&lCRATE &8&l| &7Craten findes ikke"
- if arg 1 is "key":
- if arg 2 is "iron":
- if arg 3 is not set:
- if arg 4 is a integer:
- if arg 4 is a integer:
- give player arg-4 of 421 named "&7Iron Key"
- send "&8&l| &a&lCRATE &8&l| &7Du gav dig selv en &r&lIRON &7key"
- stop
- else:
- send "&8&l| &a&lCRATE &8&l| &7Du kan kun skrive et nummer ind"
- stop
- else:
- give player 1 of 421 named "&7Iron Key"
- stop
- else:
- give player 1 of 421 named "&7Iron Key"
- stop
- if arg 2 is "gold":
- if arg 3 is not set:
- if arg 4 is set:
- if arg 4 is a integer:
- give player arg-4 of 421 named "&6Gold Key"
- send "&8&l| &a&lCRATE &8&l| &7Du gav dig selv en &6&lGOLD &7key"
- stop
- else:
- send "&8&l| &a&lCRATE &8&l| &7Du kan kun skrive et nummer ind"
- stop
- else:
- give player 1 of 421 named "&6Gold Key"
- stop
- else:
- give player 1 of 421 named "&6Gold Key"
- stop
- if arg 2 is "diamond":
- if arg 3 is not set:
- if arg 4 is set:
- if arg 4 is a integer:
- give player arg-4 of 421 named "&3Diamond Key"
- send "&8&l| &a&lCRATE &8&l| &7Du gav dig selv en &3&lDIAMOND &7key"
- stop
- else:
- send "&8&l| &a&lCRATE &8&l| &7Du kan kun skrive et nummer ind"
- stop
- else:
- give player 1 of 421 named "&3Diamond Key"
- stop
- else:
- give player 1 of 421 named "&3Diamond Key"
- stop
- if arg 2 is "iron":
- if arg 3 is online:
- if arg 3 is set:
- if arg 4 is set:
- if arg 4 is a integer:
- give arg-3 arg-4 of 421 named "&7Iron Key"
- send "&8&l| &a&lCRATE &8&l| &7Du gav &a%arg 3% &7(&7&a%arg 4%&7) &r&lIron &7key's"
- send "&8&l| &a&lCRATE &8&l| &7Du fik &7(&7&a%arg 4%&7) &r&lIron &7key's af &a%player%" to arg-3
- stop
- else:
- send "&8&l| &a&lCRATE &8&l| &7Du skal skrive et nummer"
- stop
- else:
- give arg-3 1 of 421 named "&7Iron Key"
- stop
- else:
- send "&8&l| &a&lCRATE &8&l| &6%arg 3% &7er ikke online"
- stop
- if arg 2 is "gold":
- if arg 3 is online:
- if arg 3 is set:
- if arg 4 is set:
- if arg 4 is a integer:
- give arg-3 arg-4 of 421 named "&6Gold Key"
- send "&8&l| &a&lCRATE &8&l| &7Du gav &a%arg 3% &7(&7&a%arg 4%&7) &6Gold &7key's"
- send "&8&l| &a&lCRATE &8&l| &7Du fik &7(&7&a%arg 4%&7) &6Gold &7key's af &a%player%" to arg-3
- stop
- else:
- send "&8&l| &a&lCRATE &8&l| &7Du skal skrive et nummer"
- stop
- else:
- give arg-3 1 of 421 named "&6Gold"
- stop
- else:
- send "&8&l| &a&lCRATE &8&l| &6%arg 3% &7er ikke online"
- stop
- if arg 2 is "diamond":
- if arg 3 is online:
- if arg 3 is set:
- if arg 4 is set:
- if arg 4 is a integer:
- give arg-3 arg-4 of 421 named "&3Diamond Key"
- send "&8&l| &a&lCRATE &8&l| &7Du gav &a%arg 3% &7(&7&a%arg 4%&7) &3Diamond &7key's"
- send "&8&l| &a&lCRATE &8&l| &7Du fik &7(&7&a%arg 4%&7) &3Diamond &7key's af &a%player%" to arg-3
- stop
- else:
- send "&8&l| &a&lCRATE &8&l| &7Du skal skrive et nummer"
- stop
- else:
- give arg-3 1 of 421 named "&3Diamond Key"
- stop
- else:
- send "&8&l| &a&lCRATE &8&l| &6%arg 3% &7er ikke online"
- stop
- on rightclick on chest:
- if {crate::iron} is location of block:
- cancel event
- if player is holding 421 named "&7Iron Key":
- remove 1 421 named "&7Iron Key" from player's inventory
- wait 5 ticks
- chance of 0.5%:
- add 2000 to player's balance
- broadcast "&8&l| &a&lCRATE &8&l| &6%player% &7har vundet &6&lJACKPOT &7i &r&lIRON &7craten"
- send "&8&l| &a&lCRATE &8&l| &7Du vandt &6&lJACKPOTEN &7(&7Pris: &a2000&7)"
- stop
- chance of 10%:
- add 750 to player's balance
- send "&8&l| &a&lCRATE &8&l| &7Du vandt &7(&7Pris: &a750&7)"
- stop
- chance of 12.5%:
- add 500 to player's balance
- send "&8&l| &a&lCRATE &8&l| &7Du vandt &7(&7Pris: &a500&7)"
- stop
- chance of 50%:
- add 350 to player's balance
- send "&8&l| &a&lCRATE &8&l| &7Du vandt &7(&7Pris: &a350&7)"
- stop
- chance of 80%:
- add 100 to player's balance
- send "&8&l| &a&lCRATE &8&l| &7Du vandt &7(&7Pris: &a100&7)"
- stop
- else:
- send "&8&l| &a&lCRATE &8&l| &7Du skal bruge en &r&lIron &7key"
- if {crate::gold} is location of block:
- cancel event
- if player is holding 421 named "&6Gold Key":
- remove 1 421 named "&6Gold Key" from player's inventory
- wait 5 ticks
- chance of 0.5%:
- add 5000 to player's balance
- broadcast "&8&l| &a&lCRATE &8&l| &6%player% &7har vundet &6&lJACKPOT &7i &6&lGOLD &7craten"
- send "&8&l| &a&lCRATE &8&l| &7Du vandt &6&lJACKPOTEN &7(&7Pris: &a5000&7)"
- stop
- chance of 10%:
- add 1000 to player's balance
- send "&8&l| &a&lCRATE &8&l| &7Du vandt &7(&7Pris: &a100&7)"
- stop
- chance of 12.5%:
- add 750 to player's balance
- send "&8&l| &a&lCRATE &8&l| &7Du vandt &7(&7Pris: &a750&7)"
- stop
- chance of 50%:
- add 500 to player's balance
- send "&8&l| &a&lCRATE &8&l| &7Du vandt &7(&7Pris: &a500&7)"
- stop
- chance of 80%:
- add 350 to player's balance
- send "&8&l| &a&lCRATE &8&l| &7Du vandt &7(&7Pris: &a350&7)"
- stop
- else:
- send "&8&l| &a&lCRATE &8&l| &7Du skal bruge en &6&lGOLD &7key"
- if {crate::diamond} is location of block:
- cancel event
- if player is holding 421 named "&3Diamond Key":
- remove 1 421 named "&3Diamond Key" from player's inventory
- wait 5 ticks
- chance of 0.5%:
- add 10000 to player's balance
- broadcast "&8&l| &a&lCRATE &8&l| &6%player% &7har vundet &6&lJACKPOT &7i &3&lDIAMOND &7craten"
- send "&8&l| &a&lCRATE &8&l| &7Du vandt &6&lJACKPOTEN &7(&7Pris: &a10000&7)"
- stop
- chance of 10%:
- add 2500 to player's balance
- send "&8&l| &a&lCRATE &8&l| &7Du vandt &7(&7Pris: &a2500&7)"
- remove 1 421 named "&3Diamond Key" from player's inventory
- stop
- chance of 12.5%:
- add 950 to player's balance
- send "&8&l| &a&lCRATE &8&l| &7Du vandt &7(&7Pris: &a7950&7)"
- stop
- chance of 50%:
- add 750 to player's balance
- send "&8&l| &a&lCRATE &8&l| &7Du vandt &7(&7Pris: &a750&7)"
- stop
- chance of 80%:
- add 500 to player's balance
- send "&8&l| &a&lCRATE &8&l| &7Du vandt &7(&7Pris: &a500&7)"
- stop
- else:
- send "&8&l| &a&lCRATE &8&l| &7Du skal bruge en &3&lDIAMOND &7key"
- on place of chest:
- if player has permission "admin.crate":
- if player's tool is chest named "&6Iron":
- set {crate::iron} to location of block
- send "&8&l| &a&lCRATE &8&l| &2Iron &7craten er sat"
- else:
- if player's tool is chest named "&6Gold":
- set {crate::gold} to location of block
- send "&8&l| &a&lCRATE &8&l| &2Gold &7craten er sat"
- else:
- if player's tool is chest named "&6Diamond":
- set {crate::diamond} to location of block
- send "&8&l| &a&lCRATE &8&l| &2Diamond &7craten er sat"
- else:
- send "&8&l| &a&lCRATE &8&l| &7Nægtet adgang"
- on leftclick on chest:
- if player has permission "admin.crate":
- if {crate::iron} is location of block:
- if player is sneaking:
- delete {crate::iron}
- send "&8&l| &a&lCRATE &8&l| &7Du har slettet &r&lIRON &7craten"
- if {crate::gold} is location of block:
- if player is sneaking:
- delete {crate::gold}
- send "&8&l| &a&lCRATE &8&l| &7Du har slettet &6&lGOLD &7craten"
- if {crate::diamond} is location of block:
- if player is sneaking:
- delete {crate::diamond}
- send "&8&l| &a&lCRATE &8&l| &7Du har slettet &3&lDIAMOND &7craten"
- if {crate::diamond} is location of block:
- cancel event
- open chest with 1 rows named "&3Diamond &6Chancer" to player
- format slot 0 of player with 166 named "&4Luk" to close
- format slot 1 of player with 166 named "&4Luk" to close
- format slot 7 of player with 166 named "&4Luk" to close
- format slot 8 of player with 166 named "&4Luk" to close
- format slot 4 of player with emerald named "&610000DK" with lore "&7Chancer: &60.5%%" to be unstealable
- format slot 3 of player with paper named "&6900DK" with lore "&7Chancer: &680%%" to be unstealable
- format slot 5 of player with paper named "&62500DK" with lore "&7Chancer: &650%%" to be unstealable
- format slot 2 of player with paper named "&6500DK" with lore "&7Chancer: &685%%" to be unstealable
- format slot 6 of player with paper named "&6750DK" with lore "&7Chancer: &612.5%%" to be unstealable
- if {crate::gold} is location of block:
- cancel event
- open chest with 1 rows named "&6Gold &6Chancer" to player
- format slot 0 of player with 166 named "&4Luk" to close
- format slot 1 of player with 166 named "&4Luk" to close
- format slot 7 of player with 166 named "&4Luk" to close
- format slot 8 of player with 166 named "&4Luk" to close
- format slot 4 of player with emerald named "&65000DK" with lore "&7Chancer: &60.5%%" to be unstealable
- format slot 3 of player with paper named "&61000DK" with lore "&7Chancer: &680%%" to be unstealable
- format slot 5 of player with paper named "&6750DK" with lore "&7Chancer: &650%%" to be unstealable
- format slot 2 of player with paper named "&6500DK" with lore "&7Chancer: &685%%" to be unstealable
- format slot 6 of player with paper named "&6350DK" with lore "&7Chancer: &650%%" to be unstealable
- if {crate::iron} is location of block:
- cancel event
- open chest with 1 rows named "&r&lIron &6Chancer" to player
- format slot 0 of player with 166 named "&4Luk" to close
- format slot 1 of player with 166 named "&4Luk" to close
- format slot 7 of player with 166 named "&4Luk" to close
- format slot 8 of player with 166 named "&4Luk" to close
- format slot 4 of player with emerald named "&62000DK" with lore "&7Chancer: &60.5%%" to be unstealable
- format slot 3 of player with paper named "&6750DK" with lore "&7Chancer: &680%%" to be unstealable
- format slot 5 of player with paper named "&6500DK" with lore "&7Chancer: &650%%" to be unstealable
- format slot 2 of player with paper named "&6100DK" with lore "&7Chancer: &685%%" to be unstealable
- format slot 6 of player with paper named "&6350DK" with lore "&7Chancer: &650%%" to be unstealable