# Skrypt na nagrody za czas spędzony na serwerze # Autor: THEzombiePL # Kontakt # Discord: THEzombiePL#2308 on load: wait 10 ticks load yaml "plugins/TzPRewards/config.yml" as "config" if yaml value "rows" from "config" is not set: set yaml value "rows" from "config" to 3 save yaml "config" if yaml value "playtime" from "config" is not set: set yaml value "playtime.8.item" from "config" to "dirt" set yaml value "playtime.8.rewardname" from "config" to "gruz" set yaml value "playtime.8.name" from "config" to "&6Trochę gruzu" set yaml value "playtime.8.lore" from "config" to "&6Dirt &ex&33 &7za &61h &7na serwerze" set yaml value "playtime.8.give" from "config" to "3 dirt" set yaml value "playtime.8.permission" from "config" to "nagroda.dirt1" set yaml value "playtime.8.noperm" from "config" to "&cTylko admin może to odebrać" set yaml value "playtime.8.servercommand" from "config" to "tell @player &aGratulacje odebrałeś nagrodę" set yaml value "playtime.8.message" from "config" to "&dOtrzymałeś diaxa" set yaml value "playtime.8.hours" from "config" to 1 save yaml "config" every 15 minutes: load yaml "plugins/TzPRewards/config.yml" as "config" command /nagrody []: trigger: set {_h} to placeholder "statistic_hours_played" from player parsed as number set {_rows} to yaml value "rows" from "config" wait 1 tick open virtual chest with {_rows} rows named "&bNagrody za spędzony czas" to player loop yaml node keys "playtime" from "config": set {_item} to yaml value "playtime.%loop-value%.item" from "config" parsed as item set {_name} to yaml value "playtime.%loop-value%.name" from "config" set {_lore} to yaml value "playtime.%loop-value%.lore" from "config" set {_give} to yaml value "playtime.%loop-value%.give" from "config" parsed as item set {_servercommand} to yaml value "playtime.%loop-value%.servercommand" from "config" set {_rewardname} to yaml value "playtime.%loop-value%.rewardname" from "config" set {_permission} to yaml value "playtime.%loop-value%.permission" from "config" set {_nopermmsg} to yaml value "playtime.%loop-value%.nopermmsg" from "config" replace all "@player" with "%player%" in {_servercommand} set {_message} to yaml value "playtime.%loop-value%.message" from "config" set {_hours} to yaml value "playtime.%loop-value%.hours" from "config" set {_noperm} to yaml value "playtime.%loop-value%.noperm" from "config" format gui slot loop-value parsed as number of player with {_item} named {_name} with lore {_lore} to run: if {_permission} is set: if player doesn't have permission {_permission}: send {_noperm} stop if {nagroda::%{_rewardname}%.%player%} is set: send "&bJuż odebrałeś tą nagrodę" cancel event if {nagroda::%{_rewardname}%.%player%} is not set: if {_h} >= {_hours}: if "%{_message}%" is not "": send "%{_message}%" give {_give} to player execute server command "%{_servercommand}%" set {nagroda::%{_rewardname}%.%player%} to true else: send "&7Brakuje ci &e%difference between {_hours} and {_h}% &bgodzin&e/&by&7, aby odebrać tą nagrodę."