Advertisement
StarBunnie

Untitled

Jun 17th, 2021
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.25 KB | None | 0 0
  1. options:
  2. ctitle: <##159456>Clans &8|
  3.  
  4. #Main color:
  5. cc1: <##159456>
  6.  
  7. #Min length of clan names
  8. cminlength: 3
  9.  
  10. #Max length of clan names
  11. cmaxlength: 5
  12.  
  13. #Allow special characters in clannames? (yes/no) | Special chars are ♥, ♦, ♣, etc. | If set to no, only allows normal letters
  14. specchars: no
  15.  
  16. #Allow numbers in clannames? (yes/no)
  17. numchars: no
  18.  
  19. #Price for creating a clan | Write any number or "free"
  20. ccprice: free
  21. #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%}
  22. cbalance: {money::%player's uuid%}
  23. #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%}
  24. cbalanceloop: {money::%loop-player's uuid%}
  25.  
  26. #Invite delay
  27. cinvdelay: 10 minutes
  28.  
  29. #Glass | Decorative glass color in the GUI | Only use one of the 16 base colors of minecraft
  30. cglass: green
  31.  
  32. on join:
  33. if "{@cbalance}" contains "player's uuid":
  34. if {@cbalance} is not set:
  35. set {@cbalance} to 0
  36.  
  37. on load:
  38. if "cbalance" contains "player's uuid":
  39. loop all players:
  40. if {@cbalanceloop} is not set:
  41. set {@cbalanceloop} to 0
  42.  
  43. function clanCreate(p: player, clanname: text):
  44. set {_pid} to uuid of {_p}
  45. send "{@ctitle} &7You &asuccessfully &7created the clan {@cc1}%{_clanname}%&7!" to {_p}
  46. set {clan::%{_clanname}%::name} to {_clanname}
  47. set {clan::%{_clanname}%::owner} to {_pid}
  48. set {clan::%{_clanname}%::created} to now
  49. add {_pid} to {clan::%{_clanname}%::member::*}
  50. set {clan::%{_pid}%} to {_clanname}
  51.  
  52. command /clan [<text>] [<text>] [<text>]:
  53. trigger:
  54. if arg 1 is "create":
  55. if {clan::%player's uuid%} is not set:
  56. if arg 2 is set:
  57. set {_length} to length of arg 2
  58. if {_length} >= {@cminlength}:
  59. if {_length} <= {@cmaxlength}:
  60. if {clan::%arg 2%::name} is not set:
  61. if arg 2 doesn't match "[A-Za-z]+":
  62. if arg 2 partially matches "\d":
  63. if "{@numchars}" = "no":
  64. send "{@ctitle} &c&oError: &7Numbers are not allowed!"
  65. set {_pass} to false
  66. else:
  67. set {_pass} to true
  68. if arg 2 partially matches "\W":
  69. if "{@specchars}" = "no":
  70. send "{@ctitle} &c&oError: &7Special characters are not allowed!"
  71. set {_pass} to false
  72. else:
  73. set {_pass} to true
  74. else:
  75. set {_pass} to true
  76. if {_pass} = true:
  77. if "{@ccprice}" = "free":
  78. clanCreate(player, arg 2)
  79. else:
  80. if {@cbalance} >= "{@ccprice}" parsed as integer:
  81. clanCreate(player, arg 2)
  82. remove "{@ccprice}" parsed as integer from {@cbalance}
  83. else:
  84. send "{@ctitle} &c&oError: &7You don't have enough money to create a clan! &8&o(&7&o${@ccprice} needed!&8&o)"
  85. else:
  86. send "{@ctitle} &c&oError: &7The clan name {@cc1}%arg 2% &7is already taken!"
  87. else:
  88. send "{@ctitle} &c&oError: &7The clan name {@cc1}%arg 2% &7is to long! &8&o(&7&oMax. {@cc1}{@cmaxlength}&8&o)"
  89. else:
  90. send "{@ctitle} &c&oError: &7The clan name {@cc1}%arg 2% &7is to short! &8&o(&7&oMin. {@cc1}{@cminlength}&8&o)"
  91. else:
  92. send "{@ctitle} &c&oError: &7Please write a name for your clan!"
  93. else:
  94. send "{@ctitle} &c&oError: &7You're already in a clan! Leave that one to create your own!"
  95. else if arg 1 is "leave":
  96. if {clan::%player's uuid%} is set:
  97. if {clan::%{clan::%player's uuid%}%::owner} = player's uuid:
  98. send "{@ctitle} &7You can't leave a clan if you're the owner!"
  99. send "{@ctitle} &7Use {@cc1}/clan delete &7if you still want to leave!"
  100. else:
  101. if arg 2 is "confirm":
  102. remove player's uuid from {clan::%{clan::%player's uuid%}%::member::*}
  103. send "{@ctitle} &7You left the clan {@cc1}%{clan::%player's uuid%}%&7!"
  104. delete {clan::%player's uuid%}
  105. else:
  106. send "{@ctitle} &7Are you sure you want to leave {@cc1}%{clan::%player's uuid%}%&7?"
  107. send formatted "{@ctitle} &7If you are please type {@cc1}<cmd:/clan leave confirm><ttp:&7Click to confirm.>/clan leave confirm<reset>"
  108. else:
  109. send "{@ctitle} &c&oError: &7You're not in a clan so you can't leave one!"
  110. else if arg 1 is "join":
  111. if {clan::%player's uuid%} is not set:
  112. if arg 2 is set:
  113. if {clan::%arg 2%::name} is set:
  114. add player's uuid to {clan::%arg 2%::member::*}
  115. set {clan::%player's uuid%} to {clan::%arg 2%::name}
  116. send "{@ctitle} &7You &asuccessfully &7join the clan {@cc1}%{clan::%arg 2%::name}%&7!"
  117. else:
  118. send "{@ctitle} &c&oError: &7Seems like clan {@cc1}%arg 2% &7doesn't exist!"
  119. else:
  120. send "{@ctitle} &c&oError: &7Please write a clan you want to join!"
  121. else:
  122. send "{@ctitle} &c&oError: &7You're already in a clan! Leave that one to join another!"
  123. else if arg 1 is "delete":
  124. if {clan::%player's uuid%} is set:
  125. if {clan::%{clan::%player's uuid%}%::owner} = player's uuid:
  126. if arg 2 = "confirm":
  127. delete {clan::%{clan::%player's uuid%}%::name}
  128. delete {clan::%{clan::%player's uuid%}%::owner}
  129. loop {clan::%{clan::%player's uuid%}%::member::*}:
  130. if loop-value doesn't contain player's uuid:
  131. delete {clan::%loop-value%}
  132. send "{@ctitle} &7Clan {@cc1}%{clan::%player's uuid%}% &7is being deleted so you were kicked out!" to loop-value parsed as offlineplayer
  133. delete {clan::%{clan::%player's uuid%}%::member::*}
  134. delete {clan::%{clan::%player's uuid%}%::created}
  135. send "{@ctitle} &7You &cdeleted &7the clan {@cc1}%{clan::%player's uuid%}%&7!"
  136. delete {clan::%player's uuid%}
  137. else:
  138. send "{@ctitle} &7Are you sure you want to delete {@cc1}%{clan::%player's uuid%}%&7?"
  139. send formatted "{@ctitle} &7If you are please type {@cc1}<cmd:/clan delete confirm><ttp:&7Click to confirm.>/clan delete confirm<reset>"
  140. else:
  141. send "{@ctitle} &c&oError: &7You're not the owner of the clan {@cc1}%{clan::%player's uuid%}% &7so you can't delete it!"
  142. else:
  143. send "{@ctitle} &c&oError: &7You're not in a clan so you can't delete one!"
  144. else if arg 1 is "invite":
  145. if arg 2 is set:
  146. if arg 2 parsed as offlineplayer is online:
  147. if {clan::%player's uuid%} is set:
  148. if {clan::%player's uuid%::invitetimer} is not set:
  149. set {clan::%player's uuid%::invitetimer} to {@cinvdelay} and 10 seconds ago
  150. if difference between {clan::%player's uuid%::invitetimer} and now is more than {@cinvdelay}:
  151. send "{@ctitle} {@cc1}%player% &7invited you to join the clan {@cc1}%{clan::%player's uuid%}%&7!" to arg 2 parsed as offlineplayer
  152. 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
  153. send "{@ctitle} &7You invited {@cc1}%arg 2% &7to join the clan {@cc1}%{clan::%player's uuid%}%&7!"
  154. set {clan::%player's uuid%::invitetimer} to now
  155. else:
  156. send "{@ctitle} &7You already sent an invite to a player less than {@cc1}{@cinvdelay} &7ago!"
  157. else:
  158. send "{@ctitle} &c&oError: &7You're not in a clan so you can't send an invite!"
  159. else if arg 2 = "accept":
  160. if arg 3 is set:
  161. if {clan::%player's uuid%} is not set:
  162. add player's uuid to {clan::%arg 3%::member::*}
  163. set {clan::%player's uuid%} to {clan::%arg 3%::name}
  164. send "{@ctitle} &7You &asuccessfully &7joined the clan {@cc1}%{clan::%arg 3%::name}%&7!"
  165. else:
  166. send "{@ctitle} &c&oError: &7You're already in a clan so you can't join another!"
  167. else:
  168. send "{@ctitle} &c&oError: &7Please write of which clan you want to accept the invitation of!"
  169. else:
  170. send "{@ctitle} &c&oError: &7Seems like {@cc1}%arg 2% &7is not online!"
  171. else:
  172. send "{@ctitle} &c&oError: &7Please write the name of a player you want to invite!"
  173. else:
  174. send "{@ctitle} &7Please choose one of the following commands:"
  175. send ""
  176. send "&7○ {@cc1}<sgt:/clan create><ttp:&7Click to select.>/clan create<reset>"
  177. send "&7○ {@cc1}<sgt:/clan leave><ttp:&7Click to select.>/clan leave<reset>"
  178. send "&7○ {@cc1}<sgt:/clan join><ttp:&7Click to select.>/clan join<reset>"
  179. send "&7○ {@cc1}<sgt:/clan delete><ttp:&7Click to select.>/clan delete<reset>"
  180. send "&7○ {@cc1}<sgt:/clan invite><ttp:&7Click to select.>/clan invite<reset>"
  181.  
  182. on place:
  183. if {clan::%player's uuid%} is set:
  184. set {clanblocks::%event-location%} to {clan::%player's uuid%}
  185.  
  186. on break:
  187. if {clanblocks::%event-location%} is set:
  188. if {clanblocks::%event-location%} is not equal to {clan::%player's uuid%}:
  189. send action bar "{@ctitle} &c&oError: &7This block belongs to another clan!" to player
  190. cancel event
  191. else:
  192. delete {clanblocks::%event-location%}
  193.  
  194. on inventory click:
  195. if player's current inventory = (metadata tag "clanInfoGUI" of player):
  196. cancel event
  197.  
  198. on chat:
  199. cancel event
  200. set {_clan} to ""
  201. set {_prefix} to ""
  202. if player's prefix is set:
  203. set {_prefix} to "%player's prefix% "
  204. if {clan::%player's uuid%} is set:
  205. set {_clan} to "&8[{@cc1}%{clan::%player's uuid%}%&8] "
  206. send "%formatted {_clan}%%{_prefix}%&7%player% ⏩ &7%message%" to all players
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement