Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- ctitle: <##159456>Clans &8|
- #Main color:
- cc1: <##159456>
- #Min length of clan names
- cminlength: 3
- #Max length of clan names
- cmaxlength: 5
- #Allow special characters in clannames? (yes/no) | Special chars are ♥, ♦, ♣, etc. | If set to no, only allows normal letters
- specchars: no
- #Allow numbers in clannames? (yes/no)
- numchars: no
- #Price for creating a clan | Write any number or "free"
- ccprice: free
- #Money account | If you're using essentials balance write: player's balance | If you're using a skripted balance use the variable e.g. {money::%player's uuid%}
- cbalance: {money::%player's uuid%}
- #Money account in loops | If you're using essentials balance write: loop-player's balance | If you're using a skripted balance use the variable e.g. {money::%loop-player's uuid%}
- cbalanceloop: {money::%loop-player's uuid%}
- #Invite delay
- cinvdelay: 10 minutes
- #Glass | Decorative glass color in the GUI | Only use one of the 16 base colors of minecraft
- cglass: green
- on join:
- if "{@cbalance}" contains "player's uuid":
- if {@cbalance} is not set:
- set {@cbalance} to 0
- on load:
- if "cbalance" contains "player's uuid":
- loop all players:
- if {@cbalanceloop} is not set:
- set {@cbalanceloop} to 0
- function clanCreate(p: player, clanname: text):
- set {_pid} to uuid of {_p}
- send "{@ctitle} &7You &asuccessfully &7created the clan {@cc1}%{_clanname}%&7!" to {_p}
- set {clan::%{_clanname}%::name} to {_clanname}
- set {clan::%{_clanname}%::owner} to {_pid}
- set {clan::%{_clanname}%::created} to now
- add {_pid} to {clan::%{_clanname}%::member::*}
- set {clan::%{_pid}%} to {_clanname}
- command /clan [<text>] [<text>] [<text>]:
- trigger:
- if arg 1 is "create":
- if {clan::%player's uuid%} is not set:
- if arg 2 is set:
- set {_length} to length of arg 2
- if {_length} >= {@cminlength}:
- if {_length} <= {@cmaxlength}:
- if {clan::%arg 2%::name} is not set:
- if arg 2 doesn't match "[A-Za-z]+":
- if arg 2 partially matches "\d":
- if "{@numchars}" = "no":
- send "{@ctitle} &c&oError: &7Numbers are not allowed!"
- set {_pass} to false
- else:
- set {_pass} to true
- if arg 2 partially matches "\W":
- if "{@specchars}" = "no":
- send "{@ctitle} &c&oError: &7Special characters are not allowed!"
- set {_pass} to false
- else:
- set {_pass} to true
- else:
- set {_pass} to true
- if {_pass} = true:
- if "{@ccprice}" = "free":
- clanCreate(player, arg 2)
- else:
- if {@cbalance} >= "{@ccprice}" parsed as integer:
- clanCreate(player, arg 2)
- remove "{@ccprice}" parsed as integer from {@cbalance}
- else:
- send "{@ctitle} &c&oError: &7You don't have enough money to create a clan! &8&o(&7&o${@ccprice} needed!&8&o)"
- else:
- send "{@ctitle} &c&oError: &7The clan name {@cc1}%arg 2% &7is already taken!"
- else:
- send "{@ctitle} &c&oError: &7The clan name {@cc1}%arg 2% &7is to long! &8&o(&7&oMax. {@cc1}{@cmaxlength}&8&o)"
- else:
- send "{@ctitle} &c&oError: &7The clan name {@cc1}%arg 2% &7is to short! &8&o(&7&oMin. {@cc1}{@cminlength}&8&o)"
- else:
- send "{@ctitle} &c&oError: &7Please write a name for your clan!"
- else:
- send "{@ctitle} &c&oError: &7You're already in a clan! Leave that one to create your own!"
- else if arg 1 is "leave":
- if {clan::%player's uuid%} is set:
- if {clan::%{clan::%player's uuid%}%::owner} = player's uuid:
- send "{@ctitle} &7You can't leave a clan if you're the owner!"
- send "{@ctitle} &7Use {@cc1}/clan delete &7if you still want to leave!"
- else:
- if arg 2 is "confirm":
- remove player's uuid from {clan::%{clan::%player's uuid%}%::member::*}
- send "{@ctitle} &7You left the clan {@cc1}%{clan::%player's uuid%}%&7!"
- delete {clan::%player's uuid%}
- else:
- send "{@ctitle} &7Are you sure you want to leave {@cc1}%{clan::%player's uuid%}%&7?"
- send formatted "{@ctitle} &7If you are please type {@cc1}<cmd:/clan leave confirm><ttp:&7Click to confirm.>/clan leave confirm<reset>"
- else:
- send "{@ctitle} &c&oError: &7You're not in a clan so you can't leave one!"
- else if arg 1 is "join":
- if {clan::%player's uuid%} is not set:
- if arg 2 is set:
- if {clan::%arg 2%::name} is set:
- add player's uuid to {clan::%arg 2%::member::*}
- set {clan::%player's uuid%} to {clan::%arg 2%::name}
- send "{@ctitle} &7You &asuccessfully &7join the clan {@cc1}%{clan::%arg 2%::name}%&7!"
- else:
- send "{@ctitle} &c&oError: &7Seems like clan {@cc1}%arg 2% &7doesn't exist!"
- else:
- send "{@ctitle} &c&oError: &7Please write a clan you want to join!"
- else:
- send "{@ctitle} &c&oError: &7You're already in a clan! Leave that one to join another!"
- else if arg 1 is "delete":
- if {clan::%player's uuid%} is set:
- if {clan::%{clan::%player's uuid%}%::owner} = player's uuid:
- if arg 2 = "confirm":
- delete {clan::%{clan::%player's uuid%}%::name}
- delete {clan::%{clan::%player's uuid%}%::owner}
- loop {clan::%{clan::%player's uuid%}%::member::*}:
- if loop-value doesn't contain player's uuid:
- delete {clan::%loop-value%}
- send "{@ctitle} &7Clan {@cc1}%{clan::%player's uuid%}% &7is being deleted so you were kicked out!" to loop-value parsed as offlineplayer
- delete {clan::%{clan::%player's uuid%}%::member::*}
- delete {clan::%{clan::%player's uuid%}%::created}
- send "{@ctitle} &7You &cdeleted &7the clan {@cc1}%{clan::%player's uuid%}%&7!"
- delete {clan::%player's uuid%}
- else:
- send "{@ctitle} &7Are you sure you want to delete {@cc1}%{clan::%player's uuid%}%&7?"
- send formatted "{@ctitle} &7If you are please type {@cc1}<cmd:/clan delete confirm><ttp:&7Click to confirm.>/clan delete confirm<reset>"
- else:
- send "{@ctitle} &c&oError: &7You're not the owner of the clan {@cc1}%{clan::%player's uuid%}% &7so you can't delete it!"
- else:
- send "{@ctitle} &c&oError: &7You're not in a clan so you can't delete one!"
- else if arg 1 is "invite":
- if arg 2 is set:
- if arg 2 parsed as offlineplayer is online:
- if {clan::%player's uuid%} is set:
- if {clan::%player's uuid%::invitetimer} is not set:
- set {clan::%player's uuid%::invitetimer} to {@cinvdelay} and 10 seconds ago
- if difference between {clan::%player's uuid%::invitetimer} and now is more than {@cinvdelay}:
- send "{@ctitle} {@cc1}%player% &7invited you to join the clan {@cc1}%{clan::%player's uuid%}%&7!" to arg 2 parsed as offlineplayer
- send formatted "{@ctitle} &7Click <cmd:/clan invite accept %{clan::%player's uuid%}%><ttp:&7Click here to accept.>{@cc1}&ohere<reset> &7to accept the invitation!" to arg 2 parsed as offlineplayer
- send "{@ctitle} &7You invited {@cc1}%arg 2% &7to join the clan {@cc1}%{clan::%player's uuid%}%&7!"
- set {clan::%player's uuid%::invitetimer} to now
- else:
- send "{@ctitle} &7You already sent an invite to a player less than {@cc1}{@cinvdelay} &7ago!"
- else:
- send "{@ctitle} &c&oError: &7You're not in a clan so you can't send an invite!"
- else if arg 2 = "accept":
- if arg 3 is set:
- if {clan::%player's uuid%} is not set:
- add player's uuid to {clan::%arg 3%::member::*}
- set {clan::%player's uuid%} to {clan::%arg 3%::name}
- send "{@ctitle} &7You &asuccessfully &7joined the clan {@cc1}%{clan::%arg 3%::name}%&7!"
- else:
- send "{@ctitle} &c&oError: &7You're already in a clan so you can't join another!"
- else:
- send "{@ctitle} &c&oError: &7Please write of which clan you want to accept the invitation of!"
- else:
- send "{@ctitle} &c&oError: &7Seems like {@cc1}%arg 2% &7is not online!"
- else:
- send "{@ctitle} &c&oError: &7Please write the name of a player you want to invite!"
- else:
- send "{@ctitle} &7Please choose one of the following commands:"
- send ""
- send "&7○ {@cc1}<sgt:/clan create><ttp:&7Click to select.>/clan create<reset>"
- send "&7○ {@cc1}<sgt:/clan leave><ttp:&7Click to select.>/clan leave<reset>"
- send "&7○ {@cc1}<sgt:/clan join><ttp:&7Click to select.>/clan join<reset>"
- send "&7○ {@cc1}<sgt:/clan delete><ttp:&7Click to select.>/clan delete<reset>"
- send "&7○ {@cc1}<sgt:/clan invite><ttp:&7Click to select.>/clan invite<reset>"
- on place:
- if {clan::%player's uuid%} is set:
- set {clanblocks::%event-location%} to {clan::%player's uuid%}
- on break:
- if {clanblocks::%event-location%} is set:
- if {clanblocks::%event-location%} is not equal to {clan::%player's uuid%}:
- send action bar "{@ctitle} &c&oError: &7This block belongs to another clan!" to player
- cancel event
- else:
- delete {clanblocks::%event-location%}
- on inventory click:
- if player's current inventory = (metadata tag "clanInfoGUI" of player):
- cancel event
- on chat:
- cancel event
- set {_clan} to ""
- set {_prefix} to ""
- if player's prefix is set:
- set {_prefix} to "%player's prefix% "
- if {clan::%player's uuid%} is set:
- set {_clan} to "&8[{@cc1}%{clan::%player's uuid%}%&8] "
- send "%formatted {_clan}%%{_prefix}%&7%player% ⏩ &7%message%" to all players
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement