Gq2LzG0m
Język: Skript
|
Autor: stefanik11
options: #LuckyPerms permissionAddCommand: "lp user {player} permission set {permission} true" command /rMines [<text>] [<text>] [<text>] [<text>]: trigger: if player doesn't have permission "rMines.admin": send "&4Nie posiadasz odpowiednich uprawnien!" stop if arg 1 is not set: send "&6Dostepne polecenia:" send " &e/rMines create <name> <permission> <cost>" send " &e/rMines delete <name>" send " &e/rMines setspawn <name>" send " &e/rMines teleport <name>" stop if arg 1 is not "create" or "delete" or "setspawn" or "teleport": send "&6Dostepne polecenia:" send " &e/rMines create <name> <permission> <cost>" send " &e/rMines delete <name>" send " &e/rMines setspawn <name>" send " &e/rMines teleport <name>" stop if arg 1 is "create": if arg 2 is not set: send "&4Podaj nazwe!" stop if arg 3 is not set: send "&4Podaj uprawnienie!" stop if arg 4 is not set: send "&4Podaj cene dostepu!" stop set {_name} to arg 2 if length of {rMines::mines::*} >= 54: send "&4Osiagnieta maksymalna liczbe kopalni!" stop if {rMines::mines::*} contains {_name}: send "&4Kopalnia o takiej nazwie juz istnieje!" stop set {_permission} to arg 3 set {_cost} to arg 4 if {_cost} is not number: send "&4Cena musi byc liczba!" stop add {_name} to {rMines::mines::*} set {rMines::mines::%{_name}%::permission} to {_permission} set {rMines::mines::%{_name}%::cost} to {_cost} send "&2Kopalnia utworzona!" stop if arg 1 is "delete": if arg 2 is not set: send "&4Podaj nazwe!" stop set {_name} to arg 2 if {rMines::mines::*} do not contain {_name}: send "&4Kopalnia o podanej nazwie nie istnieje!" stop clear {rMines::mines::%{_name}%::permission} clear {rMines::mines::%{_name}%::cost} clear {rMines::mines::%{_name}%::location} remove {_name} from {rMines::mines::*} send "&2Kopalnia usunieta!" stop if arg 1 is "setspawn": if arg 2 is not set: send "&4Podaj nazwe!" stop set {_name} to arg 2 if {rMines::mines::*} do not contain {_name}: send "&4Kopalnia o podanej nazwie nie istnieje!" stop set {rMines::mines::%{_name}%::location} to player's location send "&2Lokalizacja ustawiona!" stop if arg 1 is "teleport":: if arg 2 is not set: send "&4Podaj nazwe!" stop set {_name} to arg 2 if {rMines::mines::*} do not contain {_name}: send "&4Kopalnia o podanej nazwie nie istnieje!" stop set {_location} to {rMines::mines::%{_name}%::location} parsed as location if {_location} is not set: send "&4Lokalizacja tej kopalni nie jest ustawiona!" stop teleport player to {_location} send "&2Zostales przeteleportowany!" stop stop command /kopalnia: aliases: kopalnie, mine, mines trigger: set {_rows} to rounded down (length of {rMines::mines::*}) if {_rows} is 0: set {_rows} to 1 open chest with {_rows} rows named "&6Kopalnie:" to player wait 1 tick set {_i} to 0 loop {rMines::mines::*}: if player have permission {rMines::mines::%loop-value%::permission}: set slot {_i} of current inventory of player to book of unbreaking 1 named "&6Kopalnia: &7%loop-value%" with lore " &6> &fDostepna: &atak||||&2Kliknij, by sie przeteleportowac!" else: set slot {_i} of current inventory of player to book named "&6Kopalnia: &7%loop-value%" with lore " &6> &fDostepna: &cnie|| &6> &fCena: &b%{rMines::mines::%loop-value%::cost}%||||&2Kliknij, by zakupic!" add 1 to {_i} loop {_rows}*9 times: if slot (loop-number -1) of current inventory of player is air: set slot (loop-number -1) of current inventory of player to stained glass pane:7 named " " stop on inventory click: if name of current inventory of player is not "&6Kopalnie:": stop cancel event set {_item} to slot clicked slot of current inventory of player if {_item} is not book: stop close player's inventory set {_name} to uncolored name of {_item} replace "Kopalnia:" with "" in {_name} replace " " with "" in {_name} if player doesn't have permission {rMines::mines::%{_name}%::permission}: set {_cost} to {rMines::mines::%{_name}%::cost} parsed as integer if player's money < {_cost}: send "&4Nie posiadasz wystarczajacej ilosci gotowki, by zakupic ta kopalnie!" stop remove {_cost} from player's money set {_command} to {@permissionAddCommand} replace "{player}" with player in {_command} replace "{permission}" with {rMines::mines::%{_name}%::permission} in {_command} execute console command {_command} if player have permission {rMines::mines::%{_name}%::permission}: set {_location} to {rMines::mines::%{_name}%::location} parsed as location if {_location} is not set: send "&4Lokalizacja tej kopalni jest nie ustawiona, skontaktuj sie z administratorem!" stop teleport player to {_location} send "&2Zostales przeteleportowany!" stop stop