Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on join:
- if file "plugins/Skript/scripts/Statistics/Players/%player%.yml" doesn't exists:
- create file "plugins/Skript/scripts/Statistics/Players/%player%.yml"
- wf "Str: '0'" to "plugins/Skript/scripts/Statistics/Players/%player%.yml"
- wf "Hp: '0'" to "plugins/Skript/scripts/Statistics/Players/%player%.yml"
- wf "Dex: '0'" to "plugins/Skript/scripts/Statistics/Players/%player%.yml"
- wf "Points: '10'" to "plugins/Skript/scripts/Statistics/Players/%player%.yml"
- on load:
- if folder "plugins/Skript/scripts/Statistics" doesn't exists:
- create folder "plugins/Skript/scripts/Statistics"
- create folder "plugins/Skript/scripts/Statistics/Players"
- create file "plugins/Skript/scripts/Statistics/Config.yml"
- create file "plugins/Skript/scripts/Statistics/Messages.yml"
- set {_Config} to result of connect to "http://pastebin.com/raw.php?i=AWNpphyN"
- wf {_Config} to "plugins/Skript/scripts/Statistics/Config.yml"
- set {_Messages} to result of connect to "http://pastebin.com/raw.php?i=gEyH9CHg"
- wf {_Messages} to "plugins/Skript/scripts/Statistics/Messages.yml"
- if folder "plugins/Skript/scripts/Statistics/Players" doesn't exists:
- create folder "plugins/Skript/scripts/Statistics/Players"
- if file "plugins/Skript/scripts/Statistics/Config.yml" doesn't exists:
- create file "plugins/Skript/scripts/Statistics/Config.yml"
- download from "http://pastebin.com/raw.php?i=AWNpphyN" to "plugins/Skript/scripts/Statistics/Config.yml"
- if file "plugins/Skript/scripts/Statistics/Messages.yml" doesn't exists:
- create file "plugins/Skript/scripts/Statistics/Messages.yml"
- download from "http://pastebin.com/raw.php?i=gEyH9CHg" to "plugins/Skript/scripts/Statistics/Messages.yml"
- set {Stats::Messages::No-Perm} to single value "No-Permissions" get of "plugins/Skript/scripts/Statistics/Messages.yml"
- set {Stats::Messages::No-Points} to single value "No-Points" get of "plugins/Skript/scripts/Statistics/Messages.yml"
- set {Stats::Messages::Str-Add} to single value "Str-Add" get of "plugins/Skript/scripts/Statistics/Messages.yml"
- set {Stats::Messages::Dex-Add} to single value "Dex-Add" get of "plugins/Skript/scripts/Statistics/Messages.yml"
- set {Stats::Messages::Hp-Add} to single value "Hp-Add" get of "plugins/Skript/scripts/Statistics/Messages.yml"
- set {Stats::Messages::Miss-Message} to single value "Miss-Message" get of "plugins/Skript/scripts/Statistics/Messages.yml"
- set {Stats::Messages::Get-Point} to single value "Get-Point" get of "plugins/Skript/scripts/Statistics/Messages.yml"
- set {Stats::Messages::Max-Stat-Message} to single value "Max-Stat-Message" get of "plugins/Skript/scripts/Statistics/Messages.yml"
- set {Stats::Config::Max-Points} to single value "Max-Points" get of "plugins/Skript/scripts/Statistics/Config.yml"
- set {Stats::Config::Max-One-Stat} to single value "Max-One-Stat" get of "plugins/Skript/scripts/Statistics/Config.yml"
- set {Stats::Config::Str-Bonus} to single value "Str-Bonus" get of "plugins/Skript/scripts/Statistics/Config.yml"
- set {Stats::Config::Dex-Chance-Bonus} to single value "Dex-Chance-Bonus" get of "plugins/Skript/scripts/Statistics/Config.yml"
- set {Stats::Config::HP-Bonus} to single value "HP-Bonus" get of "plugins/Skript/scripts/Statistics/Config.yml"
- set {Stats::Config::Point-Player-Chance} to single value "Point-Player-Chance" get of "plugins/Skript/scripts/Statistics/Config.yml"
- set {Stats::Config::Point-Entity-Chance} to single value "Point-Entity-Chance" get of "plugins/Skript/scripts/Statistics/Config.yml"
- command /Statistics:
- aliases: statystyki, stats
- trigger:
- if player don't have permission "statistics":
- send "%{Stats::Messages::No-Perm}%"
- stop
- set {_Str} to single value "Str" get of "plugins/Skript/scripts/Statistics/Players/%player%.yml"
- set {_Hp} to single value "Hp" get of "plugins/Skript/scripts/Statistics/Players/%player%.yml"
- set {_Dex} to single value "Dex" get of "plugins/Skript/scripts/Statistics/Players/%player%.yml"
- set {_Points} to single value "Points" get of "plugins/Skript/scripts/Statistics/Players/%player%.yml"
- open chest with 1 rows named "Statistics" to player
- wait 3 ticks
- format slot 3 of player with diamond sword named "&cSila" with lore "&fDodaje %{Stats::Config::Str-Bonus}% do obrazen." to close then run "skills str %player%"
- format slot 4 of player with golden apple:1 named "&4Zdrowie" with lore "&fDodaje %{Stats::Config::HP-Bonus}% do zdrowia." to close then run "skills hp %player%"
- format slot 5 of player with feather named "&aZrecznosc" with lore "&fDodaje %{Stats::Config::Dex-Chance-Bonus}% do szansy na unik." to close then run "skills dex %player%"
- format slot 8 of player with book named "&bStatystyki" with lore "&cSila - &6%{_Str}%&f.||&4Zdrowie - &6%{_Hp}%&f.||&aZrecznosc - &6%{_Dex}%&f.||&bPunkty do rozdania - &2%{_Points}%&f." to close
- stop
- command /skills [<text>] [<player>]:
- executable by: console
- trigger:
- wait 1 ticks
- set {_p} to arg 2
- set {_Points} to single value "Points" get of "plugins/Skript/scripts/Statistics/Players/%{_p}%.yml" parsed as integer
- set {_Max-One} to single value "Max-One-Stat" get of "plugins/Skript/scripts/Statistics/Config.yml" parsed as integer
- if {_Points} is smaller or equal to 0:
- send "%{Stats::Messages::No-Points}%" to {_p}
- stop
- if arg 1 is "str":
- set {_Str} to single value "Str" get of "plugins/Skript/scripts/Statistics/Players/%{_p}%.yml" parsed as integer
- if {_Str} is greater or equal to {_Max-One}:
- send "%{Stats::Messages::Max-Stat-Message}%" to {_p}
- stop
- add 1 to {_Str}
- remove 1 from {_Points}
- set yaml value "Str" from "Statistics/Players/%{_p}%.yml" to "%{_Str}%"
- set yaml value "Points" from "Statistics/Players/%{_p}%.yml" to "%{_Points}%"
- send "%{Stats::Messages::Str-Add}%" to {_p}
- stop
- if arg 1 is "dex":
- set {_Dex} to single value "Dex" get of "plugins/Skript/scripts/Statistics/Players/%{_p}%.yml" parsed as integer
- if {_Dex} is greater or equal to {_Max-One}:
- send "%{Stats::Messages::Max-Stat-Message}%" to {_p}
- stop
- add 1 to {_Dex}
- remove 1 from {_Points}
- set yaml value "Dex" from "Statistics/Players/%{_p}%.yml" to "%{_Dex}%"
- set yaml value "Points" from "Statistics/Players/%{_p}%.yml" to "%{_Points}%"
- send "%{Stats::Messages::Dex-Add}%" to {_p}
- stop
- if arg 1 is "hp":
- set {_Hp} to single value "Hp" get of "plugins/Skript/scripts/Statistics/Players/%{_p}%.yml" parsed as integer
- if {_Hp} is greater or equal to {_Max-One}:
- send "%{Stats::Messages::Max-Stat-Message}%" to {_p}
- stop
- add 1 to {_Hp}
- remove 1 from {_Points}
- set yaml value "Hp" from "Statistics/Players/%{_p}%.yml" to "%{_Hp}%"
- set yaml value "Points" from "Statistics/Players/%{_p}%.yml" to "%{_Points}%"
- send "%{Stats::Messages::Hp-Add}%" to {_p}
- set the maximum health of {_p} to maximum health of {_p}+{Stats::Config::HP-Bonus}
- stop
- stop
- on damage:
- if attacker is a player:
- set {_Str} to single value "Str" get of "plugins/Skript/scripts/Statistics/Players/%attacker%.yml" parsed as integer
- set damage to damage + {_Str}*{Stats::Config::Str-Bonus}
- if victim is a player:
- set {_Dex} to single value "Dex" get of "plugins/Skript/scripts/Statistics/Players/%victim%.yml" parsed as integer
- set {_Dex} to {_Dex}*{Stats::Config::Dex-Chance-Bonus}
- broadcast "%{_Dex}%"
- chance of {_Dex}%:
- set damage to 0
- send "%{Stats::Messages::Miss-Message}%" to victim
- stop
- on death:
- if victim is a player:
- if attacker is a player:
- set {_Chance} to {Stats::Config::Point-Player-Chance} parsed as number
- chance of {_Chance}%:
- set {_Points} to single value "Points" get of "plugins/Skript/scripts/Statistics/Players/%attacker%.yml" parsed as integer
- add 1 to {_Points}
- set yaml value "Points" from "Statistics/Players/%attacker%.yml" to "%{_Points}%"
- send "%{Stats::Messages::Get-Point}%" to attacker
- stop
- if victim isn't a player:
- if attacker is a player:
- set {_Chance} to {Stats::Config::Point-Entity-Chance} parsed as number
- chance of {_Chance}%:
- set {_Points} to single value "Points" get of "plugins/Skript/scripts/Statistics/Players/%attacker%.yml" parsed as integer
- add 1 to {_Points}
- set yaml value "Points" from "Statistics/Players/%attacker%.yml" to "%{_Points}%"
- send "%{Stats::Messages::Get-Point}%" to attacker
- stop
- stop
Advertisement
Add Comment
Please, Sign In to add comment