# ########################################################### # # Name: Roulette in Inventory # Author: Saanjuk @doped.pl # Code Version: 1.0 # Minecraft Server Version: Any # # ChangeLog: # v 1.0 - Create code on base Roulette v1.3 # ########################################################### # ============== 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_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" # #######Item który jest Skrzynką/Kluczem: chest_type: brown shulker box key_type: tripwire hook # #######Permissje do komend admina: perm_admin: roulette.admin # #######Permisje do otwierania skrzyni: use_permissin: yes perm_use: roulette.use # ============== 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} 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 {_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} else: 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 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_type}: if name of event-block is {@gui_name}: cancel event on rightclick: if player's tool is {@chest_type}: if name of player's tool is {@gui_name}: cancel event if {@use_permissin} is yes: if player has permission "{@perm_use}": if player's inventory contain {@key_type} named {@key_name}: remove 1 {@key_type} named {@key_name} from player ruletka(player) else: send "&cMusisz posiadać ""%{@key_name}%&c"" w eq!" else: send "&cNie posiadasz permisji do otwierania skrzyń!" else if {@use_permissin} is no: if player's inventory contain {@key_type} named {@key_name}: remove 1 {@key_type} named {@key_name} from player ruletka(player) else: send "&cMusisz posiadać ""%{@key_name}%&c"" w eq!" 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::*} 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::*}