Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- # ___________________ ____ ____ ________ _____ _____________________ ___ ____ ___
- # / \ | | / \ | \ | | / \ | | | | | |
- # / ______________ / | | / \ | \ | | / ______________ \ | |___| |___| |
- # / / \_/ | | / \ | \ | | / / \_____\ | |
- # / / | | / /\ \ | |\ \ | | | |______________ | ____ |
- # | | | | / / \ \ | | \ \ | | \ \ | | | |
- # | | | | / / \ \ | | \ \ | | \_____________ \ | |____| |
- # | | | | / /------\ \ | | \ \ | | \ \ | |
- # \ \ | | / /________\ \ | | \ \ | | \ \ | ____ |
- # \ \ _ | | / / \ \ | | \ \| | _____ / / | | | |
- # \ \_____________/ \ | |_________________ / / \ \ | | \ | \ \_____________/ / | | | |
- # \ \ | | / / \ \ | | \ | \ / | | | |
- # \__________________/ |______________________| /____/ \____\ |____| \_________| \____________________/ |_______|____|_______|
- #
- # Original Factions Project, By UGCGames Ilya K (C).
- # By using this software you agree with our ToS: https://www.spigotmc.org/resources/flans-factions-skript-uuid-support-1-8-1-9-x-support.21708/
- #Here can be downloaded more Addons for this skript:
- #COMING SOON!
- #====================================================
- # Software Version:
- version: v2.3A Release #Only DEV! Don't touch this!
- #====================================================
- #PLEASE NOTE: Changing the options here are in your risk!
- #===================
- # Global Settings
- #===================
- #These are misc options. We recommend you to not touch them until you know what are you doing.
- #We won't give support if you change the options below.
- #They're in your own risk!
- #The rest of the options can be configured at (yourserver)/plugins/Factions/config.yml.
- options:
- #This will be the keyword for every displayed message/title/score/gui or any others..
- p: Clan #By default, you may change it only to 'Faction' or keep it as 'Faction', as you like, but don't put the 's' suffix after this because it will make some grammar mistakes. So beware with it ;)
- #This will be the world that clans will work ONLY ON!
- world: world #By default it is 'world', don't set here any other world that doesn't exist in your server database or it'll be error and it won't run the skript correctly. You've warned!!
- #This will be the command:
- command: c #This is the main command. Please don't put here any other symbols like: /,"'\;:|`~#@!%$^&1234567890*()-_+=?><][{} ONLY LETTERS!
- #These will be the ally commands that executable:
- cmd-additions: /f, /fac, /faction, /factions, /flan, /flans, /clan, /c, /clans #You can add more command allies here to the list, as you like. BUT NOT THE COMMAND itself, to not repeat that...
- #This will be the permission message:
- noperm: &8[&9Permission&8] &7You don't have permission to execute this command!
- #Should the death messages be enabled?
- death_messages: true #Set 'false' to disable it.
- #===================
- #Permissions Options
- #===================
- #This will be the Admin's perm.
- perm1: clan.admin #Please don't change it!
- #=======================================================
- # Support Service
- #
- # The skript shouldn't have more issues, but if you do
- # create a ticket at:
- # https://docs.google.com/forms/d/1kgn8_p71zRySpkvw0pa8S06f5mle_9G7x2vqAm139EI/viewform
- #=======================================================
- #End of config
- #===============================================================================================================================
- #Please take a note!
- #NOTE 1: Don't edit the code please, unless you know what're you doing. Changing the code in the skript is in YOUR own risk! We won't give support if you have changed something. You've warned!
- #NOTE 2: The code is advanced, and any little wrong thing that you will change, might break some of the skript operations and functions! You've warned!
- #===============================================================================================================================
- #CODE
- function UpdateScoreBoard(p: player):
- wait 0.5 second
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of {_p}%.yml"
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_p}%.yml"
- set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of {_p}%.yml"
- set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml"
- set {_e} to {_e} parsed as number
- if {_e} > 1:
- set {_energy} to "&b%{_e}% Days"
- if {_e} = 1:
- set {_energy} to "&b%{_e}% Day"
- if {_e} < 1:
- if {_e} > 0:
- set {_energy} to "&c%{_e}% Day"
- else:
- set {_energy} to "&cNo Energy"
- if {_e} is not set:
- set {_energy} to "&cNo Energy"
- set {_energy} to coloured {_energy}
- set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
- if {_t} is set:
- if {_t} is equal to {_c}:
- set {_t} to "&b%{_t}%"
- else:
- if {_a::*} contains "%{_t}%":
- set {_t} to "&a%{_t}%"
- else:
- if {_t} is "(Safe) Spawn":
- set {_t} to "&f(&bSafe&f) &bSpawn"
- if {_t} is "(Safe) Shop":
- set {_t} to "&f(&bSafe&f) &bShop"
- if {_t} isn't "(Safe) Shop" or "(Safe) Spawn":
- set {_t} to "&6%{_t}%"
- else:
- set {_t} to "&7Wilderness"
- set {_t} to coloured {_t}
- set {_bal} to "%{_p}'s balance%"
- replace all "$" with "" in {_bal}
- set {_title} to yaml value "scoreboard.title" from "../../Factions/config.yml"
- replace all "@" with "&" in {_title}
- set {_title} to coloured {_title}
- if {_c} is set:
- wipe {_p}'s sidebar
- set name of sidebar of {_p} to "%{_title}%"
- set {_count} to 14
- set {_lines::*} to yaml list "scoreboard.clan" from "../../Factions/config.yml"
- loop {_lines::*}:
- remove 1 from {_count}
- set {_line} to loop-value
- if {_line} contains "<energy>":
- replace all "<energy>" with "%{_energy}%" in {_line}
- if {_line} contains "<faction>":
- replace all "<faction>" with "%{_c}%" in {_line}
- if {_line} contains "<rank>":
- replace all "<rank>" with "%{_r}%" in {_line}
- if {_line} contains "<coins>":
- replace all "<coins>" with "%{_bal}%" in {_line}
- if {_line} contains "<territory>":
- replace all "<territory>" with "%{_t}%" in {_line}
- replace all "@" with "&" in {_line}
- set {_line} to coloured {_line}
- set score "%{_line}%" in sidebar of {_p} to {_count}
- else:
- wipe {_p}'s sidebar
- set name of sidebar of {_p} to "%{_title}%"
- set {_count} to 8
- set {_lines2::*} to yaml list "scoreboard.noclan" from "../../Factions/config.yml"
- loop {_lines2::*}:
- remove 1 from {_count}
- set {_line} to loop-value
- if {_line} contains "<rank>":
- replace all "<rank>" with "%{_r}%" in {_line}
- if {_line} contains "<coins>":
- replace all "<coins>" with "%{_bal}%" in {_line}
- if {_line} contains "<territory>":
- replace all "<territory>" with "%{_t}%" in {_line}
- replace all "@" with "&" in {_line}
- set {_line} to coloured {_line}
- set score "%{_line}%" in sidebar of {_p} to {_count}
- on join:
- wait 1.5 seconds
- loop all players:
- UpdateScoreBoard(loop-player)
- function PurchaseEnergy(p: player, c: text, e: number, g: number):
- add {_g} to {_e}
- set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml" to {_e}
- if {_g} = 1:
- send "&8[&9Energy&8] &7Successfully Purchased 1 Day for your {@p}." to {_p}
- if {_g} > 1:
- send "&8[&9Energy&8] &7Successfully Purchased %{_g}% Days for your {@p}." to {_p}
- if {_g} < 1:
- send "&8&9Energy&8] &7Successfully Purchased 2.4 Hours for your {@p}." to {_p}
- loop all players:
- UpdateScoreBoard(loop-player)
- on load:
- set {_load} to false
- if yaml value "version" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "prefix" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "settings-prefix" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "scoreboard.title" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml list "scoreboard.clan" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml list "scoreboard.noclan" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "countdown-home" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "prefix" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "maxplayers" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "maxterritories" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "maxallies" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "territory-costs" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "updater" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if {_load} is true:
- send "&8[&bCLANS&8] &bUh oh! config.yml has missing setting(s)!" to console
- send "&8[&bCLANS&8] &bWe'll repair it for you." to console
- wf "## ___________________ ____ ____ ________ _____ _____________________ ___ ____ ___" to "plugins/Factions/config.yml"
- wf "## / \ | | / \ | \ | | / \ | | | | | |" to "plugins/Factions/config.yml"
- wf "## / ______________ / | | / \ | \ | | / ______________ \ | |___| |___| |" to "plugins/Factions/config.yml"
- wf "## / / \_/ | | / \ | \ | | / / \_____\ | |" to "plugins/Factions/config.yml"
- wf "## / / | | / /\ \ | |\ \ | | | |______________ | ____ |" to "plugins/Factions/config.yml"
- wf "## | | | | / / \ \ | | \ \ | | \ \ | | | |" to "plugins/Factions/config.yml"
- wf "## | | | | / / \ \ | | \ \ | | \_____________ \ | |____| |" to "plugins/Factions/config.yml"
- wf "## | | | | / /------\ \ | | \ \ | | \ \ | |" to "plugins/Factions/config.yml"
- wf "## \ \ | | / /________\ \ | | \ \ | | \ \ | ____ |" to "plugins/Factions/config.yml"
- wf "## \ \ _ | | / / \ \ | | \ \| | _____ / / | | | |" to "plugins/Factions/config.yml"
- wf "## \ \_____________/ \ | |_________________ / / \ \ | | \ | \ \_____________/ / | | | |" to "plugins/Factions/config.yml"
- wf "## \ \ | | / / \ \ | | \ | \ / | | | |" to "plugins/Factions/config.yml"
- wf "## \__________________/ |______________________| /____/ \____\ |____| \_________| \____________________/ |_______|____|_______|" to "plugins/Factions/config.yml"
- wf "##" to "plugins/Factions/config.yml"
- wf "## Original Factions Project, By UGCGames Ilya K (C)." to "plugins/Factions/config.yml"
- wf "##" to "plugins/Factions/config.yml"
- wf "## By using this software you agree with our ToS: https://www.spigotmc.org/resources/flans-factions-skript-uuid-support-1-8-1-9-x-support.21708/" to "plugins/Factions/config.yml"
- wf "##" to "plugins/Skript/scripts/Factions/config.yml"
- wf "version: {@version}" to "plugins/Factions/config.yml"
- wf "##" to "plugins/Skript/scripts/Factions/config.yml"
- wf "##===================" to "plugins/Factions/config.yml"
- wf "## Global Settings" to "plugins/Factions/config.yml"
- wf "##===================" to "plugins/Factions/config.yml"
- wf "" to "plugins/Factions/config.yml"
- wf "## PLEASE NOTE!" to "plugins/Factions/config.yml"
- wf "## Due to unknown situation while config is being created colour codes are bugged. However, the colour codes work in general, but not in the file's creation." to "plugins/Factions/config.yml"
- wf "## Optional: You can use '@' as colour code too." to "plugins/Factions/config.yml"
- wf "" to "plugins/Factions/config.yml"
- wf "## Set the global prefix of the plugin." to "plugins/Factions/config.yml"
- wf "prefix: '@9Factions>'" to "plugins/Factions/config.yml"
- wf "" to "plugins/Factions/config.yml"
- wf "## Set the admin settings prefix of the plugin." to "plugins/Factions/config.yml"
- wf "settings-prefix: '@9Factions Admin>'" to "plugins/Factions/config.yml"
- wf "" to "plugins/Factions/config.yml"
- wf "## Manage your scoreboard." to "plugins/Factions/config.yml"
- wf "## Variables:" to "plugins/Factions/config.yml"
- wf "## <coins> = Player's Coins" to "plugins/Factions/config.yml"
- wf "## <faction> = Player's Faction." to "plugins/Factions/config.yml"
- wf "## <coins> = Player's Coins" to "plugins/Factions/config.yml"
- wf "## <territory> = Player's current Territory." to "plugins/Factions/config.yml"
- wf "## <rank> = Player's Faction Rank" to "plugins/Factions/config.yml"
- wf "## <energy> = Faction's Energy." to "plugins/Factions/config.yml"
- wf "" to "plugins/Factions/config.yml"
- wf "scoreboard:" to "plugins/Factions/config.yml"
- wf " title: '@6@lCLANS'" to "plugins/Factions/config.yml"
- wf " clan:" to "plugins/Factions/config.yml"
- wf " - ""@eMoney""" to "plugins/Factions/config.yml"
- wf " - ""<coins>""" to "plugins/Factions/config.yml"
- wf " - ""@a""" to "plugins/Factions/config.yml"
- wf " - ""@e{@p}""" to "plugins/Factions/config.yml"
- wf " - ""<faction>""" to "plugins/Factions/config.yml"
- wf " - ""@b""" to "plugins/Factions/config.yml"
- wf " - ""@e{@p} Energy""" to "plugins/Factions/config.yml"
- wf " - ""<energy>""" to "plugins/Factions/config.yml"
- wf " - ""@c""" to "plugins/Factions/config.yml"
- wf " - ""@e{@p} Rank""" to "plugins/Factions/config.yml"
- wf " - ""@6<rank>""" to "plugins/Factions/config.yml"
- wf " - ""@d""" to "plugins/Factions/config.yml"
- wf " - ""@eTerritory""" to "plugins/Factions/config.yml"
- wf " - ""<territory>""" to "plugins/Factions/config.yml"
- wf " noclan:" to "plugins/Factions/config.yml"
- wf " - ""@eMoney""" to "plugins/Factions/config.yml"
- wf " - ""<coins>""" to "plugins/Factions/config.yml"
- wf " - ""@a""" to "plugins/Factions/config.yml"
- wf " - ""@e{@p}""" to "plugins/Factions/config.yml"
- wf " - ""@cNo {@p}""" to "plugins/Factions/config.yml"
- wf " - ""@b""" to "plugins/Factions/config.yml"
- wf " - ""@eTerritory""" to "plugins/Factions/config.yml"
- wf " - ""<territory>""" to "plugins/Factions/config.yml"
- wf "" to "plugins/Factions/config.yml"
- wf "## How long time players need to wait until they get teleported to their homes?" to "plugins/Factions/config.yml"
- wf "countdown-home: 5 ##IN SECONDS!!" to "plugins/Factions/config.yml"
- wf "" to "plugins/Factions/config.yml"
- wf "## How many players should be in people's clans?" to "plugins/Factions/config.yml"
- wf "maxplayers: 20 ##We recommend 20 players per clan." to "plugins/Factions/config.yml"
- wf "" to "plugins/Factions/config.yml"
- wf "## How many players should be in people's clans?" to "plugins/Factions/config.yml"
- wf "maxterritories: 10 ##We recommend 10 chunks 16x16 for a clan." to "plugins/Factions/config.yml"
- wf "" to "plugins/Factions/config.yml"
- wf "## How many allies should a clan have?" to "plugins/Factions/config.yml"
- wf "maxallies: 5 ##We recommend up to 5 allies per clan." to "plugins/Factions/config.yml"
- wf "" to "plugins/Factions/config.yml"
- wf "## This is the price that will be taken from clan players for a 1 chunk of territory." to "plugins/Factions/config.yml"
- wf "territory-costs: 500" to "plugins/Factions/config.yml"
- wf "" to "plugins/Skript/scripts/Factions/config.yml"
- wf "##===================" to "plugins/Factions/config.yml"
- wf "## Updater Options" to "plugins/Factions/config.yml"
- wf "##===================" to "plugins/Factions/config.yml"
- wf "" to "plugins/Factions/config.yml"
- wf "## Should the updater be enabled or disabled? Set 'true' or 'false'." to "plugins/Factions/config.yml"
- wf "updater: true" to "plugins/Factions/config.yml"
- wf "" to "plugins/Factions/config.yml"
- wf "##===================" to "plugins/Factions/config.yml"
- wf "## Support Service" to "plugins/Factions/config.yml"
- wf "##" to "plugins/Factions/config.yml"
- wf "## The skript shouldn't have more issues, but if you do create a ticket at:" to "plugins/Factions/config.yml"
- wf "## https://docs.google.com/forms/d/1kgn8_p71zRySpkvw0pa8S06f5mle_9G7x2vqAm139EI/viewform" to "plugins/Factions/config.yml"
- wf "##===================" to "plugins/Factions/config.yml"
- send "&8[&bCLANS&8] &bSuccessfully repaired config.yml" to console
- wait 0.5 second
- loop all players:
- UpdateScoreBoard(loop-player)
- function Invite(p: player):
- if {_p} has permission "clan.use.*" or "{@perm1}" or "clan.invite":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of {_p}%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_p}%.yml"
- if {_r} is "Leader" or "Officer":
- wait 3 tick
- open chest with 6 rows named "Select a player to invite!" to {_p}
- format slot 0 of {_p} with arrow named "&6<&m--&6 &6Go Back" to close then run [make {_p} execute command "/{@command}"]
- set {_number} to 9
- loop all players:
- set {_c.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c.%loop-player%} isn't set:
- set {_player} to loop-player
- format slot {_number} of {_p} with skull of {_player} named "&6%{_player}%" with lore "&7Click to invite %{_player}%." to close then run [make {_p} execute command "/{@command} invite %{_player}%"]
- add 1 to {_number}
- function ManagePlayer(p: player, r: text, p2: offlineplayer, r2: text):
- if {_p2} is online:
- set {_status} to "&aOnline"
- else:
- set {_status} to "&cOffline"
- set {_status} to coloured {_status}
- wait 3 ticks
- if {_r2} is "Leader":
- set {_demote} to "Officer"
- if {_r2} is "Officer":
- set {_promote} to "Leader"
- set {_demote} to "Trusted"
- if {_r2} is "Trusted":
- set {_promote} to "Officer"
- set {_demote} to "Member"
- if {_r2} is "Member":
- set {_promote} to "Trusted"
- open chest with 3 rows named "Manage: %{_p2}%" to {_p}
- format slot 0 of {_p} with arrow named "&6Go Back!" to close then run [make {_p} execute command "/{@command}"]
- format slot 4 of {_p} with book named "&6%{_p2}%'s Stats" with lore "||&eStatus %{_status}%||&eRank &f%{_r2}%" to be unstealable
- if {_p} is equal to {_p2}:
- format slot 14 of {_p} with emerald block named "&c&lPromote %{_p2}%" with lore "&e||&7That will promote %{_p2}%.||&e||&cYou can't promote yourself." to be unstealable
- format slot 12 of {_p} with redstone block named "&c&lDemote %{_p2}%" with lore "&e||&7That will demote %{_p2}%.||&e||&cYou can't demote yourself." to be unstealable
- format slot 8 of {_p} with tnt named "&c&lKick %{_p2}%" with lore "&e||&7That will kick %{_p2}% &7from your {@p}.||&f||&cYou can't kick yourself." to be unstealable
- stop
- if {_r} is "Leader":
- if {_r2} is "Leader":
- format slot 8 of {_p} with tnt named "&c&lKick %{_p2}%" with lore "&e||&7That will kick %{_p2}% &7from your {@p}.||&f||&c%{_p2}% can't be kicked from your {@p}." to be unstealable
- else:
- format slot 8 of {_p} with tnt named "&6&lKick %{_p2}%" with lore "&e||&7That will kick %{_p2}% &7from your {@p}.||&f||&c&lWARNING! This action can't be undone." to close then run [make {_p} execute command "/{@command} kick %{_p2}%"] -> [execute {_p} command "{@command}"]
- if {_r} is "Officer":
- if {_r2} is "Leader" or "Officer":
- format slot 8 of {_p} with tnt named "&c&lKick %{_p2}%" with lore "&e||&7That will kick %{_p2}% &7from your {@p}.||&f||&c%{_p2}% can't be kicked from your {@p}." to be unstealable
- else:
- format slot 8 of {_p} with tnt named "&6&lKick %{_p2}%" with lore "&e||&7That will kick %{_p2}% &7from your {@p}.||&f||&c&lWARNING! This action can't be undone." to close then run [make {_p} execute command "/{@command} kick %{_p2}%"] -> [execute {_p} command "{@command}"]
- if {_r2} is "Leader":
- format slot 14 of {_p} with emerald block named "&c&lPromote %{_p2}%" with lore "&e||&7That will promote %{_p2}%.||&e||&cThat player has the highest possible faction rank." to be unstealable
- else:
- if {_r} is "Officer":
- if {_r2} is "Officer" or "Leader":
- format slot 14 of {_p} with emerald block named "&c&lPromote %{_p2}%" with lore "&e||&7That will promote %{_p2}%.||&e||&cThat player can't be promoted." to be unstealable
- else:
- format slot 14 of {_p} with emerald block named "&a&lPromote %{_p2}%" with lore "&e||&7That will promote %{_p2}%||&7from &6%{_r2}% &7to &6%{_promote}%&7." to close then run [execute {_p} command "/{@command} promote %{_p2}%"] -> [execute {_p} command "{@command}"]
- if {_r} is "Leader":
- format slot 14 of {_p} with emerald block named "&a&lPromote %{_p2}%" with lore "&e||&7That will promote %{_p2}%||&7from &6%{_r2}% &7to &6%{_promote}%&7." to close then run [execute {_p} command "/{@command} promote %{_p2}%"] -> [execute {_p} command "{@command}"]
- if {_r} is "Officer":
- if {_r2} is "Officer" or "Leader":
- format slot 12 of {_p} with redstone block named "&c&lDemote %{_p2}%" with lore "&e||&7That will demote %{_p2}%.||&e||&cThat player can't be demoted." to be unstealable
- else:
- if {_r2} is "Member":
- format slot 12 of {_p} with redstone block named "&c&lDemote %{_p2}%" with lore "&e||&7That will demote %{_p2}%.||&e||&cThat player has the lowest possible faction rank." to be unstealable
- else:
- format slot 12 of {_p} with redstone block named "&a&lDemote %{_p2}%" with lore "&e||&7That will demote %{_p2}%||&7from &6%{_r2}% &7to &6%{_demote}%&7." to close then run [execute {_p} command "/{@command} demote %{_p2}%"] -> [execute {_p} command "{@command}"]
- if {_r} is "Leader":
- if {_r2} is "Member":
- format slot 12 of {_p} with redstone block named "&a&lDemote %{_p2}%" with lore "&e||&7That will demote %{_p2}%.||&e||&cThat player has the lowest possible faction rank." to be unstealable
- else:
- if {_r2} is "Leader":
- format slot 12 of {_p} with redstone block named "&c&lDemote %{_p2}%" with lore "&e||&7That will demote %{_p2}%.||&e||&cThat player can't be demoted." to be unstealable
- else:
- format slot 12 of {_p} with redstone block named "&a&lDemote %{_p2}%" with lore "&e||&7That will demote %{_p2}%||&7from &6%{_r2}% &7to &6%{_demote}%&7." to close then run [execute {_p} command "/{@command} demote %{_p2}%"] -> [execute {_p} command "{@command}"]
- on inventory click:
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%player's uuid%.yml"
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%player's uuid%.yml"
- if inventory name of player's current inventory is "{@p} Manager - &b%{_c}%":
- set {_u::*} to yaml list "Faction.UUID" from "../../Factions/Factions/%{_c}%.yml"
- set {_i} to clicked item name
- set {_confirm} to false
- loop {_u::*}:
- set {_name} to yaml value "Userdata.Username" from "../../Factions/Userdata/%loop-value%.yml"
- if {_i} is "&a&l%{_name}%" or "&c&l%{_name}%":
- set {_confirm} to true
- set {_uuid} to loop-value
- exit loop
- if {_confirm} is true:
- set {_name} to uncoloured {_name}
- replace all "&a&l" and "&c&l" with "" in {_name}
- set {_name} to {_name} parsed as a offlineplayer
- set {_r2} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%{_uuid}%.yml"
- cancel event
- close player's inventory
- ManagePlayer(player, {_r}, {_name}, {_r2})
- stop
- if {_confirm} is false:
- set {_wins::*} to yaml list "Faction.Wins" from "../../Factions/Factions/%{_c}%.yml"
- loop {_wins::*}:
- if {_i} is "&6&l%loop-value%" or "&c&l%loop-value%":
- set {_confirm} to true
- exit loop
- set {_loses::*} to yaml list "Faction.Loses" from "../../Factions/Factions/%{_c}%.yml"
- loop {_loses::*}:
- if {_i} is "&6&l%loop-value%":
- set {_confirm} to true
- exit loop
- set {_i} to uncoloured {_i}
- replace all "&6&l" with "" in {_i}
- close player's inventory
- wait 3 ticks
- execute player command "{@command} info %{_i}%"
- command /{@command} [<text>] [<offlineplayer>] [<text>] [<text>]:
- aliases: {@cmd-additions}
- trigger:
- loop all players:
- UpdateScoreBoard(loop-player)
- set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
- set {_padmin} to yaml value "settings-prefix" from "../../Factions/config.yml"
- replace all "@" with "&" in {_prefix}
- replace all "@" with "&" in {_padmin}
- set {_prefix} to coloured {_prefix}
- set {_padmin} to coloured {_padmin}
- player is in "{@world}"
- if player has permission "clan.use":
- if arg 1 is not set:
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is not set:
- wait 3 ticks
- open chest with 6 rows named "{@p} Manager - &cNo {@p}" to player
- format slot 13 of player with redstone block named "&cYou have no {@p}!" with lore "&7Use '/c create <{@p} Name>' to get started!" to close then run [make player execute command "/{@command} create"]
- loop all players:
- if {clan.%loop-player%.invite.%player%} is true:
- set {_number} to 36
- set {_player} to loop-player
- set {_c.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- format slot {_number} of player with skull of {_player} named "&6%{_c.%loop-player%}%&7's {@p} has invited you!" with lore "||&7Click to join the selected {@p}!" to close then run [make player execute command "/{@command} join %{_player}%"]
- add 1 to {_number}
- else:
- set {_t::*} to yaml list "Faction.Territory" from "../../Factions/Factions/%{_c}%.yml"
- set {_ts} to size of {_t::*}
- set {_s::*} to yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
- set {_f} to yaml value "Faction.Founder" from "../../Factions/Factions/%{_c}%.yml"
- set {_d} to yaml value "Faction.Date" from "../../Factions/Factions/%{_c}%.yml"
- if {_d} is not set:
- set {_d} to "Unknown"
- if {_f} is not set:
- set {_f} to "Unknown"
- set {_max} to yaml value "maxplayers" from "../../Factions/config.yml"
- set {_max2} to yaml value "maxterritories" from "../../Factions/config.yml"
- set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
- if {_a::*} is not set:
- set {_a::*} to "&a"
- set {_s} to size of {_s::*}
- set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml"
- set {_e} to {_e} parsed as number
- if {_e} is not set:
- set {_e} to 0
- set {_h} to yaml value "Faction.Home" from "../../Factions/Factions/%{_c}%.yml"
- set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of player%.yml"
- wait 3 tick
- open chest with 6 rows named "{@p} Manager - &b%{_c}%" to player
- if {_r} is "Leader" or "Officer":
- format slot 0 of player with book named "&6&l&nInvite a player to your {@p}!" with lore "&7Here you can select easily||&7a player to invite!" to close then run [Invite(player)]
- else:
- format slot 0 of player with book named "&c&l&nInvite a player to your {@p}!" with lore "&c||&cYou need to be Officer or Leader to do that!||&a||&7Here you can select easily||&7a player to invite!" to be unstealable
- if {_h} is set:
- set {_x} to x-coordinate of {_h}
- set {_x} to {_x} parsed as integer
- set {_y} to y-coordinate of {_h}
- set {_y} to {_y} parsed as integer
- set {_z} to z-coordinate of {_h}
- set {_z} to {_z} parsed as integer
- format slot 4 of player with paper named "&6%{_c}%&7's Stats:" with lore "&b&n{@p} Info:||&7||&eFounder &f%{_f}%||&eCreated &f%{_d}%||&e{@p} Players &f%{_s}%/%{_max}%||&eHome Location &f%{_x}%, %{_y}%, %{_z}%||&eEnergy Left &f%{_e}% Day(s)||&eTerritories Claimed &f%{_ts}%/%{_max2}%||&eAllies &a%{_a::*}%" to be unstealable
- else:
- format slot 4 of player with paper named "&6%{_c}%&7's Stats:" with lore "&b&n{@p} Info:||&7||&eFounder &f%{_f}%||&eCreated &f%{_d}%||&e{@p} Players &f%{_s}%/%{_max}%||&eHome Location &cNo Home Set.||&eEnergy Left &f%{_e}% Day(s)||&eTerritories Claimed &f%{_ts}%/%{_max2}%||&eAllies &a%{_a::*}%" to be unstealable
- format slot 6 of player with compass named "&6Teleport to {@p}'s Home" with lore "&7That will teleport to your {@p}'s Home" to close then run [make player execute command "/{@command} home"]
- if {_r} is "Leader" or "Officer":
- if {_t} is set:
- if {_t} is equal to "%{_c}%":
- format slot 2 of player with beacon named "&a&l&nSet your Home!" with lore "&7That will set your {@p}'s Home||&7in your location: &a%x-coordinate of player%, %y-coordinate of player%, %z-coordinate of player%" to close then run [make player execute command "/{@command} sethome"]
- else:
- format slot 2 of player with beacon named "&c&l&nSet your Home!" with lore "&cHome can't be set in this Territory!||&a||&7That will set your {@p}'s Home||&7in your location: &a%x-coordinate of player%, %y-coordinate of player%, %z-coordinate of player%" to be unstealable
- else:
- format slot 2 of player with beacon named "&c&l&nSet your Home!" with lore "&cHome can be set only in your Territory!||&a||&7That will set your {@p}'s Home||&7in your location: &a%x-coordinate of player%, %y-coordinate of player%, %z-coordinate of player%" to be unstealable
- else:
- format slot 2 of player with beacon named "&c&l&nSet your Home!" with lore "&cYou need to be Officer or Leader to do that!||&a||&7That will set your {@p}'s Home||&7in your location: &a%x-coordinate of player%, %y-coordinate of player%, %z-coordinate of player%" to be unstealable
- if {_r} is "Leader" or "Officer":
- if {_t} is not set:
- set {_tcosts} to yaml value "territory-costs" from "../../Factions/config.yml"
- if player's balance is greater or equal to {_tcosts}:
- format slot 12 of player with emerald block named "&a&l&nClaim this Territory!" with lore "&7That will claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories." to close then run [make player execute command "/{@command} claim"]
- if player's balance is less than {_tcosts}:
- format slot 12 of player with emerald block named "&c&l&nClaim this Territory!" with lore "&7That will claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories.||&7||&cYou don't have enough money to purchase this chunk!" to be unstealable
- else:
- if {_t} is equal to "%{_c}%":
- format slot 12 of player with emerald block named "&c&l&nClaim this Territory!" with lore "&cThat Territory is already owned by your {@p}!||&a||&7That will claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories." to be unstealable
- else:
- format slot 12 of player with emerald block named "&c&l&nClaim this Territory!" with lore "&cThat Territory is already owned by &6%{_t}%.||&a||&7That will claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories." to be unstealable
- else:
- format slot 12 of player with emerald block named "&c&l&nClaim this Territory!" with lore "&cYou need to be Officer or Leader to do that!||&a||&7That will claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories." to be unstealable
- if {_r} is "Leader" or "Officer":
- if {_t} is set:
- if {_t} is equal to "%{_c}%":
- format slot 14 of player with redstone block named "&a&l&nUn-Claim this Territory!" with lore "&7That will un-claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories." to close then run [make player execute command "/{@command} unclaim"]
- else:
- format slot 14 of player with redstone block named "&c&l&nUn-Claim this Territory!" with lore "&cThat Territory is already owned by &6%{_t}%.||&a||&7That will un-claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories." to be unstealable
- else:
- format slot 14 of player with redstone block named "&c&l&nUn-Claim this Territory!" with lore "&cThat Territory is not claimed by any {@p}!||&a||&7That will un-claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories." to be unstealable
- else:
- format slot 14 of player with redstone block named "&c&l&nUn-Claim this Territory!" with lore "&cYou need to be Officer or Leader to do that!||&a||&7That will un-claim this chunk as your Territory!||&7Your {@p} claimed &6%{_ts}% &7Territories of||&6%{_max2}% &7Max Territories." to be unstealable
- if {_r} is "Leader":
- format slot 8 of player with tnt named "&cDisband {@p}" with lore "&c&nWARNING:&7 This will disband your {@p}.||&7This means that all players and all your territories will be ||&7removed, includes your {@p}!||" to close then run [make player execute command "/{@command} disband"]
- else:
- format slot 8 of player with gunpowder named "&cLeave {@p}" with lore "&7You will leave your {@p}!" to close then run [make player execute command "/{@command} leave"]
- set {_number} to 17
- set {_count} to 0
- set {_u::*} to yaml list "Faction.UUID" from "../../Factions/Factions/%{_c}%.yml"
- set {_p} to player
- loop {_u::*}:
- add 1 to {_number}
- set {_u2} to loop-value
- set {_p2} to yaml value "Userdata.Username" from "../../Factions/Userdata/%{_u2}%.yml"
- set {_r2} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%{_u2}%.yml"
- add 1 to {_n}
- set {_p2} to {_p2} parsed as a player
- if {_p2} is online:
- set {_name} to "&a&l%{_p2}%"
- set {_skull} to {_p2}'s skull
- else:
- set {_name} to "&c&l%{_p2}%"
- set {_skull} to skeleton head
- set {_name} to coloured {_name}
- if {_r} is "Leader" or "Officer":
- set slot {_number} of player's current inventory to {_skull} named "%{_name}%" with lore "&7||&7Rank: &6%{_r2}%||&7||&7Click to manage %{_p2}%'s settings." with no nbt
- else:
- format slot {_number} of {_p} with {_skull} named "%{_name}%" with lore "&7||&7Rank: &6%{_r2}%" to be unstealable
- set {_n3} to 45
- set {_n2} to 53
- set {_wins::*} to yaml list "Faction.Wins" from "../../Factions/Factions/%{_c}%.yml"
- loop {_wins::*}:
- set {_points} to yaml value "Faction.WarPoints.%loop-value%" from "../../Factions/Factions/%{_c}%.yml"
- set {_points} to {_points} parsed as number
- set slot {_n2} of player's current inventory to {_points} of diamond sword named "&6&l%loop-value%" with lore "&7||&7Your {@p} has %{_points}% war points against %loop-value%." with no nbt
- remove 1 from {_n2}
- set {_loses::*} to yaml list "Faction.Loses" from "../../Factions/Factions/%{_c}%.yml"
- loop {_loses::*}:
- set {_points} to yaml value "Faction.WarPoints.%loop-value%" from "../../Factions/Factions/%{_c}%.yml"
- set {_points} to {_points} parsed as number
- set slot {_n3} of player's current inventory to {_points} of stone sword named "&c&l%loop-value%" with lore "&7||&7Your {@p} has %{_points}% war points against %loop-value%." with no nbt
- add 1 to {_n3}
- if arg 1 is not "stats" or "show" or "enemy" or "revoke" or "factions" or "energy" or "neutral" or "chat" or "invite" or "kick" or "join" or "create" or "ally" or "sethome" or "home" or "leave" or "help" or "list" or "admin" or "reload" or "disband" or "info" or "clans" or "promote" or "deinvite" or "demote" or "claim" or "unclaim":
- message "%{_prefix}% &7Unknown sub command '&6%arg 1%&7'. Type '/{@command} help' for help."
- else:
- if arg 1 is "help":
- if player has permission "clan.ignore" or "{@perm1}":
- send "&e&lClans &6{@version} &aBy UGCGames Ilya K." to player
- send "&6/{@command} &eMain Command" to player
- send "&6/{@command} sethome &eSet your {@p} Home." to player
- send "&6/{@command} home &eTeleport you to your {@p} home." to player
- send "&6/{@command} create <{@p} Name> &eCreate your {@p}." to player
- send "&6/{@command} invite <player> &eInvite player to your {@p}." to player
- send "&6/{@command} leave &eLeave your {@p}." to player
- send "&6/{@command} join <player> &eJoin the player's {@p}." to player
- send "&6/{@command} kick <player> &eKick player from you {@p}." to player
- send "&6/{@command} disband &eClose your {@p}." to player
- send "&6/{@command} promote <player> &ePromote the player." to player
- send "&6/{@command} demote <player> &eDemote the player." to player
- send "&6/{@command} info <player> &ePlayer's {@p} Information." to player
- send "&6/{@command} <clans;factions> &eClans List" to player
- send "&6/{@command} deinvite <player> &eDeinvite Player" to player
- send "&6/{@command} chat &eToggle Chat type: Public, Clan, Ally" to player
- message "&6/{@command} claim &eClaim Territory." to player
- message "&6/{@command} unclaim &eUn-Claim Territory." to player
- send "&6/{@command} energy &eManage your {@p}'s Energy."
- message "&6/{@command} ally <invite;accept> <player> &eInvite/Accept Alliance with a {@p}." to player
- message "&6/{@command} <neutral;revoke;enemy> <{@p} name> &eRevoke Alliance with a {@p}." to player
- if player has permission "{@perm1}":
- send "&a/{@command} &aadmin &cManage Admin Commands."
- else:
- message "{@noperm}"
- if arg 1 is "admin":
- if player has permission "{@perm1}":
- if arg 2 is not set:
- send "&e&lClans &6{@version} &bBy UGCGames Ilya K." to player
- send "&a/{@command} reload &bReload the skript." to player
- send "&a/{@command} admin claim Spawn &bClaim Spawn Territory." to player
- send "&a/{@command} admin claim Shop &bClaim Shop Spawn Territory." to player
- send "&a/{@command} admin unclaim Spawn &bUn-Claim Spawn Territory." to player
- send "&a/{@command} admin unclaim Shop &bUn-Claim Shop Spawn Territory." to player
- send "&a/{@command} admin kick <player> &bForce kick a player from their {@p}." to player
- send "&a/{@command} admin promote <player> &bForce promote a player in their current {@p}." to player
- send "&a/{@command} admin demote <player> &bForce demote a player in their current {@p}." to player
- send "&a/{@command} admin join <{@p}> &bForce join a {@p}." to player
- send "&a/{@command} admin delete <{@p}> &bDelete specific {@p} from the database." to player
- send "&a/{@command} admin reset <all;chunks;(clans;factions);userdata> &bReset specific or all {@p} Data." to player
- else:
- set {_player} to arg 3
- set {_player} to {_player} parsed as an offline player
- if arg 2 is set:
- if arg 2 is "kick":
- if arg 3 is set:
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of {_player}%.yml"
- if {_c} is set:
- remove "%{_player}%" from yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
- delete yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of {_player}%.yml"
- message "%{_padmin}% &7You have kicked &6%{_player}% &7from {@p} &6%{_c}%&7."
- else:
- send "%{_padmin}% &6%{_player}% &7isn't in any {@p}."
- else:
- send "%{_padmin}% &7Use '/{@command} admin kick <player>' to force kick the player from their {@p}."
- if arg 2 is "promote":
- if arg 3 is set:
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of {_player}%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_player}%.yml"
- if {_r} is "Member":
- set {_r} to "Trusted"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_player}%.yml" to "%{_r}%"
- message "%{_padmin}% &7You promoted &6%{_player}% &7to &6%{_r}% &7from {@p} &6%{_c}%&7."
- send "%{_prefix}% &7You were promoted to &6%{_r}%&7." to {_player}
- stop
- if {_r} is "Trusted":
- set {_r} to "Officer"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_player}%.yml" to "%{_r}%"
- message "%{_padmin}% &7You promoted &6%{_player}% &7to &6%{_r}% &7from {@p} &6%{_c}%&7."
- send "%{_prefix}% &7You were promoted to &6%{_r}%&7." to {_player}
- stop
- if {_r} is "Officer":
- set {_r} to "Leader"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_player}%.yml" to "%{_r}%"
- message "%{_padmin}% &7You promoted &6%{_player}% &7to &6%{_r}% &7from {@p} &6%{_c}%&7."
- send "%{_prefix}% &7You were promoted to &6%{_r}%&7." to {_player}
- stop
- if {_r} is "Leader":
- send "%{_padmin}% &6%{_player}% &7can't be promoted higher than &6Leader&7."
- else:
- send "%{_padmin}% &6%arg 3% &7isn't in any {@p}."
- else:
- send "%{_padmin}% &7Use '/{@command} admin promote <player>' to force promote the player in their {@p}."
- if arg 2 is "demote":
- if arg 3 is set:
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of {_player}%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_player}%.yml"
- if {_r} is "Leader":
- set {_r} to "Officer"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_player}%.yml" to "%{_r}%"
- message "%{_padmin}% &7You demoted &6%{_player}% &7to &6%{_r}% &7from {@p} &6%{_c}%&7."
- send "%{_prefix}% &7You were demoted to &6%{_r}%&7." to {_player}
- stop
- if {_r} is "Officer":
- set {_r} to "Trusted"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_player}%.yml" to "%{_r}%"
- message "%{_padmin}% &7You demoted &6%{_player}% &7to &6%{_r}% &7from {@p} &6%{_c}%&7."
- send "%{_prefix}% &7You were demoted to &6%{_r}%&7." to {_player}
- stop
- if {_r} is "Trusted":
- set {_r} to "Member"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of {_player}%.yml" to "%{_r}%"
- message "%{_padmin}% &7You demoted &6%{_player}% &7to &6%{_r}% &7from {@p} &6%{_c}%&7."
- send "%{_prefix}% &7You were demoted to &6%{_r}%&7." to {_player}
- stop
- if {_r} is "Member":
- send "%{_padmin}% &6%{_player}% &7can't be demoted lower than &6Member&7."
- else:
- send "%{_padmin}% &6%{_player}% &7isn't in any {@p}."
- else:
- send "%{_padmin}% &7Use '/{@command} admin demote <player>' to force demote the player in their {@p}."
- if arg 2 is "join":
- if arg 3 is set:
- set {_c::*} to yaml list "Factions" from "../../Factions/Factions.yml"
- set {_join} to "false"
- loop {_c::*}:
- if arg 3 is loop-value:
- set {_join} to "true"
- if {_join} is "true":
- set yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml" to "%arg 3%"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml" to "Recruit"
- set yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml" to "Public"
- message "%{_padmin}% &7You have joined &b%arg 3%."
- else:
- send "%{_padmin}% &7{@p} &6%arg 3% &7doesn't exist."
- else:
- send "%{_padmin}% &7Use '/{@command} admin join <{@p}>' to force join a {@p}."
- if arg 2 is "delete":
- if arg 3 is set:
- set {_c::*} to yaml list "Factions" from "../../Factions/Factions.yml"
- set {_del} to "false"
- loop {_c::*}:
- if arg 3 is loop-value:
- set {_del} to "true"
- set {_clan} to loop-value
- if {_del} is "true":
- set {_u::*} to yaml list "Faction.UUID" from "../../Factions/Factions/%{_clan}%.yml"
- set {_p::*} to yaml list "Faction.Players" from "../../Factions/Factions/%{_clan}%.yml"
- set {_t::*} to yaml list "Faction.Territory" from "../../Factions/Factions/%{_clan}%.yml"
- loop all players:
- set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_p.%loop-player%} is equal to "%{_clan}%":
- send "%{_prefix}% &7Your {@p} &b%{_clan}% &7has been disbanded." to loop-player
- loop {_t::*}:
- set {_loop} to loop-value
- delete yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_loop}%.yml"
- loop {_u::*}:
- set {_loop2} to loop-value
- delete yaml value "Userdata.Faction" from "../../Factions/Userdata/%{_loop2}%.yml"
- delete yaml value "Userdata.Rank" from "../../Factions/Userdata/%{_loop2}%.yml"
- delete folder "plugins/Factions/Factions/%{_clan}%.yml"
- remove "%{_clan}%" from yaml list "Factions" from "../../Factions/Factions.yml"
- send "%{_padmin}% &7{@p} &6%{_clan}% &7has been removed!"
- else:
- send "%{_padmin}% &7{@p} &6%arg 3% &7doesn't exist!"
- else:
- send "%{_padmin}% &7You didn't input a {@p} to remove. Please use: '/{@command} admin delete <{@p} Name>'."
- if arg 2 is "reset":
- if arg 3 is "all" or "chunks" or "territories" or "userdata" or "factions" or "clans":
- if arg 3 is "all":
- send "%{_padmin}% &c&lAll saved database has been deleted."
- delete directory "plugins/Factions/Factions"
- delete directory "plugins/Factions/Userdata"
- delete directory "plugins/Factions/Territories"
- delete file "plugins/Factions/Factions.yml"
- if arg 3 is "chunks" or "territories":
- send "%{_padmin}% &c&lTerritories saved database has been deleted."
- delete directory "plugins/Factions/Territories"
- if arg 3 is "userdata":
- send "%{_padmin}% &c&lUserdata saved database has been deleted."
- delete directory "plugins/Factions/Userdata"
- if arg 3 is "factions" or "clans":
- send "%{_padmin}% &c&lFactions saved database has been deleted."
- delete directory "plugins/Factions/Factions"
- delete file "plugins/Factions/Factions.yml"
- else:
- send "%{_padmin}% &7Use '/{@command} admin reset <all;(chunks;territories);userdata;factions' to remove specific or all saved database."
- if arg 2 is "claim":
- set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of player%.yml"
- if arg 3 is set:
- if arg 3 is "Shop":
- if {_t} is not set:
- set yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of player%.yml" to "(Safe) Shop"
- message "%{_padmin}% &aClaimed Territory &f(&bSafe&f) &bShop Spawn&7."
- else:
- if {_t} is equal to "(Safe) Shop":
- message "%{_padmin}% &7This Territory is already claimed by you!"
- else:
- message "%{_padmin}% &7This Territory is already claimed!"
- if arg 3 is "Spawn":
- if {_t} is not set:
- set yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of player%.yml" to "(Safe) Spawn"
- message "%{_padmin}% &aClaimed Territory &f(&bSafe&f) &bSpawn&7."
- else:
- if {_t} is equal to "(Safe) Spawn":
- message "%{_padmin}% &7This Territory is already claimed by you!"
- else:
- message "%{_padmin}% &7This Territory is already claimed!"
- if arg 3 is not "Spawn" or "Shop":
- message "%{_padmin}% &7Use '/{@command} admin claim &b<Shop;Spawn>&7' &7to claim this territory!"
- else:
- message "%{_padmin}% &7Use '/{@command} admin claim &b<Shop;Spawn>&7' &7to claim this territory!"
- if arg 2 is "unclaim":
- set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of player%.yml"
- if arg 3 is set:
- if arg 3 is "Shop":
- if {_t} is set:
- if {_t} is equal to "(Safe) Shop":
- delete yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of player%.yml"
- message "%{_padmin}% &cRemoved Successfully &f(&bSafe&f) &bShop&7."
- else:
- if {_t} isn't equal to "(Safe) Spawn" or "(Safe) Shop":
- message "%{_padmin}% &7This Territory is not claimed by you!"
- if {_t} is equal to "(Safe) Spawn" or "(Safe) Shop":
- message "&7You must use the correct arguments: '/{@command} admin unclaim &c<Shop;Spawn>'"
- else:
- message "%{_padmin}% &7This Territory is not claimed!"
- if arg 3 is "Spawn":
- if {_t} is set:
- if {_t} is equal to "(Safe) Spawn":
- delete yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of player%.yml"
- message "%{_padmin}% &cRemoved Successfully &f(&bSafe&f) &bSpawn&7."
- else:
- if {_t} isn't equal to "(Safe) Spawn" or "(Safe) Shop":
- message "%{_padmin}% &7This Territory is not claimed by you!"
- if {_t} is equal to "(Safe) Spawn" or "(Safe) Shop":
- message "%{_padmin}% &7You must use the correct arguments: '/{@command} admin unclaim &c<Shop;Spawn>'"
- else:
- message "%{_padmin}% &7This Territory is not claimed!"
- if arg 3 is not "Spawn" or "Shop":
- message "%{_padmin}% &7Use '/{@command} admin unclaim &b<Shop;Spawn>&7' &7to un-claim this territory!"
- else:
- message "%{_padmin}% &7Use '/{@command} admin unclaim &b<Shop;Spawn>&7' &7to un-claim this territory!"
- else:
- message "{@noperm}"
- if arg 1 is "reload":
- if player has permission "{@perm1}":
- send "%{_prefix}% &7Reloading Clans..." to player
- wait 1 second
- execute console command "/sk reload %script%"
- send "%{_prefix}% &aClans has been successfully Reloaded!" to player
- else:
- message "{@noperm}"
- if arg 1 is "invite":
- if player has permission "clan.invite" or "{@perm1}" or "clan.use.*":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- set {_p::*} to yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
- if {_r} is "Leader" or "Officer":
- if arg 2 is set:
- if arg 2 is online:
- set {_player} to arg 2
- set {_player} to {_player} parsed as offline player
- if {_player} is not equal to player:
- set {_c2} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
- if {_c2} isn't set:
- set {_max} to yaml value "maxplayers" from "../../Factions/config.yml"
- if size of {_p::*} is not {_max}:
- set {clan.%{_c}%.invite.%arg 2%} to true
- send "%{_prefix}% &7%player% is inviting you to join {@p} &6%{_c}%&7." to arg 2
- send "%{_prefix}% &7Use /{@command} join &6%{_c}% &7to accept." to arg 2
- message "%{_prefix}% &7You invited &6%arg 2% &7to join your {@p}."
- loop all players:
- set {_c3.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c3.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &6%player% &7has invited &6%arg 2% &7to join the {@p}!" to loop-player
- wait 1 minute
- if {clan.%{_c}%.invite.%arg 2%} is set:
- delete {clan.%{_c}%.invite.%arg 2%}
- send "%{_prefix}% &6%arg 2% &7didn't respond to your request to join."
- send "%{_prefix}% &7You didn't respond to join {@p} &6%{_c}%&7." to arg 2
- else:
- message "%{_prefix}% &7You can't invite more than &7%{_max}% &7players to your {@p}."
- else:
- if {_c2} is not equal to {_c}:
- message "%{_prefix}% &6%arg 2% &7is already in &6%{_c2}%&7's {@p} and can't be invited."
- if {_c2} is equal to {_c}:
- message "%{_prefix}% &6%arg 2% &7is already in your {@p}."
- else:
- message "%{_prefix}% &7Not you!"
- else:
- message "&8[&9Online Player Search&8] &7No matches found for [&6%arg 2%&7]."
- message "%{_prefix}% &6%arg 2% &7is not online! Try again later!"
- else:
- message "%{_prefix}% &7Use '/{@command} invite <player>' to invite the player to your {@p}."
- else:
- message "%{_prefix}% &7You must be the {@p}'s &6Officer &7or &6Leader &7to do that!"
- else:
- message "%{_prefix}% &7You're not in any {@p}."
- else:
- message "{@noperm}"
- if arg 1 is "ally":
- if player has permission "clan.ally" or "{@perm1}" or "clan.use.*":
- if arg 2 is "invite" or "accept":
- if arg 2 is "invite":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
- if {_r} is "Leader" or "Officer":
- if arg 3 is set:
- if arg 3 isn't equal to "%{_c}%":
- set {_clans::*} to yaml list "Factions" from "../../Factions/Factions.yml"
- set {_confirm1} to false
- loop {_clans::*}:
- if arg 3 is loop-value:
- set {_confirm1} to true
- if {_confirm1} is true:
- set {_confirm1} to false
- loop {_a::*}:
- if arg 3 is loop-value:
- set {_confirm1} to true
- if {_confirm1} is false:
- set {_max} to yaml value "maxallies" from "../../Factions/config.yml"
- if size of {_a::*} is not {_max}:
- if {clan.%{_c}%.ally.%arg 3%} is not set:
- set {clan.%{_c}%.ally.%arg 3%} to true
- loop all players:
- set {_c3.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c3.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &7Your {@p} has invited &7{@p} &6%arg 3% &7to ally!" to loop-player
- loop all players:
- set {_c4.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c4.%loop-player%} is equal to "%arg 3%":
- send "%{_prefix}% &7{@p} &6%{_c}% &7has invited your {@p} to ally! Use '/{@command} ally accept &6%{_c}%&7' to accept." to loop-player
- wait 1 minute
- if {clan.%{_c}%.ally.%arg 3%} is true:
- delete {clan.%{_c}%.ally.%arg 3%}
- loop all players:
- set {_c3.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c3.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &7{@p} &6%arg 3% &7didn't respond to your ally request." to loop-player
- loop all players:
- set {_c4.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c4.%loop-player%} is equal to "%arg 3%":
- send "%{_prefix}% &7Your {@p} didn't respond to &6%arg 3%&7's {@p} ally request." to loop-player
- else:
- send "%{_prefix}% &7You can't invite that {@p} for 1 Minute."
- else:
- message "%{_prefix}% &7Your {@p} can't have more than %{_max}% allies!"
- else:
- message "%{_prefix}% &7{@p} &a%arg 3% &7is already your ally."
- else:
- message "%{_prefix}% &6%arg 3% &7couldn't be found. Make sure to specify the {@p}'s name correctly."
- else:
- send "%{_prefix}% &7You don't ally your {@p}."
- else:
- send "%{_prefix}% &7Use '/{@command} ally invite <{@p} name>' to send an ally request to a {@p}."
- else:
- send "%{_prefix}% &7You must be the {@p}'s &6Officer &7or &6Leader &7to do that!"
- else:
- send "%{_prefix}% &7You're not in any {@p}."
- if arg 2 is "accept":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
- if {_r} is "Leader" or "Officer":
- if arg 3 is set:
- if arg 3 isn't equal to "%{_c}%":
- set {_clans::*} to yaml list "Factions" from "../../Factions/Factions.yml"
- set {_confirm1} to false
- loop {_clans::*}:
- if arg 3 is loop-value:
- set {_confirm1} to true
- if {_confirm1} is true:
- set {_confirm1} to false
- loop {_a::*}:
- if arg 3 is loop-value:
- set {_confirm1} to true
- if {_confirm1} is false:
- set {_max} to yaml value "maxallies" from "../../Factions/config.yml"
- if size of {_a::*} is not {_max}:
- if {clan.%arg 3%.ally.%{_c}%} is true:
- delete {clan.%arg 3%.ally.%{_c}%}
- loop all players:
- set {_c3.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c3.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &7Your {@p} has accepted ally with &a%arg 3%&7!" to loop-player
- loop all players:
- set {_c4.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c4.%loop-player%} is equal to "%arg 3%":
- send "%{_prefix}% &7{@p} &a%{_c}% &7has accepted your ally request!" to loop-player
- add "%{_c}%" to yaml list "Faction.Allies" from "../../Factions/Factions/%arg 3%.yml"
- add "%arg 3%" to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
- else:
- send "%{_prefix}% &7Your {@p} doesn't have any pending ally request from {@p} &6%arg 3%&7."
- else:
- message "%{_prefix}% &7Your {@p} can't have more than %{_max}% allies!"
- else:
- message "%{_prefix}% &7{@p} &a%arg 3% &7is already your ally."
- else:
- message "%{_prefix}% &6%arg 3% &7couldn't be found. Make sure to specify the {@p}'s name correctly."
- else:
- send "%{_prefix}% &7You don't ally your {@p}."
- else:
- send "%{_prefix}% &7Use '/{@command} ally accept <{@p} name>' to accept an ally request from a {@p}."
- else:
- send "%{_prefix}% &7You must be the {@p}'s &6Officer &7or &6Leader &7to do that!"
- else:
- send "%{_prefix}% &7You're not in any {@p}."
- else:
- send "%{_prefix}% &7Use '/{@command} ally <invite;accept> <{@p} name>' to send/accept an ally request to a {@p}."
- else:
- message "{@noperm}"
- if arg 1 is "neutral" or "revoke" or "enemy":
- if player has permission "clan.ally" or "{@perm1}" or "clan.use.*":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%"
- if {_r} is "Leader" or "Officer":
- if arg 2 is set:
- if arg 2 isn't a player:
- if arg 2 isn't equal to "%{_c}%":
- set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
- set {_confirm1} to false
- loop {_a::*}:
- if arg 2 is loop-value:
- set {_confirm1} to true
- if {_confirm1} is true:
- loop all players:
- set {_c3.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c3.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &7Your {@p} has revoked ally with &6%arg 2%&7!" to loop-player
- loop all players:
- set {_c4.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c4.%loop-player%} is equal to "%arg 2%":
- send "%{_prefix}% &7{@p} &6%{_c}% &7has revoked ally with your {@p}!" to loop-player
- remove "%arg 2%" from yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
- remove "%{_c}%" from yaml list "Faction.Allies" from "../../Factions/Factions/%arg 2%.yml"
- else:
- message "%{_prefix}% &7{@p} &6%arg 2% &7is not ally with your {@p}."
- else:
- send "%{_prefix}% &7Not your {@p}."
- else:
- message "%{_prefix}% &7Make sure to specify a {@p}'s name, not player's name"
- else:
- send "%{_prefix}% &7Use '/{@command} <neutral;enemy;revoke> <{@p} name>' to revoke ally with a {@p}."
- else:
- send "%{_prefix}% &7You must be the {@p}'s &6Officer &7or &6Leader &7to do that!"
- else:
- send "%{_prefix}% &7You're not in any {@p}."
- else:
- message "{@noperm}"
- if arg 1 is "__invite__":
- if player has permission "clan.use.*" or "{@perm1}" or "clan.invite":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_r} is "Leader" or "Officer":
- wait 3 tick
- open chest with 6 rows named "Select a player to invite!" to player
- format slot 0 of player with arrow named "&6<&m--&6 &6Go Back" to close then run [make player execute command "/{@command}"]
- set {_number} to 9
- loop all players:
- set {_c.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c.%loop-player%} isn't set:
- set {_player} to loop-player
- format slot {_number} of player with skull of {_player} named "&6%{_player}%" with lore "&7Click to invite %{_player}%." to close then run [make player execute command "/{@command} invite %{_player}%"]
- add 1 to {_number}
- else:
- message "%{_prefix}% &7You must be the {@p}'s &6Admin &7or &6Leader &7to do that!"
- else:
- message "%{_prefix}% &7You're not in any {@p}."
- else:
- message "{@noperm}"
- if arg 1 is "energy":
- if player has permission "clan.use.*" or "{@perm1}" or "clan.energy":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_p::*} to yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
- set {_p} to size of {_p::*}
- set {_t::*} to yaml list "Faction.Territory" from "../../Factions/Factions/%{_c}%.yml"
- set {_t} to size of {_t::*}
- set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml"
- set {_e} to {_e} parsed as number
- if {_e} is not set:
- set {_e} to 0
- open chest with 2 rows named "Purchase Energy" to player
- format slot 4 of player with iron chestplate named "&7" with lore "&7Coins: &6%player's balance%||&7Energy Left: &6%{_e}% Day(s)" to be unstealable
- set {_bal1} to 0
- set {_bal2} to 0
- set {_bal3} to 0
- loop {_p} times:
- add 250 to {_bal1}
- add 500 to {_bal2}
- add 1000 to {_bal3}
- loop {_t} times:
- add 50 to {_bal1}
- add 100 to {_bal2}
- add 200 to {_bal3}
- set {_el} to 7
- reduce {_el} by {_e}
- if {_e} <= 6.9:
- if player's balance >= {_bal1}:
- format slot 12 of player with iron block named "&aPurchase 2.4 Hours of Energy" with lore "||&7Costs: &6%{_bal1}%$||&c||&7This will add 2.4 Hours of energy for your {@p}!" to close then run [PurchaseEnergy(player, {_c}, {_e}, 0.1)]
- else:
- format slot 12 of player with iron block named "&cPurchase 2.4 Hours of Energy" with lore "&cYou don't have enough money to purchase this!||&7Costs: &6%{_bal1}%$||&c||&7This will add 2.4 Hours of energy for your {@p}!" to be unstealable
- else:
- format slot 12 of player with iron block named "&cPurchase 2.4 Hours of Energy" with lore "&cYour {@p} Energy is full!||&7Costs: &60$||&c||&7This will add 2.4 Hours of energy for your {@p}!" to be unstealable
- if {_e} <= 6:
- if player's balance >= {_bal2}:
- format slot 13 of player with gold block named "&aPurchase 1 Day of Energy" with lore "||&7Costs: &6%{_bal2}%$||&c||&7This will add 1 Day of energy for your {@p}!" to close then run [PurchaseEnergy(player, {_c}, {_e}, 1)]
- else:
- format slot 13 of player with gold block named "&cPurchase 1 Day of Energy" with lore "&cYou don't have enough money to purchase this!||&7Costs: &6%{_bal2}%$||&c||&7This will add 1 Day of energy for your {@p}!" to be unstealable
- else:
- format slot 13 of player with gold block named "&cPurchase 1 Day of Energy" with lore "&cYour {@p} Energy is full!||&7Costs: &60$||&c||&7This will add 1 Day of energy for your {@p}!" to be unstealable
- if {_e} < 7:
- if player's balance >= {_bal3}:
- format slot 14 of player with diamond block named "&aPurchase Full Energy of %{_el}% Day(s)" with lore "||&7Costs: &6%{_bal3}%$||&c||&7This will max out your {@p}'s energy!" to close then run [PurchaseEnergy(player, {_c}, {_e}, {_el})]
- else:
- format slot 14 of player with diamond block named "&cPurchase Full Energy of %{_el}% Day(s)" with lore "&cYou don't have enough money to purchase this!||&7Costs: &6%{_bal3}%$||&c||&7This will max out your {@p}'s energy!" to be unstealable
- else:
- format slot 14 of player with diamond block named "&cPurchase Full Energy of %{_el}% Days(s)" with lore "&cYour {@p} Energy is full!||&7Costs: &60$||&c||&7This will max out your {@p}'s energy!" to be unstealable
- else:
- message "%{_prefix}% &7You're not in any {@p}."
- else:
- message "{@noperm}"
- if arg 1 is "join":
- if player has permission "clan.join" or "{@perm1}" or "clan.use.*":
- if arg 2 is set:
- if arg 2 is not equal to player:
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is not set:
- set {_c::*} to yaml list "Factions" from "../../Factions/Factions.yml"
- set {_confirm} to false
- loop {_c::*}:
- if arg 2 is loop-value:
- set {_confirm} to true
- set {_c} to loop-value
- if {_confirm} is false:
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
- if {_c} is not set:
- send "%{_prefix}% &7No matches found for &6%arg 2%&7."
- stop
- else:
- set {_confirm} to true
- if {_confirm} is true:
- if {clan.%{_c}%.invite.%player%} is true:
- set {_players::*} to yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
- set {_max} to yaml value "maxplayers" from "../../Factions/config.yml"
- if size of {_players::*} is not {_max}:
- set player tab name to "&6%{_c}% &e%player%"
- delete {clan.%{_c}%.invite.%player%}
- delete yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- delete yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- add "%player%" to yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
- add "%uuid of player%" to yaml list "Faction.UUID" from "../../Factions/Factions/%{_c}%.yml"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml" to "Member"
- set yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml" to "%{_c}%"
- set yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml" to "Public"
- set yaml value "Userdata.Username" from "../../Factions/Userdata/%uuid of player%.yml" to "%player%"
- set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml"
- set {_e} to {_e} parsed as number
- if {_e} <= 7:
- remove 0.1 from {_e}
- if {_e} <= 0:
- set {_e} to 0
- set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml" to "%{_e}%"
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &6%player% &7has joined your {@p}!" to loop-player
- send "%{_prefix}% &7You have joined {@p} &b%{_c}%&7!"
- else:
- send "%{_prefix}% &7The {@p} is Full. Please try again later."
- else:
- message "%{_prefix}% &7You have no pending request from &6%arg 2%&7."
- else:
- message "%{_prefix}% &7You must leave your {@p} before you join &6%{_c}%&7."
- else:
- send "%{_prefix}% &7Not you!"
- else:
- message "%{_prefix}% &7Use /{@command} join <player> to join the {@p}."
- else:
- message "{@noperm}"
- if arg 1 is "deinvite":
- if player has permission "clan.deinvite" or "{@perm1}" or "clan.use.*":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_c2} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_r} is "Leader" or "Officer":
- if arg 2 is set:
- if arg 2 is not player:
- if {clan.%player%.invite.%arg 2%} is true:
- if {_c2} is not set:
- delete {clan.%player%.invite.%arg 2%}
- message "%{_prefix}% &6%arg 2% &7is no longer invited to your {@p}."
- send "%{_prefix}% &7You're no longer invited to &6%{_c}% {@p}." to arg 2
- else:
- if {_c2} is equal to "%{_c}%":
- send "%{_prefix}% &6%arg 2% &7is already in your {@p},"
- else:
- send "%{_prefix}% &6%arg 2% &7is already in another {@p}."
- else:
- send "%{_prefix}% &6%arg 2% &7is not invited to your {@p}."
- else:
- send "%{_prefix}% &7Wanna deinvite yourself from your {@p}?"
- else:
- message "%{_prefix}% &7Use '/{@command} deinvite <player>' to cancel the player's invite."
- else:
- message "%{_prefix}% &7You must be the {@p}'s &6Leader &7to do that!"
- else:
- message "%{_prefix}% &7You're not in any {@p}."
- else:
- message "{@noperm}"
- if arg 1 is "kick":
- if player has permission "clan.kick" or "{@perm1}" or "clan.use.*":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_r} is "Leader" or "Officer":
- if arg 2 is set:
- if arg 2 is not player:
- set {_c2} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
- set {_r2} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml"
- if {_c2} is equal to {_c}:
- if {_r} is "Leader":
- set player tab name to "&e%player%"
- remove "%arg 2%" from yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
- remove "%uuid of arg 2%" from yaml list "Faction.UUID" from "../../Factions/Factions/%{_c}%.yml"
- send "%{_prefix}% &7You were kicked from &6%{_c}%&7's {@p}." to arg 2
- set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c2}%.yml"
- set {_e} to {_e} parsed as number
- if {_e} < 7:
- add 0.1 to {_e}
- if {_e} >= 7:
- set {_e} to 7
- set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c2}%.yml" to "%{_e}%"
- delete {_c2}
- delete {_r2}
- delete yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
- delete yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml"
- message "%{_prefix}% &7You kicked &6%arg 2% &7from your {@p}."
- set {_p::*} to yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
- set {_p::*} to {_p}
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &6%arg 2% &7was kicked from the {@p}!" to loop-player
- stop
- if {_r} is "Officer":
- if {_r2} isn't "Leader" or "Officer":
- set player tab name to "&e%player%"
- remove "%arg 2%" from yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
- remove "%uuid of arg 2%" from yaml list "Faction.UUID" from "../../Factions/Factions/%{_c}%.yml"
- send "%{_prefix}% &7You were kicked from &6%{_c}%&7's {@p}." to arg 2
- set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c2}%"
- set {_e} to {_e} parsed as number
- if {_e} < 7:
- add 0.1 to {_e}
- if {_e} >= 7:
- set {_e} to 7
- set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c2}%" to "%{_e}%"
- delete {_c2}
- delete {_r2}
- delete yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
- delete yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml"
- message "%{_prefix}% &7You kicked &6%arg 2% &7from your {@p}."
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &6%arg 2% &7was kicked from the {@p}!" to loop-player
- else:
- message "%{_prefix}% &6%arg 2% &7can't be kicked from the {@p}."
- else:
- message "%{_prefix}% &6%arg 2% &7is not in your {@p}."
- else:
- message "%{_prefix}% &7You can't kick yourself from your {@p}."
- else:
- message "%{_prefix}% &7Use '/{@command} kick <player>' to kick the player from your {@p}."
- else:
- message "%{_prefix}% &7You must be the {@p}'s &6Leader &7or &6Officer &7to do that!"
- else:
- message "%{_prefix}% &7You're not in any {@p}."
- else:
- message "{@noperm}"
- if arg 1 is "leave":
- if player has permission "clan.leave" or "{@perm1}" or "clan.use.*":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_r} is "Leader":
- message "%{_prefix}% &7You can't leave your own {@p}. You must disband it with '/c disband'"
- else:
- message "%{_prefix}% &7You left the {@p}."
- set player tab name to "&e%player%"
- remove "%player%" from yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
- remove "%uuid of player%" from yaml list "Faction.UUID" from "../../Factions/Factions/%{_c}%.yml"
- set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml"
- set {_e} to {_e} parsed as number
- if {_e} < 7:
- add 0.1 to {_e}
- if {_e} >= 7:
- set {_e} to 7
- set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml" to "%{_e}%"
- delete yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- delete yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &6%player% &7has left the {@p}!" to loop-player
- else:
- message "%{_prefix}% &7You're not in any {@p}."
- else:
- message "{@noperm}"
- if arg 1 is "disband":
- if player has permission "clan.disband" or "{@perm1}" or "clan.use.*":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_r} is "Leader":
- set {_u::*} to yaml list "Faction.UUID" from "../../Factions/Factions/%{_c}%.yml"
- set {_p::*} to yaml list "Faction.Players" from "../../Factions/Factions/%{_c}%.yml"
- set {_t::*} to yaml list "Faction.Territory" from "../../Factions/Factions/%{_c}%.yml"
- set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
- loop all players:
- set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_p.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &7Your {@p} &b%{_c}% &7has been disbanded." to loop-player
- set loop-player tab name to "&e%loop-player%"
- loop {_t::*}:
- set {_loop} to loop-value
- delete yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_loop}%.yml"
- loop {_u::*}:
- set {_loop2} to loop-value
- delete yaml value "Userdata.Faction" from "../../Factions/Userdata/%{_loop2}%.yml"
- delete yaml value "Userdata.Rank" from "../../Factions/Userdata/%{_loop2}%.yml"
- loop {_a::*}:
- set {_loop3} to loop-value
- remove "%{_c}%" from yaml list "Faction.Allies" from "../../Factions/Factions/%{_loop3}%.yml"
- delete file "plugins/Factions/Factions/%{_c}%.yml"
- remove "%{_c}%" from yaml list "Factions" from "../../Factions/Factions.yml"
- else:
- message "%{_prefix}% &7You must be the {@p}'s &6Leader &7to do that!"
- else:
- message "%{_prefix}% &7You're not in any {@p}."
- else:
- message "{@noperm}"
- if arg 1 is "create":
- if player has permission "clan.create" or "{@perm1}" or "clan.use.*":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is not set:
- if arg 2 is set:
- set {_new} to false
- set {_f::*} to yaml list "Factions" from "../../Factions/Factions.yml"
- loop {_f::*}:
- if arg 2 is loop-value:
- set {_new} to true
- if {_new} is true:
- send "%{_prefix}% &7{@p} name &6%arg 2% &7is already exist. Please try other name!"
- delete {_new}
- stop
- if {_new} is false:
- set {_c2} to arg 2
- set {_c2} to {_c2} parsed as text
- set player tab name to "&6%{_c2}% &e%player%"
- add "%arg 2%" to yaml list "Factions" from "../../Factions/Factions.yml"
- add "%player%" to yaml list "Faction.Players" from "../../Factions/Factions/%{_c2}%.yml"
- add "%uuid of player%" to yaml list "Faction.UUID" from "../../Factions/Factions/%{_c2}%.yml"
- set yaml value "Faction.Founder" from "../../Factions/Factions/%{_c2}%.yml" to "%player%"
- set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c2}%.yml" to "1"
- set yaml value "Faction.Date" from "../../Factions/Factions/%{_c2}%.yml" to "%now%"
- set yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml" to "Public"
- set yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml" to "%{_c2}%"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml" to "Leader"
- set yaml value "Userdata.Username" from "../../Factions/Userdata/%uuid of player%.yml" to "%player%"
- send "%{_prefix}% &7You created &b%arg 2%&7."
- else:
- message "%{_prefix}% &7Use '/{@command} create <{@p} Name>' to create your {@p}." to player
- else:
- message "%{_prefix}% &7You can't create a {@p} while being in another one." to player
- else:
- message "{@noperm}"
- if arg 1 is "info" or "show" or "stats":
- if player has permission "clan.use" or "{@perm1}" or "clan.use.*":
- if arg 2 is set:
- set {_confirm} to false
- if arg 2 is online:
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
- set {_clans::*} to yaml list "Factions" from "../../Factions/Factions.yml"
- loop {_clans::*}:
- if {_c} is loop-value:
- set {_confirm} to true
- set {_clan} to loop-value
- send "%{_prefix}% &7Loading info of player &6%arg 2%&7..."
- if arg 2 is offline:
- if {_confirm} is false:
- set {_clans::*} to yaml list "Factions" from "../../Factions/Factions.yml"
- loop {_clans::*}:
- if arg 2 is loop-value:
- set {_confirm} to true
- set {_clan} to loop-value
- send "%{_prefix}% &7Loading info of {@p} &6%arg 2%&7..."
- if {_confirm} is true:
- set {_t::*} to yaml list "Faction.Territory" from "../../Factions/Factions/%{_clan}%.yml"
- set {_ts} to size of {_t::*}
- set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_clan}%.yml"
- set {_e} to {_e} parsed as number
- if {_e} is not set:
- set {_e} to 0
- set {_s::*} to yaml list "Faction.UUID" from "../../Factions/Factions/%{_clan}%.yml"
- set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_clan}%.yml"
- if {_a::*} is not set:
- set {_a::*} to "&a"
- set {_f} to yaml value "Faction.Founder" from "../../Factions/Factions/%{_clan}%.yml"
- set {_s} to size of {_s::*}
- set {_h} to yaml value "Faction.Home" from "../../Factions/Factions/%{_clan}%.yml"
- set {_d} to yaml value "Faction.Date" from "../../Factions/Factions/%{_clan}%.yml"
- if {_d} is not set:
- set {_d} to "Unknown"
- if {_f} is not set:
- set {_f} to "Unknown"
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_wp} to yaml value "Faction.WarPoints.%{_clan}%" from "../../Factions/Factions/%{_c}%.yml"
- if {_clan} is equal to {_c}:
- set {_wp} to "--"
- else:
- if {_wp} is not set:
- set {_wp} to 0
- else:
- set {_wp} to "You're not in any {@p}."
- wait 3 ticks
- open chest with 4 rows named "{@p} Info - %{_clan}%" to player
- set {_max} to yaml value "maxplayers" from "../../Factions/config.yml"
- set {_max2} to yaml value "maxterritories" from "../../Factions/config.yml"
- if {_h} is set:
- set {_x} to x-coordinate of {_h}
- set {_y} to y-coordinate of {_h}
- set {_z} to z-coordinate of {_h}
- format slot 4 of player with paper named "&6%{_clan}%&7's Stats:" with lore "&b&n{@p} Info:||&7||&eFounder &f%{_f}%||&eCreated &f%{_d}%||&e{@p} Players &f%{_s}%/%{_max}%||&eHome Location &f%{_x}%, %{_y}%, %{_z}%||&eTerritories Claimed &f%{_ts}%/%{_max2}%||&eEnergy Left &f%{_e}% Day(s)||&eWar Points &f%{_wp}%||&eAllies &a%{_a::*}%" to be unstealable
- if {_h} isn't set:
- format slot 4 of player with paper named "&6%{_clan}%&7's Stats:" with lore "&b&n{@p} Info:||&7||&eFounder &f%{_f}%||&eCreated &f%{_d}%||&e{@p} Players &f%{_s}%/%{_max}%||&eHome Location &cNo Home Set.||&eTerritories Claimed &f%{_ts}%/%{_max2}%||&eEnergy Left &f%{_e}% Day(s)||&eWar Points &f%{_wp}%||&eAllies &a%{_a::*}%" to be unstealable
- set {_number} to 18
- loop {_s::*}:
- set {_uuid} to loop-value
- set {_player} to yaml value "Userdata.Username" from "../../Factions/Userdata/%{_uuid}%.yml"
- set {_player} to {_player} parsed as a player
- if {_player} is online:
- set {_name} to "&a&l%{_player}%"
- set {_skull} to {_player}'s skull
- else:
- set {_name} to "&c&l%{_player}%"
- set {_skull} to skeleton head
- set {_name} to coloured {_name}
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%{_uuid}%.yml"
- format slot {_number} of player with {_skull} named "%{_name}%" with lore "&a||&7Rank: &6%{_r}%" to be unstealable
- add 1 to {_number}
- else:
- send "%{_prefix}% &7No {@p} or player matches found for [&e%arg 2%&7]. Make sure to specify correct the {@p}'s or player's name."
- stop
- else:
- send "%{_prefix}% &7Use '/c <info;show;stats> <player/{@p}>' to view {@p}'s information."
- else:
- message "{@noperm}"
- if arg 1 is "chat":
- if player has permission "clan.use" or "{@perm1}" or "clan.use.*":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_chat} to yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_chat} is not set:
- set yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml" to "Public"
- if {_chat} is "Public":
- message "%{_prefix}% &7Chat: &bFaction Chat&7."
- set yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml" to "Clan"
- stop
- if {_chat} is "Clan":
- message "%{_prefix}% &7Chat: &aAlly Chat&7."
- set yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml" to "Ally"
- stop
- if {_chat} is "Ally":
- message "%{_prefix}% &7Chat: &ePublic Chat&7."
- set yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml" to "Public"
- stop
- else:
- message "%{_prefix}% &7You must have a {@p} to do that!"
- else:
- message "{@noperm}"
- if arg 1 is "clans" or "factions":
- if player has permission "clan.use" or "{@perm1}" or "clan.use.*":
- message "&6&l{@p} List:"
- set {_list::*} to yaml list "Factions" from "../../Factions/Factions.yml"
- if {_list::*} is set:
- set {_n} to 0
- loop {_list::*}:
- add 1 to {_n}
- message "&7- &a%{_n}% &b%loop-value%"
- else:
- message "&7There is no {@p}! Use '/{@command} create <name>' to create one."
- else:
- message "{@noperm}"
- if arg 1 is "sethome":
- if player has permission "clan.home" or "{@perm1}" or "clan.use.*":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_r} is "Leader" or "Officer":
- set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of player%.yml"
- if {_t} is set:
- if {_t} is equal to "%{_c}%":
- teleport player to location of block at player
- set yaml value "Faction.Home" from "../../Factions/Factions/%{_c}%.yml" to location of block at player
- set block at player to bed
- set {_b} to block west player
- if {_b} is bed:
- set yaml value "Faction.Home2" from "../../Factions/Factions/%{_c}%.yml" to location of block west block at player
- set {_b} to block east player
- if {_b} is bed:
- set yaml value "Faction.Home2" from "../../Factions/Factions/%{_c}%.yml" to location of block east block at player
- set {_b} to block north player
- if {_b} is bed:
- set yaml value "Faction.Home2" from "../../Factions/Factions/%{_c}%.yml" to location of block north block at player
- set {_b} to block south player
- if {_b} is bed:
- set yaml value "Faction.Home2" from "../../Factions/Factions/%{_c}%.yml" to location of block south block at player
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &6%player% &7has set {@p} Home at &b%x-coordinate of player's location%, %y-coordinate of player's location%, %z-coordinate of player's location%&7. Use '/c home' to warp to your Clan Home!" to loop-player
- send player title "&7Home set!" with subtitle "&aUse /{@command} home to teleport." for 2 seconds
- else:
- send "%{_prefix}% &7You can't set your {@p} home at &6%{_t}%&7's Territory."
- else:
- message "%{_prefix}% &7You must claim this territory first, before you set your home. Please use '/{@command} claim'."
- else:
- message "%{_prefix}% &7You must be the {@p}'s &6Officer &7or &6Leader &7to do that!"
- stop
- else:
- message "%{_prefix}% &7You're not in any {@p}."
- stop
- else:
- message "{@noperm}"
- stop
- if arg 1 is "home":
- if player has permission "clan.home" or "{@perm1}" or "clan.use.*":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- set {_h} to yaml value "Faction.Home" from "../../Factions/Factions/%{_c}%.yml"
- if {_h} is set:
- set {_ct} to yaml value "countdown-home" from "../../Factions/config.yml"
- set {_loc} to the player's location
- while {_ct} > 0:
- if distance between {_loc} and player's location < 0.1:
- if {_ct} doesn't contain .1 or .2 or .3 or .4 or .5 or .6 or .7 or .8 or .9:
- set {_ct} to "%{_ct}%.0"
- set {_ct} to {_ct} parsed as number
- send player title "" with subtitle "Teleporting to {@p} Home in &a%{_ct}% &aSeconds" for 0.2 second with 0 seconds fade in and 0 seconds fade out
- wait 0.1 second
- remove 0.1 from {_ct}
- else:
- send "%{_prefix}% &7Teleport has been cancelled due to your movement."
- stop
- if distance between {_loc} and player's location < 0.1:
- teleport player to {_h}
- send player title "" with subtitle "&aTeleported you to your {@p} Home!" for 1 second
- stop
- else:
- if {_r} is "Leader" or "Officer":
- message "%{_prefix}% &7Home is not set. Use '/{@command} sethome' to set it."
- if {_r} is "Member" or "Trusted":
- message "%{_prefix}% &7Your {@p} doesn't have any Home."
- else:
- message "%{_prefix}% &7You're not in any {@p}."
- stop
- else:
- message "{@noperm}"
- if arg 1 is "promote":
- if player has permission "clan.promote" or "{@perm1}" or "clan.use.*":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- if arg 2 is set:
- set {_c2} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
- set {_r2} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml"
- if {_r} is "Officer":
- if arg 2 is not player:
- if {_c} is equal to {_c2}:
- if {_r2} is "Member":
- set {_r2} to "Trusted"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml" to "%{_r2}%"
- message "%{_prefix}% &7You promoted &6%arg 2% &7to &6%{_r2}%&7."
- send "%{_prefix}% &7You were promoted to &6%{_r2}%&7." to arg 2
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &6%arg 2% &7has been promoted to &6%{_r2}%&7!" to loop-player
- stop
- if {_r2} is "Trusted":
- set {_r2} to "Officer"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml" to "%{_r2}%"
- message "%{_prefix}% &7You promoted &6%arg 2% &7to &6%{_r2}%&7."
- send "%{_prefix}% &7You were promoted to &6%{_r2}%&7." to arg 2
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &6%arg 2% &7has been promoted to &6%{_r2}%&7!" to loop-player
- stop
- if {_r2} is "Officer" or "Leader":
- send "%{_prefix}% &7You can't change {@p} ranks to &6%arg 2%&7!"
- else:
- message "%{_prefix}% &6%arg 2% &7is not in your {@p}."
- else:
- message "%{_prefix}% &7You can't promote yourself."
- if {_r} is "Leader":
- if arg 2 is not player:
- if {_c} is equal to {_c2}:
- if {_r2} is "Member":
- set {_r2} to "Trusted"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml" to "%{_r2}%"
- message "%{_prefix}% &7You promoted &6%arg 2% &7to &6%{_r2}%&7."
- send "%{_prefix}% &7You were promoted to &6%{_r2}%&7." to arg 2
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &6%arg 2% &7has been promoted to &6%{_r2}%&7!" to loop-player
- stop
- if {_r2} is "Trusted":
- set {_r2} to "Officer"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml" to "%{_r2}%"
- message "%{_prefix}% &7You promoted &6%arg 2% &7to &6%{_r2}%&7."
- send "%{_prefix}% &7You were promoted to &6%{_r2}%&7." to arg 2
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &6%arg 2% &7has been promoted to &6%{_r2}%&7!" to loop-player
- stop
- if {_r2} is "Officer":
- set {_r2} to "Leader"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml" to "%{_r2}%"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml" to "Officer"
- message "%{_prefix}% &7You promoted &6%arg 2% &7to &6%{_r2}%&7."
- send "%{_prefix}% &7You were promoted to &6%{_r2}%&7." to arg 2
- send "%{_prefix}% &7You were demoted to &6Officer&7." to player
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &6%arg 2% &7has been promoted to &6%{_r2}%&7!" to loop-player
- stop
- if {_r2} is "Leader":
- send "%{_prefix}% &6%arg 2% &7can't be promoted higher than &6%{_r2}%&7."
- stop
- else:
- message "%{_prefix}% &6%arg 2% &7is not in your {@p}."
- else:
- message "%{_prefix}% &7You can't promote yourself."
- if {_r} is "Member" or "Recruit+" or "Recruit":
- send "%{_prefix}% &7You must be the {@p}'s &6Leader &7or &6Officer &7to do that!"
- else:
- message "%{_prefix}% &7Use '/{@command} promote <player>' to promote the player."
- else:
- message "%{_prefix}% &7You're not in any {@p}."
- else:
- message "{@noperm}"
- if arg 1 is "demote":
- if player has permission "clan.demote" or "{@perm1}" or "clan.use.*":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- set {_c2} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of arg 2%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- if arg 2 is set:
- set {_r2} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml"
- if {_r} is "Leader":
- if arg 2 is not player:
- if {_c} is equal to {_c2}:
- if {_r2} is "Officer":
- set {_r2} to "Trusted"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml" to "%{_r2}%"
- message "%{_prefix}% &7You demoted &6%arg 2% &7to &6%{_r2}%&7."
- send "%{_prefix}% &7You were demoted to &6%{_r2}%&7." to arg 2
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &6%arg 2% &7has been demoted to &6%{_r2}%&7!" to loop-player
- stop
- if {_r2} is "Trusted":
- set {_r2} to "Member"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml" to "%{_r2}%"
- message "%{_prefix}% &7You demoted &6%arg 2% &7to &6%{_r2}%&7."
- send "%{_prefix}% &7You were demoted to &6%{_r2}%&7." to arg 2
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &6%arg 2% &7has been demoted to &6%{_r2}%&7!" to loop-player
- stop
- if {_r2} is "Member":
- send "%{_prefix}% &6%arg 2% &7can't be demoted lower than &6%{_r2}%&7."
- stop
- else:
- message "%{_prefix}% &6%arg 2% &7is not in your {@p}."
- else:
- message "%{_prefix}% &7You can't demote yourself."
- if {_r} is "Officer":
- if arg 2 is not player:
- if {_c} is equal to {_c2}:
- if {_r2} is "Officer" or "Leader":
- send "%{_prefix}% &7You don't change &6%arg 2%&7's rank."
- stop
- if {_r2} is "Trusted":
- set {_r2} to "Member"
- set yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of arg 2%.yml" to "%{_r2}%"
- message "%{_prefix}% &7You demoted &6%arg 2% &7to &6%{_r2}%&7."
- send "%{_prefix}% &7You were demoted to &6%{_r2}%&7." to arg 2
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_c}%":
- send "%{_prefix}% &6%arg 2% &7has been demoted to &6%{_r2}%&7!" to loop-player
- stop
- if {_r2} is "Member":
- send "%{_prefix}% &6%arg 2% &7can't be demoted lower than &6%{_r2}%&7."
- stop
- else:
- message "%{_prefix}% &6%arg 2% &7is not in your {@p}."
- else:
- message "%{_prefix}% &7You can't demote yourself."
- if {_r} is "Member" or "Officer" or "Trusted":
- message "%{_prefix}% &7You must be the {@p}'s &6Leader &7or &6Officer &7to do that!"
- else:
- message "%{_prefix}% &7Use '/{@command} demote <player>' to demote the player."
- else:
- message "%{_prefix}% &7You're not in any {@p}."
- else:
- message "{@noperm}"
- if arg 1 is "claim":
- if player has permission "clan.claim" or "{@perm1}" or "clan.use.*":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_r} is "Leader" or "Officer":
- set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%player's chunk%.yml"
- set {_t2::*} to yaml list "Faction.Territory" from "../../Factions/Factions/%{_c}%.yml"
- set {_max} to yaml value "maxterritories" from "../../Factions/config.yml"
- if size of {_t2::*} is not {_max}:
- set {_tc} to yaml value "territory-costs" from "../../Factions/config.yml"
- if player's balance is greater or equal to {_tc}:
- if {_t} is not set:
- remove {_tc} from player's balance
- set yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%player's chunk%.yml" to "%{_c}%"
- set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml"
- set {_e} to {_e} parsed as number
- if {_e} <= 7:
- remove 0.4 from {_e}
- if {_e} <= 0:
- set {_e} to 0
- set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml" to "%{_e}%"
- send "%{_prefix}% &7Claimed Territory at &b%chunk of player%&7."
- add "%player's chunk%" to yaml list "Faction.Territory" from "../../Factions/Factions/%{_c}%.yml"
- else:
- if {_t} is equal to "%{_c}%":
- message "%{_prefix}% &7This Territory is already owned by your {@p}."
- else:
- message "%{_prefix}% &7This Territory is already owned by &6%{_t}%&7's {@p}."
- else:
- message "%{_prefix}% &7You don't have enough money to claim this territory!"
- else:
- message "%{_prefix}% &7You can't claim more territory."
- else:
- message "%{_prefix}% &7You must be the {@p}'s &6Leader &7or &6Officer &7to do that!"
- else:
- message "%{_prefix}% &7You're not in any {@p}."
- else:
- message "{@noperm}"
- if arg 1 is "unclaim":
- if player has permission "clan.claim" or "{@perm1}" or "clan.use.*":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_r} is "Leader" or "Officer":
- set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%player's chunk%.yml"
- if {_t} is set:
- if {_t} is equal to "%{_c}%":
- delete yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%player's chunk%.yml"
- set {_chunk} to chunk of player
- set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml"
- set {_e} to {_e} parsed as number
- if {_e} > 0:
- add 0.4 to {_e}
- if {_e} >= 7:
- set {_e} to 7
- set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml" to "%{_e}%"
- remove "%{_chunk}%" from yaml list "Faction.Territory" from "../../Factions/Factions/%{_c}%.yml"
- message "%{_prefix}% &7Un-Claimed Territory at &b%chunk of player%&7."
- else:
- message "%{_prefix}% &7This Territory is already owned by &6%{_t}%&7's {@p}."
- else:
- message "%{_prefix}% &7Territory is not claimed by any {@p}."
- else:
- message "%{_prefix}% &7You must be the {@p}'s &6Leader &7or &6Officer &7to do that!"
- else:
- message "%{_prefix}% &7You're not in any {@p}."
- else:
- message "{@noperm}"
- if arg 1 is "map":
- if player has permission "{@perm1}" or "clan.use":
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_r} is "Leader" or "Officer":
- set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%player's chunk%.yml"
- if {_t} is set:
- if {_t} is equal to "%{_c}%":
- delete yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%player's chunk%.yml"
- set {_chunk} to chunk of player
- set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml"
- set {_e} to {_e} parsed as number
- if {_e} > 0:
- add 0.4 to {_e}
- if {_e} >= 7:
- set {_e} to 7
- set yaml value "Faction.Energy" from "../../Factions/Factions/%{_c}%.yml" to "%{_e}%"
- remove "%{_chunk}%" from yaml list "Faction.Territory" from "../../Factions/Factions/%{_c}%.yml"
- message "%{_prefix}% &7Un-Claimed Territory at &b%chunk of player%&7."
- else:
- message "%{_prefix}% &7This Territory is already owned by &6%{_t}%&7's {@p}."
- else:
- message "%{_prefix}% &7Territory is not claimed by any {@p}."
- else:
- message "%{_prefix}% &7You must be the {@p}'s &6Leader &7or &6Officer &7to do that!"
- else:
- message "%{_prefix}% &7You're not in any {@p}."
- else:
- message "{@noperm}"
- else:
- send "{@noperm}"
- every 2.4 hours:
- set {_c::*} to yaml list "Factions" from "../../Factions/Factions.yml"
- loop {_c::*}:
- set {_clan} to loop-value
- set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_clan}%.yml"
- set {_e} to {_e} parsed as number
- remove 0.1 from {_e}
- set yaml value "Faction.Energy" from "../../Factions/Factions/%{_clan}%.yml" to "%{_e}%"
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_clan}%":
- UpdateScoreBoard(loop-player)
- every 30 seconds:
- set {_c::*} to yaml list "Factions" from "../../Factions/Factions.yml"
- loop {_c::*}:
- set {_clan} to loop-value
- set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_clan}%.yml"
- set {_e} to {_e} parsed as number
- if {_e} <= 0:
- set {_e} to 0
- set yaml value "Faction.Energy" from "../../Factions/Factions/%{_clan}%.yml" to "%{_e}%"
- set {_t::*} to yaml list "Faction.Territory" from "../../Factions/Factions/%{_clan}%.yml"
- loop {_t::*}:
- set {_c2} to loop-value-2
- delete yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_c2}%.yml"
- delete yaml list "Faction.Territory" from "../../Factions/Factions/%{_clan}%.yml"
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_clan}%":
- UpdateScoreBoard(loop-player)
- every 1.5 hours:
- set {_c::*} to yaml list "Factions" from "../../Factions/Factions.yml"
- loop {_c::*}:
- set {_clan} to loop-value
- set {_e} to yaml value "Faction.Energy" from "../../Factions/Factions/%{_clan}%.yml"
- set {_e} to {_e} parsed as number
- if {_e} <= 1.5:
- if {_e} > 0:
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_clan}%":
- send loop-player title "&6Notice" with subtitle "&f{@p} Energy is running low!" for 7 seconds
- else:
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_clan}%":
- send loop-player title "&cNotice" with subtitle "&f{@p} Energy is expired!" for 7 seconds
- UpdateScoreBoard(loop-player)
- on damage:
- attacker is a player
- attacker is in "{@world}"
- victim is a player
- set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
- replace all "@" with "&" in {_prefix}
- set {_prefix} to coloured {_prefix}
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of attacker%.yml"
- set {_c2} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of victim%.yml"
- if {_c} is equal to {_c2}:
- cancel event
- send "%{_prefix}% &7You can't harm &b%victim%&7." to attacker
- set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
- if {_a::*} contains "%{_c2}%":
- cancel event
- send "%{_prefix}% &7You can't harm &a%victim%&7." to attacker
- on death:
- attacker is a player
- attacker is in "{@world}"
- victim is a player
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of attacker%.yml"
- set {_c2} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of victim%.yml"
- if {_c} is set:
- if {_c2} is set:
- set {_wp} to yaml value "Faction.WarPoints.%{_c2}%" from "../../Factions/Factions/%{_c}%.yml"
- set {_wp2} to yaml value "Faction.WarPoints.%{_c}%" from "../../Factions/Factions/%{_c2}%.yml"
- set {_wp} to {_wp} parsed as number
- set {_wp2} to {_wp2} parsed as number
- if {_wp} is not set:
- set {_wp} to 0
- if {_wp2} is not set:
- set {_wp2} to 0
- add 1 to {_wp}
- remove 1 from {_wp2}
- set yaml value "Faction.WarPoints.%{_c2}%" from "../../Factions/Factions/%{_c}%.yml" to "%{_wp}%"
- set yaml value "Faction.WarPoints.%{_c}%" from "../../Factions/Factions/%{_c2}%.yml" to "%{_wp2}%"
- if {_wp} = 0:
- remove "%{_c2}%" from yaml list "Faction.Wins" from "../../Factions/Factions/%{_c}%.yml"
- remove "%{_c}%" from yaml list "Faction.Wins" from "../../Factions/Factions/%{_c2}%.yml"
- remove "%{_c2}%" from yaml list "Faction.Loses" from "../../Factions/Factions/%{_c}%.yml"
- remove "%{_c}%" from yaml list "Faction.Loses" from "../../Factions/Factions/%{_c2}%.yml"
- else:
- set {_confirm} to false
- set {_wins::*} to yaml list "Faction.Wins" from "../../Factions/Factions/%{_c}%.yml"
- loop {_wins::*}:
- if loop-value is {_c2}:
- set {_confirm} to true
- if {_confirm} is false:
- add "%{_c2}%" to yaml list "Faction.Wins" from "../../Factions/Factions/%{_c}%.yml"
- add "%{_c}%" to yaml list "Faction.Loses" from "../../Factions/Factions/%{_c2}%.yml"
- set {_set} to false
- set {_set2} to false
- if {_wp} >= 5:
- set {_set} to true
- set {_p} to "&7(&d%{_wp}%&7)"
- if {_wp} <= -5:
- set {_p} to "&7(&c%{_wp}%&7)"
- set {_set} to true
- if {_wp2} >= 5:
- set {_p2} to "&7(&d%{_wp2}%&7)"
- set {_set2} to true
- if {_wp2} <= -5:
- set {_p2} to "&7(&c%{_wp2}%&7)"
- set {_set2} to true
- if {_set} is false:
- set {_p} to "&7(&f%{_wp}%&7)"
- if {_set2} is false:
- set {_p2} to "&7(&f%{_wp2}%&7)"
- set {_p} to coloured {_p}
- set {_p2} to coloured {_p2}
- loop all players:
- set {_c3.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c3.%loop-player%} is equal to "%{_c}%":
- send "&8[&9War&8] &7Your {@p} gained 1 war point against &6%{_c2}% %{_p}%." to loop-player
- loop all players:
- set {_c4.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c4.%loop-player%} is equal to "%{_c2}%":
- send "&8[&9War&8] &7Your {@p} lost 1 war point against &6%{_c}% %{_p2}%." to loop-player
- if {_wp} is 25:
- broadcast "&8[&9War&8] &6%{_c}% &7can now invade &6%{_c2}%&7!"
- set {_wp} to "Invading"
- set {_wp2} to "Invaded"
- set yaml value "Faction.WarPoints.%{_c2}%" from "../../Factions/Factions/%{_c}%.yml" to "%{_wp}%"
- set yaml value "Faction.WarPoints.%{_c}%" from "../../Factions/Factions/%{_c2}%.yml" to "%{_wp2}%"
- loop all players:
- set {_i.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_i.%loop-player%} is equal to "%{_c2}%":
- send "&8[&9War&8] &7Your {@p} is being invaded by &6%{_c}%&7 &7for &a15 Minutes&7!" to loop-player
- send loop-player title "&cInvaded by &4%{_c}%" with subtitle "" for 10 seconds with 2 seconds fade in and 2 seconds fade out
- loop all players:
- set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_p.%loop-player%} is equal to "%{_c}%":
- send loop-player title "&6Invading &d%{_c2}%" with subtitle "" for 10 seconds with 2 seconds fade in and 2 seconds fade out
- send "&8[&9War&8] &7Your {@p} can now invade &6%{_c2}% &7for &a15 Minutes&7!" to loop-player
- wait 10 minutes
- loop all players:
- set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_p.%loop-player%} is equal to "%{_c}%":
- send loop-player title "&6Invading &d%{_c2}%" with subtitle "&c5 Minutes left!" for 5 seconds
- wait 4 minutes
- loop all players:
- set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_p.%loop-player%} is equal to "%{_c}%":
- send loop-player title "&6Invading &d%{_c2}%" with subtitle "&c1 Minute left!" for 3 seconds
- wait 55 seconds
- loop all players:
- set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_p.%loop-player%} is equal to "%{_c}%":
- send loop-player title "" with subtitle "&c&l5" for 2 seconds with 0 seconds fade in and 0 seconds fade out
- wait 1 second
- loop all players:
- set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_p.%loop-player%} is equal to "%{_c}%":
- send loop-player title "" with subtitle "&c&l4" for 2 seconds with 0 seconds fade in and 0 seconds fade out
- wait 1 second
- loop all players:
- set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_p.%loop-player%} is equal to "%{_c}%":
- send loop-player title "" with subtitle "&c&l3" for 2 seconds with 0 seconds fade in and 0 seconds fade out
- wait 1 second
- loop all players:
- set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_p.%loop-player%} is equal to "%{_c}%":
- send loop-player title "" with subtitle "&c&l2" for 2 seconds with 0 seconds fade in and 0 seconds fade out
- wait 1 second
- loop all players:
- set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_p.%loop-player%} is equal to "%{_c}%":
- send loop-player title "" with subtitle "&c&l1" for 2 seconds with 0 seconds fade in and 0 seconds fade out
- wait 1 second
- loop all players:
- set {_p.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_p.%loop-player%} is equal to "%{_c}%":
- send loop-player title "" with subtitle "&c&lInvasion is over!" for 10 seconds with 2 seconds fade in and 2 seconds fade out
- broadcast "&8[&9War&8] &6%{_c}%&7's invasion against &6%{_c2}% &7is over!"
- loop all players:
- set {_i.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_i.%loop-player%} is equal to "%{_c2}%":
- send "&8[&9War&8] &6%{_c}%&7's invasion against your {@p} is over!" to loop-player
- set {_wp} to {_wp} parsed as number
- set {_wp2} to {_wp2} parsed as number
- set {_wp} to 0
- set {_wp2} to 0
- set yaml value "Faction.WarPoints.%{_c2}%" from "../../Factions/Factions/%{_c}%.yml" to "%{_wp}%"
- set yaml value "Faction.WarPoints.%{_c}%" from "../../Factions/Factions/%{_c2}%.yml" to "%{_wp2}%"
- remove "%{_c2}%" from yaml list "Faction.Wins" from "../../Factions/Factions/%{_c}%.yml"
- remove "%{_c}%" from yaml list "Faction.Loses" from "../../Factions/Factions/%{_c2}%.yml"
- remove "%{_c2}%" from yaml list "Faction.Loses" from "../../Factions/Factions/%{_c}%.yml"
- remove "%{_c}%" from yaml list "Faction.Wins" from "../../Factions/Factions/%{_c2}%.yml"
- on join:
- set yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml" to "Public"
- set yaml value "Userdata.Username" from "../../Factions/Userdata/%uuid of player%.yml" to "%player%"
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is not set:
- set player tab name to "&e%player%"
- else:
- set player tab name to "&6%{_c}% &e%player%"
- on chat:
- player is in "{@world}"
- cancel event
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_chat} to yaml value "Userdata.Chat" from "../../Factions/Userdata/%uuid of player%.yml"
- set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
- if {_chat} is "Ally":
- loop {_a::*}:
- set {_clan} to loop-value
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_clan}%":
- send "&2%{_c}% %player% &a%message%" to loop-player
- loop all players:
- set {_c3.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c3.%loop-player%} is equal to "%{_c}%":
- send "&2%{_c}% %player% &a%message%" to loop-player
- if {_chat} is "Clan":
- loop all players:
- set {_c2.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c2.%loop-player%} is equal to "%{_c}%":
- send "&b%player% &3%message%" to loop-player
- if {_chat} is "Public":
- loop all players:
- loop-player is in "{@world}"
- set {_c.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c.%loop-player%} is "%{_c}%":
- if {_r} is "Leader" or "Officer":
- send "&3%{_c}% &7[&3%{_r}%&7] &b%player% &f%message%" to loop-player
- else:
- send "&3%{_c}% &b%player% &f%message%" to loop-player
- else:
- loop {_a::*}:
- set {_c.%loop-player-1%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player-1%.yml"
- if {_c.%loop-player-1%} is loop-value-2:
- set {_confirm.%loop-player-1%} to true
- if {_r} is "Leader" or "Officer":
- if {_confirm.%loop-player%} is true:
- send "&2%{_c}% &7[&2%{_r}%&7] &a%player% &f%message%" to loop-player-1
- else:
- send "&6%{_c}% &7[&6%{_r}%&7] &e%player% &f%message%" to loop-player-1
- else:
- if {_confirm.%loop-player%} is true:
- send "&2%{_c}% &a%player% &f%message%" to loop-player-1
- else:
- send "&6%{_c}% &e%player% &f%message%" to loop-player-1
- else:
- send "&e%player% &f%message%" to all players in "{@world}"
- on any movement:
- player is in "{@world}"
- set {_chunk} to player's chunk
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_chunk}%.yml"
- set {_m} to yaml value "Userdata.Territory" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
- if {_m} is not set:
- set yaml value "Userdata.Territory" from "../../Factions/Userdata/%uuid of player%.yml" to "%{_t}%"
- if {_t} is not set:
- set {_t} to "Wilderness"
- if {_t} is not {_m}:
- set yaml value "Userdata.Territory" from "../../Factions/Userdata/%uuid of player%.yml" to "%{_t}%"
- if {_t} is equal to {_c}:
- send player title "" with subtitle "&b%{_t}%" for 5 seconds
- send "&8&9Territory&8] &b%{_t}%"
- else:
- if {_t} is not equal to "Wilderness":
- if {_a::*} contains "%{_t}%":
- send player title "" with subtitle "&a%{_t}%" for 5 seconds
- send "&8[&9Territory&8] &a%{_t}%"
- else:
- if {_t} is not equal to "(Safe) Spawn" or "(Safe) Shop":
- send player title "" with subtitle "&6%{_t}%" for 5 seconds
- send "&8[&9Territory&8] &6%{_t}%"
- else:
- if {_t} is "(Safe) Spawn":
- send player title "" with subtitle "&f(&bSafe&f) &bSpawn" for 5 seconds
- send "&8[&9Territory&8] &f(&bSafe&f) &bSpawn"
- if {_t} is "(Safe) Shop":
- send player title "" with subtitle "&f(&bSafe&f) &bShop" for 5 seconds
- send "&8[&9Territory&8] &f(&bSafe&f) &bShop"
- else:
- send player title "" with subtitle "&7Wilderness" for 5 seconds
- send "&8[&9Territory&8] &7Wilderness"
- UpdateScoreBoard(player)
- on break:
- event-block is not bed
- player is in "{@world}"
- set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
- replace all "@" with "&" in {_prefix}
- set {_prefix} to coloured {_prefix}
- set {_chunk} to chunk at event-block's location
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_chunk}%.yml"
- set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
- if {_t} is set:
- if {_t} is equal to "%{_c}%":
- if {_r} is "Member":
- cancel event
- send "%{_prefix}% &7You must be &6Member &7or higher role to have access to break blocks."
- if {_r} is "Trusted" or "Officer" or "Leader":
- uncancel event
- else:
- if {_t} isn't equal to "(Safe) Shop Spawn" or "(Safe) Spawn":
- set {_wp} to yaml value "Faction.WarPoints.%{_t}%" from "../../Factions/Factions/%{_c}%.yml"
- if {_wp} is "Invading":
- uncancel event
- else:
- cancel event
- if {_a::*} contains "%{_t}%":
- message "%{_prefix}% &7You can't break blocks at &a%{_t}%&7's Territory!"
- else:
- send "%{_prefix}% &7You can't break blocks at &6%{_t}%&7's Territory!"
- else:
- if player has permission "{@perm1}":
- uncancel event
- else:
- cancel event
- on break of bed:
- player is in "{@world}"
- set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
- replace all "@" with "&" in {_prefix}
- set {_prefix} to coloured {_prefix}
- set {_chunk} to chunk at event-block's location
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_chunk}%.yml"
- set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
- if {_t} is set:
- set {_h} to yaml value "Faction.Home" from "../../Factions/Factions/%{_t}%.yml"
- set {_h2} to yaml value "Faction.Home2" from "../../Factions/Factions/%{_t}%.yml"
- if block at {_h}'s location is bed:
- set {_confirm} to true
- if block at {_h2}'s location is bed:
- set {_confirm} to true
- if {_confirm} is true:
- if {_t} is equal to "%{_c}%":
- if {_r} is "Officer" or "Leader":
- uncancel event
- delete yaml value "Faction.Home" from "../../Factions/Factions/%{_t}%.yml"
- delete yaml value "Faction.Home2" from "../../Factions/Factions/%{_t}%.yml"
- send "%{_prefix}% &7You removed your {@p} home bed!"
- else:
- cancel event
- send "%{_prefix}% &7You can't break your {@p} home bed!"
- else:
- if {_a::*} contains "%{_t}%":
- send "%{_prefix}% &7You can't break your ally home bed!"
- cancel event
- else:
- uncancel event
- delete yaml value "Faction.Home" from "../../Factions/Factions/%{_t}%.yml"
- send "%{_prefix}% &7You have destroyed &e%{_t}%&7's {@p} home bed!"
- loop all players:
- set {_c.%loop-player%} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of loop-player%.yml"
- if {_c.%loop-player%} is equal to {_t}:
- send "%{_prefix}% &e%player% &7has destroyed your {@p} home bed!" to loop-player
- on place:
- player is in "{@world}"
- set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
- replace all "@" with "&" in {_prefix}
- set {_prefix} to coloured {_prefix}
- set {_chunk} to chunk at event-block's location
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_chunk}%.yml"
- set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
- if {_t} is set:
- if {_t} is equal to "%{_c}%":
- if {_r} is "Member":
- cancel event
- send "%{_prefix}% &7You must be a &6Member &7or higher role to have access to place blocks."
- if {_r} is "Trusted" or "Officer" or "Leader":
- uncancel event
- else:
- if {_t} isn't equal to "(Safe) Shop Spawn" or "(Safe) Spawn":
- set {_wp} to yaml value "Faction.WarPoints.%{_t}%" from "../../Factions/Factions/%{_c}%.yml"
- if {_wp} is "Invading":
- uncancel event
- else:
- cancel event
- if {_a::*} contains "%{_t}%":
- message "%{_prefix}% &7You can't place blocks at &a%{_t}%&7's Territory!"
- else:
- send "%{_prefix}% &7You can't place blocks at &6%{_t}%&7's Territory!"
- else:
- if player has permission "{@perm1}":
- uncancel event
- else:
- cancel event
- on rightclick on door or lever or crafting table or button:
- player is in "{@world}"
- set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
- replace all "@" with "&" in {_prefix}
- set {_prefix} to coloured {_prefix}
- set {_chunk} to chunk at event-block's location
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_chunk}%.yml"
- set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
- if {_t} is set:
- if {_t} is equal to "%{_c}%":
- uncancel event
- else:
- if {_t} isn't equal to "(Safe) Shop Spawn" or "(Safe) Spawn":
- set {_wp} to yaml value "Faction.WarPoints.%{_t}%" from "../../Factions/Factions/%{_c}%.yml"
- if {_wp} is "Invading":
- uncancel event
- else:
- cancel event
- if {_a::*} contains "%{_t}%":
- message "%{_prefix}% &7You can't do that at &a%{_t}%&7's Territory!"
- else:
- send "%{_prefix}% &7You can't do that at &6%{_t}%&7's Territory!"
- else:
- if player has permission "{@perm1}":
- uncancel event
- else:
- cancel event
- on rightclick on furnace:
- player is in "{@world}"
- set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
- replace all "@" with "&" in {_prefix}
- set {_prefix} to coloured {_prefix}
- set {_chunk} to chunk at event-block's location
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_chunk}%.yml"
- set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
- if {_t} is set:
- if {_t} is equal to "%{_c}%":
- if {_r} is "Member":
- cancel event
- send "%{_prefix}% &7You must be &6Recruit+ &7or higher role to access the furnaces."
- if {_r} is "Trusted" or "Officer" or "Leader":
- uncancel event
- else:
- if {_t} isn't equal to "(Safe) Shop Spawn" or "(Safe) Spawn":
- set {_wp} to yaml value "Faction.WarPoints.%{_t}%" from "../../Factions/Factions/%{_c}%.yml"
- if {_wp} is "Invading":
- uncancel event
- else:
- cancel event
- if {_a::*} contains "%{_t}%":
- message "%{_prefix}% &7You can't break blocks at &a%{_t}%&7's Territory!"
- else:
- send "%{_prefix}% &7You can't break blocks at &6%{_t}%&7's Territory!"
- else:
- if player has permission "{@perm1}":
- uncancel event
- else:
- cancel event
- on rightclick on chest:
- player is in "{@world}"
- set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
- replace all "@" with "&" in {_prefix}
- set {_prefix} to coloured {_prefix}
- set {_chunk} to chunk at event-block's location
- set {_c} to yaml value "Userdata.Faction" from "../../Factions/Userdata/%uuid of player%.yml"
- if {_c} is set:
- set {_r} to yaml value "Userdata.Rank" from "../../Factions/Userdata/%uuid of player%.yml"
- set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%{_chunk}%.yml"
- set {_a::*} to yaml list "Faction.Allies" from "../../Factions/Factions/%{_c}%.yml"
- if {_t} is set:
- if {_t} is equal to "%{_c}%":
- if {_r} is "Member":
- cancel event
- send "%{_prefix}% &7You must be &6Recruit+ &7or higher role to access the chests."
- if {_r} is "Trusted" or "Officer" or "Leader":
- uncancel event
- else:
- if {_t} isn't equal to "(Safe) Shop Spawn" or "(Safe) Spawn":
- set {_wp} to yaml value "Faction.WarPoints.%{_t}%" from "../../Factions/Factions/%{_c}%.yml"
- if {_wp} is "Invading":
- uncancel event
- else:
- cancel event
- if {_a::*} contains "%{_t}%":
- message "%{_prefix}% &7You can't do that at &a%{_t}%&7's Territory!"
- else:
- send "%{_prefix}% &7You can't do that at &6%{_t}%&7's Territory!"
- else:
- if player has permission "{@perm1}":
- uncancel event
- else:
- cancel event
- on damage of a player:
- attacker is a player
- attacker is in "{@world}"
- victim is a player
- set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
- replace all "@" with "&" in {_prefix}
- set {_prefix} to coloured {_prefix}
- set {_t} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of attacker%.yml"
- set {_t2} to yaml value "TerritoryOwnedBy" from "../../Factions/Territories/%chunk of victim%.yml"
- if {_t} or {_t2} is equal to "(Safe) Spawn" or "(Safe) Shop Spawn":
- cancel event
- send "%{_prefix}% &7You can't harm &6%victim%&7 at this Territory." to attacker
- on death:
- victim is player
- {@death_messages} is true
- if attacker is set:
- set the death message to "&8[&9Death&8] &e%victim% &7was killed by &e%attacker%&7."
- else:
- set the death message to "&8[&9Death&8] &e%victim% &7died."
- on join:
- player has permission "{@perm1}":
- wait 2 seconds
- set {_updater} to yaml value "updater" from "../../Factions/config.yml"
- set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
- replace all "@" with "&" in {_prefix}
- set {_prefix} to coloured {_prefix}
- if {_updater} is true:
- if text from "http://pastebin.com/raw/w1myAT35" is not equal to "{@version}":
- set {_ver} to text from "http://pastebin.com/raw/w1myAT35"
- send "%{_prefix}% &6Found new version: &a%{_ver}%."
- send "&bCurrent Version: &c{@version}."
- send "&6Please update it in: &bhttp://adf.ly/1aqozz"
- else:
- stop
- on load:
- set {_prefix} to yaml value "prefix" from "../../Factions/config.yml"
- replace all "@" with "&" in {_prefix}
- set {_prefix} to coloured {_prefix}
- send "&8[&bCLANS&8] &aClans &e{@version} &ahas been enabled!" to console
- wait 1 second
- set {_updater} to yaml value "updater" from "../../Factions/config.yml"
- if {_updater} is true:
- if text from "http://pastebin.com/raw/w1myAT35" is not equal to "{@version}":
- set {_ver} to text from "http://pastebin.com/raw/w1myAT35"
- send "%{_prefix}% &6Found new version: &a%{_ver}%." to console
- send "&bCurrent Version: &c{@version}." to console
- send "&6Please update it in: &bhttp://adf.ly/1aqozz" to console
- else:
- stop
- every 10 seconds:
- set {_load} to false
- if yaml value "version" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "prefix" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "settings-prefix" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "scoreboard.title" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml list "scoreboard.clan" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml list "scoreboard.noclan" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "countdown-home" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "prefix" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "maxplayers" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "maxterritories" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "maxallies" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "territory-costs" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if yaml value "updater" from "../../Factions/config.yml" is not set:
- set {_load} to true
- if {_load} is true:
- broadcast "&8[&bCLANS&8] &bUh oh! config.yml has missing setting(s)!"
- broadcast "&8[&bCLANS&8] &bWe'll repair it for you."
- execute console command "sk reload %script%"
- broadcast "&8[&bCLANS&8] &bSuccessfully repaired all missing settings."
Add Comment
Please, Sign In to add comment