1c7

Please work.

1c7
Aug 8th, 2019
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.94 KB | None | 0 0
  1. options:
  2. P: &c[CLANS]&f
  3.  
  4. Version: "1.2.4"
  5.  
  6.  
  7. #
  8. # Hey there.
  9. # If you feel like you know what you're doing, by all means go ahead and edit it.
  10. # But if something breaks, it will be irreversible.
  11. #
  12.  
  13. on join:
  14. if player is op:
  15. set {_ver} to text from "https://pastebin.com/raw/RmEtgkma"
  16. if {_ver} != {@Version}:
  17. send "{@P} You're using an outdated version of {@P}. You're running &6"{@Version}"&f, while the newest version is &6""%{_ver}%""&f.&9 https://www.spigotmc.org/resources/clans.70102/"
  18. else:
  19. send "{@P} You are using the newest version of {@P}."
  20.  
  21. on script load:
  22. if {clan::names::*} is not set:
  23. add "" to {clan::names::*}
  24. every 5 minutes:
  25. loop all players:
  26. if {clan::%loop-player's uuid%} is set:
  27. add 1 to {clan::coins::%{clan::%loop-player's uuid%}%}
  28. send "{@P} +1 clan coins." to loop-player
  29. command /clan [<text>] [<text>] [<text>]:
  30. aliases: c, clans
  31. trigger:
  32. if arg-1 is "create":
  33. if {clan::%player's uuid%} is not set:
  34. if arg-2 is set:
  35. if arg-3 is set:
  36. send "{@P} Clan names can only be one word."
  37. stop
  38. if arg-2 contains "-" or "_" or "." or ";" or ":" or "@" or "," or "/" or "!":
  39. send "{@P} Illegal character in your clan name."
  40. stop
  41. else if {clan::names::*} does not contain arg-2:
  42. set {clan::%executor's uuid%} to arg-2
  43. add arg-2 to {clan::names::*}
  44. set {clan::owner::%arg-2%} to "%executor%"
  45. add "%executor%" to {clan::admins::%arg-2%::*}
  46. set {clan::coins::%arg-2%} to 0
  47. add "%executor%" to {clan::memberlist::%arg-2%::*}
  48. add 1 to {clan::members::%arg-2%}
  49. send "{@P} Clan &6%{clan::%executor's uuid%}%&f created."
  50. else:
  51. send "{@P} This clan name is taken."
  52. else:
  53. send "{@P} Enter a clan name."
  54. else:
  55. send "{@P} You're already in a clan."
  56. else if arg-1 is "info":
  57. if arg-2 is not set:
  58. if {clan::%player's uuid%} is set:
  59. send "{@P} Clan &6%{clan::%executor's uuid%}%&f information."
  60. send "&7> &cOwner: &f%{clan::owner::%{clan::%player's uuid%}%}%"
  61. send "&7> &cAdmins: &f%{clan::admins::%{clan::%player's uuid%}%::*}%"
  62. send ""
  63. send "&7> &cMembers: &f%{clan::members::%{clan::%player's uuid%}%}%"
  64. send "&7> &cMember List: &f%{clan::memberlist::%{clan::%player's uuid%}%::*}%"
  65. send "&7> &cCoins: &f%{clan::coins::%{clan::%player's uuid%}%}%"
  66. else:
  67. send "{@P} You're not in a clan."
  68. else:
  69. set {_player} to (arg-2 parsed as player)
  70. set {_uuid} to {_player}'s uuid
  71. if {clan::%{_uuid}%} is set:
  72. send "{@P} Player&6 %{_player}%&f's clan information."
  73. send "&7> &cName: &f%{clan::%{_uuid}%}%"
  74. send "&7> &cOwner: &f%{clan::owner::%{clan::%{_uuid}%}%}%"
  75. send ""
  76. send "&7> &cMembers: &f%{clan::members::%{clan::%{_uuid}%}%}%"
  77. send "&7> &cCoins: &f%{clan::coins::%{clan::%{_uuid}%}%}%"
  78. else:
  79. send "{@P} &6%{_player}%&f is not in a clan."
  80. else if arg-1 is "delete":
  81. if {clan::%executor's uuid%} is set:
  82. if {clan::owner::%{clan::%executor's uuid%}%} = executor:
  83. send "{@P} Clan &6%{clan::%executor's uuid%}%&f deleted."
  84. remove {clan::%executor's uuid%} from {clan::names::*}
  85. delete {clan::owner::%{clan::%player's uuid%}%}
  86. delete {clan::coins::%{clan::%player's uuid%}%}
  87. delete {clan::admins::%{clan::%player's uuid%}%::*}
  88. delete {clan::members::%{clan::%player's uuid%}%}
  89. loop {clan::memberlist::%{clan::%player's uuid%}%::*}:
  90. set {_player} to loop-value parsed as player
  91. set {_uuid} to {_player}'s uuid
  92. delete {clan::memberlist::%{clan::%player's uuid%}%::*}
  93. wait 3 ticks
  94. delete {clan::%{_uuid}%}
  95. else:
  96. send "{@P} Only the clan owner can delete the clan."
  97. else:
  98. send "{@P} You are not in a clan."
  99. else if arg-1 is "invite":
  100. if {clan::%player's uuid%} is set:
  101. if {clan::admins::%{clan::%player's uuid%}%::*} contains executor:
  102. set {_player} to (arg-2 parsed as player)
  103. set {_uuid} to {_player}'s uuid
  104. if arg-2 is set:
  105. if {clan::memberlist::%{clan::%player's uuid%}%::*} does not contain {_player}:
  106. set {clans::request::%{_uuid}%} to {clan::%executor's uuid%}
  107. send "{@P} Invited &6%arg-2%&f to the clan." to executor
  108. send "{@P} You have been invited to join &6%{clan::%executor's uuid%}%&f." to {_player}
  109. else:
  110. send "{@P} This player is already in your clan."
  111. else:
  112. send "{@P} Enter a player."
  113. else:
  114. send "{@P} Only admins can invite players to a clan."
  115. else:
  116. send "{@P} You are not in a clan."
  117. else if arg-1 is "join":
  118. if {clan::%executor's uuid%} is not set:
  119. if {clans::request::%executor's uuid%} is set:
  120. set {clan::%executor's uuid%} to {clans::request::%executor's uuid%}
  121. add 1 to {clan::members::%{clan::%executor's uuid%}%}
  122. add "%executor%" to {clan::memberlist::%{clans::request::%executor's uuid%}%::*}
  123. send "{@P} You have joined &6%{clans::request::%executor's uuid%}%&f."
  124. loop {clan::memberlist::%{clan::%executor's uuid%}%::*}:
  125. send "{@P} &6%executor%&f has joined the clan." to loop-value parsed as player
  126. wait 3 ticks
  127. delete {clans::request::%executor's uuid%}
  128. else:
  129. send "{@P} You have no pending requests."
  130. else:
  131. send "{@P} You are already in a clan."
  132. else if arg-1 is "promote":
  133. if {clan::%executor's uuid%} is set:
  134. if {clan::admins::%{clan::%player's uuid%}%::*} contains executor:
  135. set {_player} to (arg-2 parsed as player)
  136. set {_uuid} to {_player}'s uuid
  137. if {clan::admins::%{clan::%player's uuid%}%::*} does not contain {_player}:
  138. if arg-2 is set:
  139. add "%{_player}%" to {clan::admins::%{clan::%executor's uuid%}%::*}
  140. loop {clan::memberlist::%{clan::%executor's uuid%}%::*}:
  141. send "{@P} &6%{_player}%&f has been made an admin in the clan." to loop-value parsed as player
  142. else:
  143. send "{@P} Enter a player."
  144. else:
  145. send "{@P} This player is already an admin."
  146. else if arg-1 is "demote":
  147. if {clan::%executor's uuid%} is set:
  148. if arg-2 is set:
  149. if {clan::admins::%{clan::%player's uuid%}%::*} contains executor:
  150. set {_player} to (arg-2 parsed as player)
  151. set {_uuid} to {_player}'s uuid
  152. if {clan::owner::%{clan::%player's uuid%}%} is not {_player}:
  153. if {clan::admins::%{clan::%player's uuid%}%::*} contains {_player}:
  154. remove "%{_player}%" from {clan::admins::%{clan::%executor's uuid%}%::*}
  155. loop {clan::memberlist::%{clan::%executor's uuid%}%::*}:
  156. send "{@P} &6%{_player}%&f has been demoted in the clan." to loop-value parsed as player
  157. else:
  158. send "{@P} This player is not an admin."
  159. else:
  160. send "{@P} You can not demote the owner."
  161. else:
  162. send "{@P} Only admins can make another player admin."
  163. else:
  164. send "{@P} Enter a player."
  165. else:
  166. send "{@P} You're not in a clan."
  167. else if arg-1 is "kick":
  168. if {clan::%executor's uuid%} is set:
  169. if arg-2 is set:
  170. if {clan::admins::%{clan::%player's uuid%}%::*} contains executor:
  171. set {_player} to (arg-2 parsed as player)
  172. set {_uuid} to {_player}'s uuid
  173. if {clan::memberlist::%{clan::%player's uuid%}%::*} contains {_player}:
  174. loop {clan::memberlist::%{clan::%executor's uuid%}%::*}:
  175. send "{@P} &6%{_player}%&f has been kicked from the clan." to loop-value parsed as player
  176. remove "%{_player}%" from {clan::admins::%{clan::%executor's uuid%}%::*}
  177. remove "%{_player}%" from {clan::memberlist::%{clan::%executor's uuid%}%::*}
  178. remove 1 from {clan::members::%{clan::%player's uuid%}%}
  179. delete {clan::%{_uuid}%}
  180. else:
  181. send "{@P} This user is not in the clan"
  182. else:
  183. send "{@P} Only admins can kick members."
  184. else:
  185. send "{@P} Enter a player."
  186. else:
  187. send "{@P} You're not in a clan."
  188. else if arg-1 is "leave":
  189. if {clan::%executor's uuid%} is set:
  190. loop {clan::memberlist::%{clan::%executor's uuid%}%::*}:
  191. send "{@P} &6%executor%&f has left the clan." to loop-value parsed as player
  192. send "{@P} &fYou have left the clan." to player
  193. wait 3 ticks
  194. remove "%executor%" from {clan::memberlist::%{clan::%executor's uuid%}%::*}
  195. remove 1 from {clan::members::%{clan::%player's uuid%}%}
  196. remove "%executor%" from {clan::admins::%{clan::%executor's uuid%}%::*}
  197. delete {clan::%executor's uuid%}
  198. else:
  199. send "{@P} You're not in a clan."
  200. else if arg-1 is "chat":
  201. if {clan::%executor's uuid%} is set:
  202. if {clan::chat::%player's uuid%} is not set:
  203. set {clan::chat::%player's uuid%} to true
  204. send "{@P} Clan chat &aenabled&f."
  205. else:
  206. delete {clan::chat::%player's uuid%}
  207. send "{@P} Clan chat &cdisabled&f."
  208. else:
  209. send "{@P} You're not in a clan."
  210. else if arg-1 is "admin":
  211. if player has permission "clans.admin":
  212. if arg-2 is "delete":
  213. if arg-3 is set:
  214. loop {clan::memberlist::%arg-3%::*}:
  215. set {_player} to loop-value parsed as player
  216. set {_uuid} to {_player}'s uuid
  217. delete {clan::%{_uuid}%}
  218. remove arg-3 from {clan::names::*}
  219. delete {clan::owner::%arg-3%}
  220. delete {clan::coins::%arg-3%}
  221. delete {clan::admins::%arg-3%::*}
  222. delete {clan::members::%arg-3%}
  223. delete {clan::memberlist::%arg-3%::*}
  224. send "{@P} Clan &6%arg-3%&f deleted."
  225. delete {clan::%arg-3%}
  226. else:
  227. send "{@P} Enter a clan name to delete."
  228. else if arg-2 is "add":
  229. if arg-3 is set:
  230. add arg-3 to {clan::names::*}
  231. send "{@P} Added &6%arg-3%&f to the name filter."
  232. else:
  233. send "{@P} Enter a name to add from the name filter."
  234. else if arg-2 is "remove":
  235. if arg-3 is set:
  236. remove arg-3 from {clan::names::*}
  237. send "{@P} Removed &6%arg-3%&f from the name filter."
  238. else:
  239. send "{@P} Enter a name to remove from the name filter."
  240. else:
  241. send ""
  242. send "&7>&c /clan admin arguments"
  243. send "&7>&c (required)&7, &c[optional]"
  244. send ""
  245. send "&7>&f filter (add|remove) (name) &7&O- Add or remove a name from the name filter."
  246. send "&7>&f delete (clan name) &7&O- Delete a clan."
  247. else:
  248. send "{@P} You are lacking the permission ""clans.admin""."
  249. else:
  250. send ""
  251. send "&7>&c /clan arguments"
  252. send "&7>&c (required)&7, &c[optional]"
  253. send "&7>&c Version: 1.2.2 - Patch"
  254. send ""
  255. send "&7>&f create (name) &7&O- Create your clan."
  256. send "&7>&f delete &7&O- Delete your clan."
  257. send "&7>&f info [name]&7&O- Your or another player's clan info."
  258. send "&7>&f join &7&O- Accept an invitation."
  259. send "&7>&f leave &7&O- Leave your current clan."
  260. send ""
  261. send "&cAdmin Commands &7You must have admin role in your clan."
  262. send ""
  263. send "&7>&f invite (player) &7&O- Invite a player."
  264. send "&7>&f kick (player) &7&O- Kick a player from the clan."
  265. send "&7>&f promote (player) &7&O- Promote a player to admin."
  266. send "&7>&f demote (player) &7&O- Revoke an admin rank."
  267. send ""
  268. send "&cClan Admin Control &7You must have the permission ""clans.admin""."
  269. send ""
  270. send "&7>&f For all commands, &6/clan admin&f."
  271.  
  272. on chat:
  273. if {clan::chat::%player's uuid%} is true:
  274. cancel event
  275. loop {clan::memberlist::%{clan::%executor's uuid%}%::*}:
  276. send "{@P} &b[CHAT] &f%event-player%: %message%" to loop-value parsed as player
  277.  
  278. on damage:
  279. if {clan::memberlist::%{clan::%attacker's uuid%}%::*} contains victim:
  280. cancel event
  281. send "{@P} You can't attack a clan member!" to attacker
Advertisement
Add Comment
Please, Sign In to add comment