Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.35 KB | None | 0 0
  1. # LuxPerms by Farwl
  2.  
  3. # # #
  4.  
  5. Options:
  6. ver: 0.1.0
  7. np: &cYou're not allowed to use this command!
  8.  
  9. # CONFIG
  10.  
  11.  
  12. # CONFIG
  13.  
  14. # CODE #
  15.  
  16. # Functions
  17.  
  18. function openGUI(id: string, p: player):
  19. {_id} = "users":
  20. create a gui with virtual chest with 6 rows named "&8Overview > Users":
  21. make gui slot 46 with compass named "&b&lManage Specific User" with lore "&7Click to view user":
  22. set {manageUser::%{_p}%} to true
  23. click({_p})
  24. close {_p}'s inventory
  25. send title "&b&lManage User" with subtitle "&7Type username in chat" to {_p} for 5 seconds
  26. send action bar "&7Type &ccancel &7to cancel chat prompt" to {_p}
  27. make gui slot 49 with oak sign named "&b&lBack" with lore "&7Click to go back":
  28. click({_p})
  29. make {_p} execute command "luxperms"
  30. loop all players:
  31. {_n} = 44:
  32. exit loop
  33. else:
  34. add 1 to {_n}
  35. set {_p1} to ("%loop-value%" parsed as offline player)
  36. {_p1} is op:
  37. {_p1}'s prefix = "":
  38. make next gui slot with skull of ({_p1}) named "&6&l%{_p1}%" with lore "&7Click to view", "&cUser is an operator", "", "&7Group: &e%{_p1}'s group%", and "&7Prefix: &cNone":
  39. click({_p})
  40. manageUser({_p}, {_p1})
  41. else:
  42. make next gui slot with skull of ({_p1}) named "&6&l%{_p1}%" with lore "&7Click to view", "&cUser is an operator", "", "&7Group: &e%{_p1}'s group%", and "&7Custom Prefix: %{_p1}'s prefix%":
  43. click({_p})
  44. manageUser({_p}, {_p1})
  45. else:
  46. {_p1}'s prefix = "":
  47. make next gui slot with skull of ({_p1}) named "&6&l%{_p1}%" with lore "&7Click to view", "", "", "&7Group: &e%{_p1}'s group%", and "&7Prefix: &cNone":
  48. click({_p})
  49. manageUser({_p}, {_p1})
  50. else:
  51. make next gui slot with skull of ({_p1}) named "&6&l%{_p1}%" with lore "&7Click to view", "", "", "&7Group: &e%{_p1}'s group%", and "&7Custom Prefix: %{_p1}'s prefix%":
  52. click({_p})
  53. manageUser({_p}, {_p1})
  54. open last gui to {_p}
  55. else if {_id} = "groups":
  56. create a gui with virtual chest with 6 rows named "&8Overview > Groups":
  57. make gui slot 49 with oak sign named "&b&lBack" with lore "&7Click to go back":
  58. click({_p})
  59. make {_p} execute command "luxperms"
  60. make gui slot 46 with compass named "&b&lSpecific Group" with lore "&7Click to view and edit specific group":
  61. click({_p})
  62. close {_p}'s inventory
  63. set {managingGroup::%{_p}%} to true
  64. send title "&b&lManage Group" with subtitle "&7Type group in chat" to {_p} for 5 seconds
  65. send action bar "&7Type &ccancel &7to cancel chat prompt" to {_p}
  66. make gui slot 52 with anvil named "&b&lAdd Group" with lore "&7Click to add group":
  67. click({_p})
  68. close {_p}'s inventory
  69. set {addingGroup::%player%} to true
  70. send title "&b&lAdd Group" with subtitle "&7Type name in chat" to {_p} for 5 seconds
  71. send action bar "&7Type &ccancel &7to cancel chat prompt" to {_p}
  72. set {_g::*} to all groups
  73. loop {_g::*}:
  74. set {_g} to loop-value
  75. {_n} = 44:
  76. make gui slot 48 with tnt named "&c&lError" with lore "&7Too many groups to list in gui"
  77. exit loop
  78. else:
  79. add 1 to {_n}
  80. clear {_gp::*}
  81. set {_gp::*} to all permissions of group "%{_g}%"
  82. set {_gps} to size of {_gp::*}
  83. group "%{_g}%"'s perm prefix = " " or "":
  84. set {_gp} to "&cNone"
  85. group "%{_g}%"'s perm prefix is not set:
  86. set {_gp} to "&cNone"
  87. make next gui slot with yellow glass pane named "&6&l%{_g}%" with lore "&7Click to view and edit group", "", "&7Rank: &e%loop-index%", "&7Prefix: %{_gp}%", "", and "&e%{_gps}% &7Permission Nodes":
  88. click({_p})
  89. manageGroup("%{_g}%", player)
  90. open last gui to {_p}
  91. else if {_id} = "expand":
  92. create a gui with virtual chest with 6 rows named "&8LuxPerms {@ver}":
  93. make gui slot 11 with skull of ("%{_p}%" parsed as offline player) named "&6&lUsers" with lore "&7Click to view all &aUsers":
  94. click({_p})
  95. openGUI("users", {_p})
  96. make gui slot 15 with bookshelf named "&6&lGroups" with lore "&7Click to view all &aGroups":
  97. click({_p})
  98. openGUI("groups", {_p})
  99. make gui slot 28 with redstone torch named "&c&lReload" with lore "&7Click to reload LuxPerms":
  100. click({_p})
  101. execute console command "/sk reload %script%"
  102. close {_p}'s inventory
  103. send title "&b&lReloaded" with subtitle "&7LuxPerms {@ver} reloaded" to {_p} for 2 seconds
  104. make gui slot 34 with red glass pane named "&b&lVersion" with lore "&7You're using &bLuxPerms {@ver}"
  105. make gui slot 49 with tripwire hook named "&b&lReduce" with lore "&7Click to show less", "", and "&7This will hide advanced options":
  106. click({_p})
  107. make {_p} execute command "luxperms"
  108. open last gui to {_p}
  109.  
  110. function manageUser(u: player, p: offline player):
  111. set {_playerPrefix} to {_p}'s prefix
  112. {_playerPrefix} = "":
  113. set {_playerPrefix} to "&cNone"
  114. set {_playerSuffix} to {_p}'s suffix
  115. {_playerSuffix} = "":
  116. set {_playerSuffix} to "&cNone"
  117. set {_perms::*} to all permissions of {_p}
  118. set {_sp} to size of {_perms::*}
  119. set {_g} to {_p}'s group
  120. set {_groupPerms::*} to all permissions of group {_g}
  121. set {_sg} to size of {_groupPerms::*}
  122. create a gui with virtual chest with 6 rows named "&8Users > %{_p}%":
  123. {_p} is op:
  124. make gui slot 14 with red glass pane named "&b&lDe-OP User" with lore "&7Click to remove &coperator", "", and "&7User is currently an &coperator":
  125. deop {_p}
  126. click({_u})
  127. manageUser({_u}, {_p})
  128. else:
  129. make gui slot 14 with lime glass pane named "&b&lOP User" with lore "&7Click to make user an &coperator", "", and "&7User is currently &cnot &7a &coperator":
  130. op {_p}
  131. click({_u})
  132. manageUser({_u}, {_p})
  133. make gui slot 49 with oak sign named "&b&lBack" with lore "&7Click to go back":
  134. click({_u})
  135. openGUI("users", {_u})
  136. make gui slot 12 with book and quill named "&b&lPermissions" with lore "&7Click to view permissions":
  137. click({_u})
  138. editPerms({_p}, {_u})
  139. make gui slot 28 with book named "&b&lGroup" with lore "&7Click to change Group", "", and "&7Group: &e%{_p}'s group%":
  140. changeGroup({_p}, {_u})
  141. click({_u})
  142. make gui slot 31 with skull of ({_p}) named "&b&l%{_p}%" with lore "&7Group: &e%{_p}'s group%", "", "&7Current Prefix: %{_playerPrefix}%", "&7Current Suffix: %{_playerSuffix}%", "", "&7Player Permissions: &e%{_sp}%", and "&7Group Permissions: &e%{_sg}%"
  143. make gui slot 34 with name tag named "&b&lPrefix and Suffix" with lore "&7Click to edit prefix/suffix", "", "&7Prefix: %{_playerPrefix}%", and "&7Suffix: %{_playerSuffix}%":
  144. click({_u})
  145. close {_u}'s inventory
  146. set {prefixORsuffix::%{_u}%} to true
  147. send title "&b&lPrefix or Suffix" with subtitle "&7Type 'prefix' or 'suffix' in chat" to {_u} for 5 seconds
  148. send action bar "&7Type &ccancel &7to cancel chat prompt" to {_u}
  149. set {effectingUser::%{_u}%} to {_p}
  150. open last gui to {_u}
  151.  
  152. function manageGroup(g: string, u: player):
  153. create a gui with virtual chest with 6 rows named "&8Groups > %{_g}%":
  154. make gui slot 49 with oak sign named "&b&lBack" with lore "&7Click to go back":
  155. click({_u})
  156. openGUI("groups", {_u})
  157. make gui slot 13 with book and quill named "&b&lView Permissions" with lore "&bClick &7to open &ePermissions Editor":
  158. click({_u})
  159. editGroupPerms("%{_g}%", {_u})
  160. make gui slot 34 with nametag named "&b&lChange Prefix/Suffix" with lore "&7Click to change prefix/suffix":
  161. click({_u})
  162. close {_u}'s inventory
  163. set {group_prefixORsuffix::%{_u}%} to true
  164. set {effectingGroup::%{_u}%} to {_g}
  165. send title "&b&lPrefix or Suffix" with subtitle "&7Type 'prefix' or 'suffix' in chat" to {_u} for 5 seconds
  166. send action bar "&7Type &ccancel &7to cancel" to {_u}
  167. loop all players:
  168. set {_pg} to loop-player's group
  169. {_pg} = {_g}:
  170. add 1 to {_gm}
  171. set {_gp} to group {_g}'s perm prefix
  172. set {_gs} to group {_g}'s perm suffix
  173. {_gp} = "" or " ":
  174. set {_gp} to "&cNone"
  175. {_gp} is not set:
  176. set {_gp} to "&cNone"
  177. {_gs} = "" or " ":
  178. set {_gs} to "&cNone"
  179. {_gs} is not set:
  180. set {_gs} to "&cNone"
  181. {_gm} is not set:
  182. set {_gm} to 0
  183. set {_gp::*} to all permissions of group {_g}
  184. set {_gps} to size of {_gp::*}
  185. make gui slot 31 with book named "&b&l%{_g}%" with lore "&7Click to rename group", "", "&7Members: &a%{_gm}%", "", "&7Prefix: %{_gp}%", "&7Suffix: %{_gs}%", "", and "&7Permissions: &a%{_gps}%":
  186. click({_u})
  187. close {_u}'s inventory
  188. set {effectingGroup::%{_u}%} to {_g}
  189. set {renamingGroup::%{_u}%} to true
  190. send title "&b&lRename Group" with subtitle "&7Type new name in chat" to {_u} for 5 seconds
  191. send action bar "&7Type &ccancel &7to cancel chat prompt" to {_u}
  192. make gui slot 28 with redstone ore named "&c&lDelete Group" with lore "&7Click to delete group", "", and "&cThis cannot be undone!":
  193. {_g} = "default":
  194. click({_u})
  195. close {_u}'s inventory
  196. send title "&c&lError" with subtitle "&7Can't delete default group"
  197. else:
  198. click({_u})
  199. close {_u}'s inventory
  200. delete group {_g}
  201. send title "&c&lGroup Deleted" with subtitle "&7Group &b%{_g}% &7deleted" to {_u} for 2 seconds
  202. open last gui to {_u}
  203.  
  204. function editGroupPerms(g: string, u: player):
  205. set {_perms::*} to all permissions of group {_g}
  206. create a gui with virtual chest with 6 rows named "&8%{_g}% > Perms":
  207. make gui slot 49 with oak sign named "&b&lBack" with lore "&7Click to go back":
  208. click({_u})
  209. manageGroup({_g}, {_u})
  210. make gui slot 52 with anvil named "&b&lAdd Perm" with lore "&7Click to add permission":
  211. click({_u})
  212. close {_u}'s inventory
  213. set {group.addGroupPerm::%{_u}%} to {_g}
  214. set {addGroupPerm::%{_u}%} to true
  215. send title "&b&lAdd Permission" with subtitle "&7Type permission node in chat" for 5 seconds
  216. send action bar "&7Type &ccancel &7to cancel chat prompt" to {_u}
  217. size of {_perms::*} > 0:
  218. loop {_perms::*}:
  219. {_n} = 44:
  220. make gui slot 48 with tnt named "&c&lError" with lore "&7Too many perms to list in gui."
  221. exit loop
  222. else:
  223. add 1 to {_n}
  224. set {_perm} to loop-value
  225. make next gui slot with lime glass pane named "&a&l%{_perm}%" with lore "&7Click to &cremove":
  226. click({_u})
  227. remove "%{_perm}%" from all permissions of group {_g}
  228. editGroupPerms("%{_g}%", {_u})
  229. else:
  230. make gui slot 13 with redstone block named "&c&lNo Permissions" with lore "&7This group has no permissions"
  231. open last gui to {_u}
  232.  
  233. function changeGroup(p: offlineplayer, u: player):
  234. create a gui with virtual chest with 6 rows named "&8%{_p}% > Set Group":
  235. make gui slot 46 with compass named "&b&lSpecific Group" with lore "&7Click to set group":
  236. click({_u})
  237. close {_u}'s inventory
  238. set {settingGroup::%{_u}%} to true
  239. send title "&b&lSet group" with subtitle "&7Type group in chat" to {_u} for 5 seconds
  240. send action bar "&7Type &ccancel &7to cancel chat prompt" to {_u}
  241. set {user.settingGroup::%{_u}%} to {_p}
  242. set {_g} to {_p}'s group
  243. make gui slot 49 with oak sign named "&b&lBack" with lore "&7Click to go back":
  244. click({_u})
  245. manageUser({_u}, {_p})
  246. set {_groups::*} to all groups
  247. loop {_groups::*}:
  248. set {_gl} to loop-value
  249. set {_glp} to group {_gl}'s perm prefix
  250. {_glp} = " " or "":
  251. set {_glp} to "&cNone"
  252. {_glp} is not set:
  253. set {_glp} to "&cNone"
  254. {_n} = 44:
  255. make gui slot 52 with tnt named "&c&lError" with lore "&7Couldn't list all groups in gui"
  256. exit loop
  257. else:
  258. add 1 to {_n}
  259. {_gl} = {_g}:
  260. make next gui slot with yellow glass pane named "&e&l%{_gl}%" with lore "&cPlayer's current group"
  261. else:
  262. set {_groupPerms::*} to all permissions of group {_gl}
  263. set {_gps} to size of {_groupPerms::*}
  264. make next gui slot with yellow glass pane named "&e&l%{_gl}%" with lore "&7Click to set group", "", "&7Prefix: %{_glp}%", "", and "&7Permission Nodes: &e%{_gps}%":
  265. click({_u})
  266. close {_u}'s inventory
  267. set {_p}'s group to {_gl}
  268. send title "&b&lGroup Changed" with subtitle "&7Set &b%{_p}%&7's group to &b%{_gl}%" to {_u} for 2 seconds
  269. open last gui to {_u}
  270.  
  271. function editPerms(p: offlineplayer, u: player):
  272. set {_perms::*} to all permissions of {_p}
  273. create a gui with virtual chest with 6 rows named "&8%{_p}% > Perms":
  274. make gui slot 49 with oak sign named "&b&lBack" with lore "&7Click to go back":
  275. click({_u})
  276. manageUser({_u}, {_p})
  277. make gui slot 52 with anvil named "&b&lAdd Perm" with lore "&7Click to add permission":
  278. click({_u})
  279. close {_u}'s inventory
  280. set {user.addPerm::%{_u}%} to {_p}
  281. set {addPerm::%{_u}%} to true
  282. send title "&b&lAdd Permission" with subtitle "&7Type permission node in chat" for 5 seconds
  283. send action bar "&7Type &ccancel &7to cancel chat prompt" to {_u}
  284. size of {_perms::*} > 0:
  285. loop {_perms::*}:
  286. {_n} = 44:
  287. make gui slot 48 with tnt named "&c&lError" with lore "&7Too many perms to list in gui."
  288. exit loop
  289. else:
  290. add 1 to {_n}
  291. set {_perm} to loop-value
  292. make next gui slot with lime glass pane named "&a&l%{_perm}%" with lore "&7Click to &cremove":
  293. click({_u})
  294. remove "%{_perm}%" from permissions of {_p}
  295. editPerms({_p}, {_u})
  296. else:
  297. make gui slot 13 with redstone block named "&c&lNo Permissions" with lore "&7This user has no permissions"
  298. open last gui to {_u}
  299.  
  300. function click(p: player):
  301. play sound "ui.button.click" with volume 2 with pitch 2 at {_p} for {_p}
  302.  
  303. # Events
  304.  
  305. chat:
  306. {addPerm::%player%} = true:
  307. cancel event
  308. uncolored message = "cancel":
  309. clear {addPerm::%player%}
  310. clear {user.addPerm::%player%}
  311. send title "" with subtitle "&7Chat prompt &ccancelled" to player for 2 seconds
  312. else:
  313. replace all " " in message with "."
  314. set {_p} to ("%{user.addPerm::%player%}%" parsed as offline player)
  315. set {_perm} to uncolored message
  316. add {_perm} to permissions of {_p}
  317. clear {addPerm::%player%}
  318. clear {user.addPerm::%player%}
  319. send title "&b&lAdded Permission" with subtitle "&7Added perm &b%uncolored message% &7to &b%{_p}%" to player for 2 seconds
  320. else if {addGroupPerm::%player%} = true:
  321. cancel event
  322. uncolored message = "cancel":
  323. clear {addGroupPerm::%player%}
  324. clear {group.addGroupPerm::%player%}
  325. send title "" with subtitle "&7Chat prompt &ccancelled" to player for 2 seconds
  326. else:
  327. replace all " " in message with "."
  328. set {_g} to {group.addGroupPerm::%player%}
  329. set {_perm} to uncolored message
  330. add {_perm} to all permissions of group {_g}
  331. clear {addGroupPerm::%player%}
  332. clear {group.addGroupPerm::%player%}
  333. send title "&b&lAdded Permission" with subtitle "&7Added perm &b%uncolored message% &7to group &b%{_g}%" to player for 2 seconds
  334. editGroupPerms("%{_g}%", player)
  335. else if {manageUser::%player%} = true:
  336. cancel event
  337. uncolored message = "cancel":
  338. clear {manageUser::%player%}
  339. clear {addPerm::%player%}
  340. clear {user.addPerm::%player%}
  341. send title "" with subtitle "&7Chat prompt &ccancelled" to player for 2 seconds
  342. else:
  343. set {_u} to (uncolored message parsed as offline player)
  344. {_u} is online:
  345. manageUser(player, {_u})
  346. clear {manageUser::%player%}
  347. else:
  348. clear {manageUser::%player%}
  349. send title "&c&lError" with subtitle "&7User is offline"
  350. else if {prefixORsuffix::%player%} = true:
  351. cancel event
  352. set {_r} to uncolored message
  353. {_r} = "cancel":
  354. clear {prefixORsuffix::%player%}
  355. send title "" with subtitle "&7Chat prompt &ccancelled" to player for 2 seconds
  356. else if {_r} = "prefix":
  357. clear {prefixORsuffix::%player%}
  358. set {settingPrefix::%player%} to true
  359. send title "&b&lSet Prefix" with subtitle "&7Type prefix in chat" to player for 5 seconds
  360. send action bar "&7Type &ccancel &7to cancel or &creset &7to reset prefix" to player
  361. else if {_r} = "suffix":
  362. clear {prefixORsuffix::%player%}
  363. set {settingSuffix::%player%} to true
  364. send title "&b&lSet Suffix" with subtitle "&7Type suffix in chat" to player for 5 seconds
  365. send action bar "&7Type &ccancel &7to cancel or &creset &7to reset suffix" to player
  366. else if {settingPrefix::%player%} = true:
  367. cancel event
  368. uncolored message = "cancel":
  369. send title "" with subtitle "&7Chat prompt &ccancelled" to player for 2 seconds
  370. clear {settingPrefix::%player%}
  371. clear {user.settingPrefix::%player%}
  372. else if uncolored message = "reset" or "clear":
  373. set {_u} to {effectingUser::%player%}
  374. set {_u}'s prefix to ""
  375. send title "&b&lReset Prefix" with subtitle "&7Reset &b%{_u}%&7's prefix" to player for 2 seconds
  376. clear {settingPrefix::%player%}
  377. clear {user.settingPrefix::%player%}
  378. else:
  379. set {_u} to {effectingUser::%player%}
  380. set {_r} to message
  381. set {_u}'s prefix to {_r}
  382. send title "&b&lPrefix Set" with subtitle "&7Set &b%{_u}%&7's prefix to ""%{_r}%&7""" to player for 2 seconds
  383. clear {settingPrefix::%player%}
  384. clear {user.settingPrefix::%player%}
  385. else if {settingSuffix::%player%} = true:
  386. cancel event
  387. uncolored message = "cancel":
  388. send title "" with subtitle "&7Chat prompt &ccancelled" to player for 2 seconds
  389. clear {settingSuffix::%player%}
  390. clear {user.settingSuffix::%player%}
  391. else if uncolored message = "reset" or "clear":
  392. set {_u} to {effectingUser::%player%}
  393. set {_u}'s suffix to ""
  394. send title "&b&lReset Suffix" with subtitle "&7Reset &b%{_u}%&7's suffix" to player for 2 seconds
  395. clear {settingSuffix::%player%}
  396. clear {user.settingSuffix::%player%}
  397. else:
  398. set {_u} to {effectingUser::%player%}
  399. set {_r} to message
  400. set {_u}'s suffix to {_r}
  401. send title "&b&lSuffix Set" with subtitle "&7Set &b%{_u}%&7's suffix to ""%{_r}%&7""" to player for 2 seconds
  402. clear {settingSuffix::%player%}
  403. clear {user.settingSuffix::%player%}
  404. else if {settingGroup::%player%} = true:
  405. cancel event
  406. set {_r} to uncolored message
  407. {_r} = "cancel":
  408. clear {settingGroup::%player%}
  409. clear {user.settingGroup::%player%}
  410. send title "" with subtitle "&7Chat prompt &ccancelled" to player for 2 seconds
  411. else:
  412. set {_g::*} to all groups
  413. {_g::*} contains {_r}:
  414. set {_u} to {user.settingGroup::%player%}
  415. set {_u}'s group to {_r}
  416. send title "&b&lGroup set" with subtitle "&7Set &b%{_u}%&7's group to &b%{_r}%" to player for 2 seconds
  417. clear {settingGroup::%player%}
  418. clear {user.settingGroup::%player%}
  419. else:
  420. clear {settingGroup::%player%}
  421. clear {user.settingGroup::%player%}
  422. send title "&c&lInvalid Group" with subtitle "&7That group doesn't exist!" to player for 2 seconds
  423. else if {managingGroup::%player%} = true:
  424. cancel event
  425. set {_r} to uncolored message
  426. {_r} = "cancel":
  427. clear {managingGroup::%player%}
  428. send title "" with subtitle "&7Chat prompt &ccancelled" to player for 2 seconds
  429. else:
  430. set {_g::*} to all groups
  431. {_g::*} contains {_r}:
  432. send title "" with subtitle "" to player
  433. send action bar "" to player
  434. manageGroup("%{_r}%", player)
  435. clear {managingGroup::%player%}
  436. else:
  437. clear {managingGroup::%player%}
  438. send title "&c&lError" with subtitle "&7Group doesn't exist" to player
  439. else if {addingGroup::%player%} = true:
  440. cancel event
  441. set {_g} to message
  442. {_g} = "cancel":
  443. clear {addingGroup::%player%}
  444. send title "" with subtitle "&7Chat prompt &ccancelled"
  445. else:
  446. size of groups 1 of "%{_g}%" matched against "([^A-Za-z0-9_,'\-\+/]{1,})" > 0:
  447. clear {addingGroup::%player%}
  448. send title "&c&lError" with subtitle "&7Group names must be alphanumeric" to player for 2 seconds
  449. else:
  450. set {_g::*} to all groups
  451. {_g::*} contains {_g}:
  452. clear {addingGroup::%player%}
  453. send title "&c&lError" with subtitle "&7Group already exists" to player for 2 seconds
  454. else:
  455. clear {addingGroup::%player%}
  456. create group "%{_g}%"
  457. manageGroup({_g}, player)
  458. else if {group_prefixORsuffix::%player%} = true:
  459. cancel event
  460. set {_r} to uncolored message
  461. {_r} = "cancel":
  462. clear {group_prefixORsuffix::%player%}
  463. send title "" with subtitle "&7Chat prompt &ccancelled" to player for 2 seconds
  464. else if {_r} = "prefix":
  465. clear {group_prefixORsuffix::%player%}
  466. set {group_settingPrefix::%player%} to true
  467. send title "&b&lSet Prefix" with subtitle "&7Type prefix in chat" to player for 5 seconds
  468. send action bar "&7Type &ccancel &7to cancel or &creset &7to reset prefix" to player
  469. else if {_r} = "suffix":
  470. clear {group_prefixORsuffix::%player%}
  471. set {group_settingSuffix::%player%} to true
  472. send title "&b&lSet Suffix" with subtitle "&7Type suffix in chat" to player for 5 seconds
  473. send action bar "&7Type &ccancel &7to cancel or &creset &7to reset suffix" to player
  474. else if {group_settingPrefix::%player%} = true:
  475. cancel event
  476. uncolored message = "cancel":
  477. send title "" with subtitle "&7Chat prompt &ccancelled" to player for 2 seconds
  478. clear {group_settingPrefix::%player%}
  479. clear {group.settingPrefix::%player%}
  480. else if uncolored message = "reset" or "clear":
  481. set {_g} to {effectingGroup::%player%}
  482. set group {_g}'s perm prefix to ""
  483. send title "&b&lReset Prefix" with subtitle "&7Reset &b%{_g}%&7's prefix" to player for 2 seconds
  484. clear {group_settingPrefix::%player%}
  485. clear {group.settingPrefix::%player%}
  486. else:
  487. set {_g} to {effectingGroup::%player%}
  488. set {_g} to message
  489. set group {_g}'s perm prefix to {_r}
  490. send title "&b&lPrefix Set" with subtitle "&7Set &b%{_g}%&7's prefix to ""%{_r}%&7""" to player for 2 seconds
  491. clear {group_settingPrefix::%player%}
  492. clear {group.settingPrefix::%player%}
  493. else if {group_settingSuffix::%player%} = true:
  494. cancel event
  495. uncolored message = "cancel":
  496. send title "" with subtitle "&7Chat prompt &ccancelled" to player for 2 seconds
  497. clear {group_settingSuffix::%player%}
  498. clear {group.settingSuffix::%player%}
  499. else if uncolored message = "reset" or "clear":
  500. set {_g} to {effectingUser::%player%}
  501. set group {_g}'s perm suffix to ""
  502. send title "&b&lReset Suffix" with subtitle "&7Reset &b%{_g}%&7's suffix" to player for 2 seconds
  503. clear {group_settingSuffix::%player%}
  504. clear {group.settingSuffix::%player%}
  505. else:
  506. set {_g} to {effectingGroup::%player%}
  507. set {_r} to message
  508. set group {_g}'s perm suffix to {_r}
  509. send title "&b&lSuffix Set" with subtitle "&7Set &b%{_g}%&7's suffix to ""%{_r}%&7""" to player for 2 seconds
  510. clear {group_settingSuffix::%player%}
  511. clear {group.settingSuffix::%player%}
  512. else if {renamingGroup::%player%} = true:
  513. cancel event
  514. set {_r} to uncolored message
  515. size of groups 1 of "%{_r}%" matched against "([^A-Za-z0-9_,'\-\+/]{1,})" > 0:
  516. clear {renamingGroup::%player%}
  517. clear {effectingGroup::%player%}
  518. send title "&c&lError" with subtitle "&7Group names must be alphanumeric" to player for 2 seconds
  519. else:
  520. loop all groups:
  521. loop-value = {_r}:
  522. set {_err} to true
  523. {_err} = true:
  524. clear {renamingGroup::%player%}
  525. clear {effectingGroup::%player%}
  526. send title "&c&lError" with subtitle "&7Group already exists" to player for 2 seconds
  527. else:
  528. set {_g} to {effectingGroup::%player%}
  529. set group "%{_g}%"'s name to "%{_r}%"
  530. send title "&b&lGroup renamed" with subtitle "&b%{_g}% &7renamed to &b%{_r}%" to player for 2 seconds
  531. clear {renamingGroup::%player%}
  532. clear {effectingGroup::%player%}
  533.  
  534.  
  535. skript load:
  536. send "%nl%[LuxPerms] Loaded version {@ver}" to console
  537.  
  538. # Commands
  539.  
  540. command /luxperms:
  541. aliases: /luxperms:luxperms, /lp, /luxperms:lp
  542. permission: luxperms.admin
  543. permission message: {@np}
  544. trigger:
  545. create a gui with virtual chest with 6 rows named "&8LuxPerms {@ver}":
  546. make gui slot 20 with skull of ("%player%" parsed as offline player) named "&6&lUsers" with lore "&7Click to view all &aUsers":
  547. click(player)
  548. openGUI("users", player)
  549. make gui slot 24 with bookshelf named "&6&lGroups" with lore "&7Click to view all &aGroups":
  550. click(player)
  551. openGUI("groups", player)
  552. make gui slot 40 with tripwire hook named "&b&lExpand" with lore "&7Click to show more", "", and "&7This will show you more advanced options":
  553. click(player)
  554. openGUI("expand", player)
  555. open last gui to player
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement