# ########################################################### # # Name: Roulette # Author: Saanjuk @doped.pl # Code Version: 1.4 # Minecraft Server Version: Any # # ChangeLog: # v 1.4 - we optimize spaghetti! # - fix little bugs # v 1.3 - added more customisation in config section # - added command /roulette "givechest/givekey" [] [] # v 1.2 - added % chance to higher tier reward # - added more options couse skript is confused when a lot of items in list has NBT # 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 :) # ########################################################### # ============== Sekcja konfiguracji: =============== # # # # Nagrody podzielone na kilka opcji ponieważ skript # # gubi się gdy dopiszemy dużo nbt do itemków nagród # # pamiętaj że każda z tych opcji musi znajdować się # # w "on load" na samym dole kodu! # # # # ################################################### # options: # ####### Nagrody: nagrody_zwykle: diamond and gold ingot and diamond nagrody_rzadkie: diamond chestplate of protection 2 named "&d&lDiaxowa Klata" and diamond axe of sharpness 3 named "&d&lDiaxowa Siekierka" nagrody_rzadkie2: diamond pickaxe of efficiency 3 named "&d&lDiaxowy Kilof" and diamond shovel of efficiency 4 named "&d&lDiaxowa Łopata" nagrody_legendarne: netherite ingot nagrody_legendarne2: netherite ingot nagrody_epickie: netherite pickaxe of fortune 4 and unbreaking 4 named "&d&lNetherytowy Kilof" nagrody_epickie1: netherite axe of efficiency 6 and sharpness 5 named "&d&lNetherytowa Siekiera" nagrody_epickie2: netherite hoe of unbreaking 5 named "&d&lNetherytowa Motyka" nagrody_epickie3: netherite shovel of efficiency 4 and unbreaking 4 named "&d&lNetherytowa Łopata" # ####### Procentowe szansy na nagrode: percent_rzadkie: 35 percent_legendarne: 5 percent_epickie: 1 # ####### Wypełnienie slotów między nagrodami: 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 # ####### Wypełnienie ramki GUI: ramka_type: diamond block # #######Nazwa Skrzynki/GUI: gui_name: "&6&lSkrzynia nagród" # #######Nazwa Klucza: key_name: "&4&lKlucz do &6&lSkrzyni nagród" # #######Blok który jest Skrzynką # =========== UWAGA! =========== # # Zmieniając typ skrzyni upewnij # # się, że jest to blok który # # po postawieniu zachowuje nazwę!# # Np. Shulker Box Beczka Skrzynia# # ############################## # chest_type: brown shulker box # #######Item który jest kluczem key_type: tripwire hook # #######Permissje do komend admina: perm_admin: roulette.admin # ============== Sekcja funkcji: =============== # 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 {@ramka_type} loop 6 times: 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 {_stop} to true 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::*} if {_stop} is true: set {nagrody::*} to {@nagrody_zwykle} set slot 13 of {_gui} to random element out of {nagrody::*} chance of {percent_rzadkie}%: set {nagrody::*} to {nagrody_rzadkie::*} set slot 13 of {_gui} to random element out of {nagrody::*} chance of {percent_legendarne}%: set {nagrody::*} to {nagrody_legendarne::*} set slot 13 of {_gui} to random element out of {nagrody::*} chance of {percent_epickie}%: set {nagrody::*} to {nagrody_epickie::*} 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} if name of slot 13 of {_gui} is set: send "&6&lGratulacje! &6Wygrałeś &6&l%name of slot 13 of {_gui}%" to {_p} stop send "&6&lGratulacje! &6Wygrałeś &6&l%slot 13 of {_gui}%" to {_p} wait 10 tick close {_p}'s inventory # ============== Sekcja komend: =============== # command /roulette [] [] []: permission: {@perm_admin) permission message: &cNie masz dostepu do tej komendy! trigger: if arg 1 is "givechest": if arg 2 is online: if arg 3 is set: give arg 3 of {@chest_type} named {@gui_name} to arg 2 if arg 1 is "givekey": if arg 2 is online: if arg 3 is set: give arg 3 of {@key_type} named {@key_name} to arg 2 # ============== Sekcja eventów: =============== # on inventory click: if inventory name of player's current inventory is {@gui_name}: cancel event on place: if event-block is {@chest_type}: if name of player's tool is {@gui_name}: if player has permission "{@perm_admin}": set {_x} to event-block if type of inventory of {_x} is inventory type: send "&6Ustawiłeś skrzynie ruletki!" stop send "&cTen blok nie może być skrzynią nagród!%nl%&6Sprawdź Ustawienia Skryptu" set event-block to air stop send "&cNie masz uprawnień do stawiania skrzyni ruletki!" set event-block to air on rightclick on {@chest_type}: if name of event-block is {@gui_name}: cancel event if player's tool is {@key_type} : if name of player's tool is {@key_name}: remove 1 {@key_type} named {@key_name} from player ruletka(player) stop push player backwards with speed 1 send "&cMusisz trzymać ""%{@key_name}%&c"" w ręce!" stop push player backwards with speed 1 send "&cMusisz trzymać ""%{@key_name}%&c"" w ręce!" on load: delete {nagrody_epickie::*} and {nagrody_rzadkie::*} and {nagrody::*} set {bloki::*} to {@bloki} set {nagrody::*} to {@nagrody_zwykle} add {@nagrody_rzadkie} to {nagrody::*} add {@nagrody_rzadkie2} to {nagrody::*} add {@nagrody_legendarne} to {nagrody_legendarne::*} add {@nagrody_legendarne2} to {nagrody_legendarne::*} add {@nagrody_epickie} to {nagrody::*} add {@nagrody_epickie1} to {nagrody::*} add {@nagrody_epickie2} to {nagrody::*} add {@nagrody_epickie3} to {nagrody::*} add {@nagrody_epickie} to {nagrody_epickie::*} add {@nagrody_epickie1} to {nagrody_epickie::*} add {@nagrody_epickie2} to {nagrody_epickie::*} add {@nagrody_epickie3} to {nagrody_epickie::*} add {@nagrody_rzadkie} to {nagrody_rzadkie::*} add {@nagrody_rzadkie2} to {nagrody_rzadkie::*}