# ########################################################### # # Name: Time Shop # Author: Saanjuk @doped.pl # Code Version: 1.1 # Minecraft Server Version: Any # # ChangeLog: # v 1.1: Fix Options and variables # ########################################################### Options: # ####NAZWA SKLEPU W GUI: sklep: "&f&lWizzard" # ####NAZWY RANG KTÓRE MAJĄ BYĆ PRZYDZIELONE: VIP: "vip" SVIP: "svip" MVIP: "koks" on placeholderapi placeholder request for the prefix "skycoins": if the identifier is "time": if {days::%player%} > 0: if {hours::%player%} >= 0 : if {minutes::%player%} >0: set {_onlinetime} to "%{days::%player%}%d %{hours::%player%}%h %{minutes::%player%}%m %{seconds::%player%}%s" else: set {_onlinetime} to "%{seconds::%player%}%s" else: set {_onlinetime} to "%{minutes::%player%}%m %{seconds::%player%}%s" else: set {_onlinetime} to "%{hours::%player%}%h %{minutes::%player%}%m %{seconds::%player%}%s" set the result to "%{_onlinetime}%" if the identifier is "coins": set the result to "%{SkyCoins::%player's name%}%" #placeholdery: skycoins_time - czas w formacie D:H:M:S skycoins_coins - monety on join: if {onlinetime::%player's name%} is not set: set {onlinetime::%player's name%} to 0 second set {SkyCoins::%player's name%} to yaml value "SkyCoins.%player's name%" from file "plugins/Skript/scripts/tokeny.yml" if {SkyCoins::%player's name%} is not set: set {SkyCoins::%player's name%} to 0 set yaml value "SkyCoins.%player's name%" from file "plugins/Skript/scripts/tokeny.yml" to {SkyCoins::%player's name%} while player is online: add 1 second to {onlinetime::%player's name%} add 1 to {seconds::%player's name%} if {seconds::%player's name%} > 59: remove 60 from {seconds::%player's name%} add 1 to {minutes::%player's name%} if {minutes::%player's name%} > 59: remove 60 from {minutes::%player's name%} add 1 to {hours::%player's name%} if {hours::%player's name%} > 23: add 1 to {days::%player's name%} remove 24 from {hours::%player's name%} wait 1 second command /tshop [] [] []: executable by: console trigger: arg 1 is "add": arg 2 is set: arg 3 is set: set {SkyCoins::%arg 2%} to {SkyCoins::%arg 2%} + arg 3 set yaml value "SkyCoins.%arg 3%" from file "plugins/Skript/scripts/tokeny.yml" to {SkyCoins::%arg 2%} send "&6Do Twojego konta dodano &6&l%arg 3% &d&lToken'ów" to arg 2 stop function info(p:player): set {setnickname::%{_p}%} to true set {_info} to chest inventory with 3 rows named "&6Info o Rangach" set slot 11 of {_info} to emerald block named "&eRanga &7&lVIP" with lore "" and "&a> &c| &7&lVIP &7Zawiera:" and "&a 4 działki" and "&a 3 sethome" and "&a 500$ zmiżki na pwarpa" and "&a komendę /nick" and "&a komendę /skin" set slot 13 of {_info} to gold block named "&eRanga &e&lS&7&lVIP" with lore "" and "&a> &c| &e&lS&7&lVIP &7Zawiera:" and "&a 5 działek" and "&a 4 sethome" and "&a 1000$ zmiżki na pwarpa" and "&a komendę /nick" and "&a komendę /skin" set slot 15 of {_info} to diamond block named "&eRanga &d&lKOKS" with lore "" and "&a> &c| &d&lKOKS &7Zawiera:" and "&a 8 działek" and "&a 5 sethome" and "&a 1500$ zmiżki na pwarpa" and "&a komendę /nick" and "&a komendę /skin" and "&a telekineze" open {_info} to {_p} command /timeshop: permission: tshop.command trigger: set yaml value "SkyCoins.%player's name%" from file "plugins/Skript/scripts/tokeny.yml" to {SkyCoins::%player's name%} "%region at player%" contains "spawn" set {_onlinetime} to "%{onlinetime::%player's name%}%" set {_prefix} to placeholder "luckperms_prefix" from player replace all "days" and "day" with "d" in {_onlinetime} replace all "hours" and "hour" with "h" in {_onlinetime} replace all "minutes" and "minute" with "m" in {_onlinetime} replace all "seconds" and "second" with "s" in {_onlinetime} replace all " " with "" in {_onlinetime} replace all "and" and "," with " " in {_onlinetime} set {_shopgui} to chest inventory with 2 rows named {@sklep} set {setnickname::%player%} to true set slot 0 of {_shopgui} to iron nugget named "&6Kup &d&lToken&6 x1" with lore "" and "&a> &c| &7Koszt: &60d 05h 00m" and "" and "&6Twój czas online:" and "&6%{_onlinetime}%" with custom model data 1 set slot 1 of {_shopgui} to iron ingot named "&6Kup &d&lToken&6 x5" with lore "" and "&a> &c| &7Koszt: &61d 0h 00m" and "&a> &c| &7Oszczędzasz: &61h" and "" and "&6Twój czas online:" and "&6%{_onlinetime}%" with custom model data 3 set slot 2 of {_shopgui} to gold ingot named "&6Kup &d&lToken&6 x10" with lore "" and "&a> &c| &7Koszt: &61d 20h 00m" and "&a> &c| &7Oszczędzasz: &66h" and "" and "&6Twój czas online:" and "&6%{_onlinetime}%" with custom model data 4 set slot 4 of {_shopgui} to tripwire hook named "&4&lKlucz do &6&lSkrzyni nagród" with lore "" and "&a> &c| &7Koszt: &65 &d&lToken'ów" set slot 15 of {_shopgui} to book named "&6INFORMACJE O RANGACH" with lore "" and "&a> &c| &7Kliknij po info!" set slot 6 of {_shopgui} to emerald block named "&6Kup &eRanga &7&lVIP" with lore "" and "&a> &c| &7Koszt: &62 &d&lToken'y" and "&a> &c| &7Czas trawania: &603d 00h 00m" and "" set slot 7 of {_shopgui} to gold block named "&6Kup &eRanga &e&lS&7&lVIP" with lore "" and "&a> &c| &7Koszt: &65 &d&lToken'ów" and "&a> &c| &7Czas trawania: &603d 00h 00m" and "" set slot 8 of {_shopgui} to diamond block named "&6Kup &eRanga &d&lKOKS" with lore "" and "&a> &c| &7Koszt: &610 &d&lToken'ów" and "&a> &c| &7Czas trawania: &603d 00h 00m" and "" set slot 9 of {_shopgui} to player's head named "&e%{_prefix}%&l%player's name% " with lore "&6Tokeny: %{SkyCoins::%player's name%}%" set slot 12 of {_shopgui} to red stained glass pane named "&1Poprzednia strona" set slot 13 of {_shopgui} to paper named "&7Strona: 1/1" set slot 14 of {_shopgui} to blue stained glass pane named "&fNastępna strona" set slot 17 of {_shopgui} to barrier named "&4Wróć" open {_shopgui} to player on inventory click: if name of event-inventory contain {@sklep}: cancel event if event-inventory is player's inventory: cancel event else if name of event-inventory contain {@sklep}: cancel event if clicked slot is 0: if {onlinetime::%player's name%} >= 1 hours: remove 1 hours from {onlinetime::%player's name%} remove 1 hours from {hours::%player's name%} add 1 to {SkyCoins::%player's name%} set yaml value "SkyCoins.%player's name%" from file "plugins/Skript/scripts/tokeny.yml" to {SkyCoins::%player's name%} message "&6 Kupiłeś &d&lToken&6 x1" else if {onlinetime::%player's name%} < 5 hours: close player's inventory message "&cNie masz wystarczającej ilości czasu online!" else if clicked slot is 1: if {onlinetime::%player's name%} >= 5 hours: remove 5 hours from {onlinetime::%player's name%} remove 5 hours from {hours::%player's name%} add 5 to {SkyCoins::%player's name%} set yaml value "SkyCoins.%player's name%" from file "plugins/Skript/scripts/tokeny.yml" to {SkyCoins::%player's name%} message "&6 Kupiłeś &d&lToken&6 x5" else if {onlinetime::%player's name%} < 1 day: close player's inventory message "&cNie masz wystarczającej ilości czasu online!" else if clicked slot is 2: if {onlinetime::%player's name%} >= 44 hours: remove 44 hours from {onlinetime::%player's name%} remove 44 hours from {hours::%player's name%} add 10 to {SkyCoins::%player's name%} set yaml value "SkyCoins.%player's name%" from file "plugins/Skript/scripts/tokeny.yml" to {SkyCoins::%player's name%} message "&6 Kupiłeś &d&lToken&6 x10" else if {onlinetime::%player's name%} < 44 hours: close player's inventory message "&cNie masz wystarczającej ilości czasu online!" else if clicked slot is 4: if {SkyCoins::%player's name%} >= 5: remove 5 from {SkyCoins::%player's name%} set yaml value "SkyCoins.%player's name%" from file "plugins/Skript/scripts/tokeny.yml" to {SkyCoins::%player's name%} give tripwire hook named "&4&lKlucz do &6&lSkrzyni nagród" to player message "&6 Kupiłeś &4&lKlucz do &6&lSkrzyni nagród" else if {SkyCoins::%player's name%} < 5: close player's inventory message "&cNie masz wystarczającej ilości &d&lTokenów!" else if clicked slot is 15: close player's inventory info(player) else if clicked slot is 6: if {SkyCoins::%player's name%} >= 2: remove 2 from {SkyCoins::%player's name%} set yaml value "SkyCoins.%player's name%" from file "plugins/Skript/scripts/tokeny.yml" to {SkyCoins::%player's name%} set {_vip} to {@VIP} execute console command "lp user %player's name% parent addtemp %{_vip}% 3d survival" message "&6 Kupiłeś &eRanga &7&lVIP &6na czas &73d" else if {SkyCoins::%player's name%} < 2: close player's inventory message "&cNie masz wystarczającej ilości &d&lTokenów!" else if clicked slot is 7: if {SkyCoins::%player's name%} >= 5: remove 5 from {SkyCoins::%player's name%} set yaml value "SkyCoins.%player's name%" from file "plugins/Skript/scripts/tokeny.yml" to {SkyCoins::%player's name%} set {_svip} to {@SVIP} execute console command "lp user %player's name% parent addtemp %{_svip}% 3d survival" message "&6 Kupiłeś &eRanga &7&lSVIP &6na czas &73d" else if {SkyCoins::%player's name%} < 5: close player's inventory message "&cNie masz wystarczającej ilości &d&lTokenów!" else if clicked slot is 8: if {SkyCoins::%player's name%} >= 10: remove 10 from {SkyCoins::%player's name%} set yaml value "SkyCoins.%player's name%" from file "plugins/Skript/scripts/tokeny.yml" to {SkyCoins::%player's name%} set {_mvip} to {@MVIP} execute console command "lp user %player's name% parent addtemp %{_mvip}% 3d survival" message "&6 Kupiłeś &eRanga &d&lKOKS &6na czas &73d" else if {onlinetime::%player's name%} < 10 hours: close player's inventory message "&cNie masz wystarczającej ilości &d&lTokenów!" else if clicked slot is 17: close player's inventory else: cancel event on inventory click: if name of event-inventory contain "&6Info o Rangach": cancel event if event-inventory is player's inventory: cancel event else if name of event-inventory contain "&6Info o Rangach": cancel event