# ########################################################### # # Name: Roulette # Author: Saanjuk @doped.pl # Code Version: 1.1 # Minecraft Server Version: Any # # ChangeLog: # v 1.1 - remove command /losowanie # - added chest that triggers lotteries # - added message congratulations # - added key to open chests # - added protection against placing the event chest by unauthorized persons # v 1.0 - Create code :) # ########################################################### options: nagrody: diamond chestplate named "&2klata" and diamond axe named "&cSiekierka" bloki: blue stained glass pane and green stained glass pane and yellow stained glass pane and red stained glass pane and purple stained glass pane and magenta stained glass pane and blue stained glass pane and green stained glass pane and yellow stained glass pane and red stained glass pane and purple stained glass pane and magenta stained glass pane and blue stained glass pane and green stained glass pane and yellow stained glass pane and red stained glass pane and purple stained glass pane and magenta stained glass pane gui_name: "&6Losowanie" key_name: "&4&lKlucz do skrzyni" function ruletka(p:player): set {_gui} to chest inventory with 3 rows named {@gui_name} set slot (integers between 0 and 9) and (integers between 17 and 26) of {_gui} to diamond block set slot 10 of {_gui} to random element out of {bloki::*} set slot 11 of {_gui} to random element out of {nagrody::*} set slot 12 of {_gui} to random element out of {bloki::*} set slot 13 of {_gui} to random element out of {nagrody::*} set slot 14 of {_gui} to random element out of {bloki::*} set slot 15 of {_gui} to random element out of {nagrody::*} set slot 16 of {_gui} to random element out of {bloki::*} open {_gui} to {_p} wait 3 tick play sound "ui_button_click" to {_p} set slot 10 of {_gui} to random element out of {nagrody::*} set slot 11 of {_gui} to random element out of {bloki::*} set slot 12 of {_gui} to random element out of {nagrody::*} set slot 13 of {_gui} to random element out of {bloki::*} set slot 14 of {_gui} to random element out of {nagrody::*} set slot 15 of {_gui} to random element out of {bloki::*} set slot 16 of {_gui} to random element out of {nagrody::*} wait 3 tick play sound "ui_button_click" to {_p} set slot 10 of {_gui} to random element out of {bloki::*} set slot 11 of {_gui} to random element out of {nagrody::*} set slot 12 of {_gui} to random element out of {bloki::*} set slot 13 of {_gui} to random element out of {nagrody::*} set slot 14 of {_gui} to random element out of {bloki::*} set slot 15 of {_gui} to random element out of {nagrody::*} set slot 16 of {_gui} to random element out of {bloki::*} wait 3 tick play sound "ui_button_click" to {_p} set slot 10 of {_gui} to random element out of {nagrody::*} set slot 11 of {_gui} to random element out of {bloki::*} set slot 12 of {_gui} to random element out of {nagrody::*} set slot 13 of {_gui} to random element out of {bloki::*} set slot 14 of {_gui} to random element out of {nagrody::*} set slot 15 of {_gui} to random element out of {bloki::*} set slot 16 of {_gui} to random element out of {nagrody::*} wait 3 tick play sound "ui_button_click" to {_p} set slot 10 of {_gui} to random element out of {bloki::*} set slot 11 of {_gui} to random element out of {nagrody::*} set slot 12 of {_gui} to random element out of {bloki::*} set slot 13 of {_gui} to random element out of {nagrody::*} set slot 14 of {_gui} to random element out of {bloki::*} set slot 15 of {_gui} to random element out of {nagrody::*} set slot 16 of {_gui} to random element out of {bloki::*} wait 3 tick play sound "ui_button_click" to {_p} set slot 10 of {_gui} to random element out of {nagrody::*} set slot 11 of {_gui} to random element out of {bloki::*} set slot 12 of {_gui} to random element out of {nagrody::*} set slot 13 of {_gui} to random element out of {bloki::*} set slot 14 of {_gui} to random element out of {nagrody::*} set slot 15 of {_gui} to random element out of {bloki::*} set slot 16 of {_gui} to random element out of {nagrody::*} wait 3 tick play sound "ui_button_click" to {_p} set slot 10 of {_gui} to random element out of {bloki::*} set slot 11 of {_gui} to random element out of {nagrody::*} set slot 12 of {_gui} to random element out of {bloki::*} set slot 13 of {_gui} to random element out of {nagrody::*} set slot 14 of {_gui} to random element out of {bloki::*} set slot 15 of {_gui} to random element out of {nagrody::*} set slot 16 of {_gui} to random element out of {bloki::*} wait 3 tick play sound "ui_button_click" to {_p} set slot 10 of {_gui} to random element out of {nagrody::*} set slot 11 of {_gui} to random element out of {bloki::*} set slot 12 of {_gui} to random element out of {nagrody::*} set slot 13 of {_gui} to random element out of {bloki::*} set slot 14 of {_gui} to random element out of {nagrody::*} set slot 15 of {_gui} to random element out of {bloki::*} set slot 16 of {_gui} to random element out of {nagrody::*} wait 3 tick play sound "ui_button_click" to {_p} set slot 10 of {_gui} to random element out of {bloki::*} set slot 11 of {_gui} to random element out of {nagrody::*} set slot 12 of {_gui} to random element out of {bloki::*} set slot 13 of {_gui} to random element out of {nagrody::*} set slot 14 of {_gui} to random element out of {bloki::*} set slot 15 of {_gui} to random element out of {nagrody::*} set slot 16 of {_gui} to random element out of {bloki::*} wait 3 tick play sound "ui_button_click" to {_p} set slot 10 of {_gui} to random element out of {nagrody::*} set slot 11 of {_gui} to random element out of {bloki::*} set slot 12 of {_gui} to random element out of {nagrody::*} set slot 13 of {_gui} to random element out of {bloki::*} set slot 14 of {_gui} to random element out of {nagrody::*} set slot 15 of {_gui} to random element out of {bloki::*} set slot 16 of {_gui} to random element out of {nagrody::*} wait 3 tick play sound "ui_button_click" to {_p} set slot 10 of {_gui} to random element out of {bloki::*} set slot 11 of {_gui} to random element out of {nagrody::*} set slot 12 of {_gui} to random element out of {bloki::*} set slot 13 of {_gui} to random element out of {nagrody::*} set slot 14 of {_gui} to random element out of {bloki::*} set slot 15 of {_gui} to random element out of {nagrody::*} set slot 16 of {_gui} to random element out of {bloki::*} wait 3 tick play sound "ui_button_click" to {_p} set slot 10 of {_gui} to random element out of {nagrody::*} set slot 11 of {_gui} to random element out of {bloki::*} set slot 12 of {_gui} to random element out of {nagrody::*} set slot 13 of {_gui} to random element out of {bloki::*} set slot 14 of {_gui} to random element out of {nagrody::*} set slot 15 of {_gui} to random element out of {bloki::*} set slot 16 of {_gui} to random element out of {nagrody::*} wait 3 tick play sound "ui_button_click" to {_p} set slot 10 of {_gui} to random element out of {bloki::*} set slot 11 of {_gui} to random element out of {nagrody::*} set slot 12 of {_gui} to random element out of {bloki::*} set slot 13 of {_gui} to random element out of {nagrody::*} set slot 14 of {_gui} to random element out of {bloki::*} set slot 15 of {_gui} to random element out of {nagrody::*} set slot 16 of {_gui} to random element out of {bloki::*} play sound "entity_experience_orb_pickup" to {_p} give slot 13 of {_gui} to {_p} send "&6&lGratulacje! &6Wygrałeś &6&l%name of slot 13 of {_gui}%" to {_p} wait 10 tick close {_p}'s inventory on inventory click: if name of event-inventory is {@gui_name}: cancel event if event-inventory is player's inventory: cancel event on place: if event-block is chest: if name of event-block is {@gui_name}: if player has permission "roulette.admin": send "&6Ustawiłeś skrzynie ruletki!" else: send "&cNie masz uprawnień do stawiania skrzyni ruletki!" set event-block to air on rightclick on chest: if event-block is chest: if name of event-block is {@gui_name}: cancel event if player's tool is tripwire hook : if name of player's tool is {@key_name}: remove 1 tripwire hook named {@key_name} from player ruletka(player) else: push player backwards with speed 1 send "&cMusisz trzymać ""%{@key_name}%&c"" w ręce!" else: push player backwards with speed 1 send "&cMusisz trzymać ""%{@key_name}%&c"" w ręce!" on load: set {bloki::*} to {@bloki} set {nagrody::*} to {@nagrody}