1c7

skPerm v1.2

1c7
May 1st, 2020
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.17 KB | None | 0 0
  1. #
  2. # READ!
  3. #
  4. #
  5. # For usage of each command, just type the command.
  6. #
  7. #
  8. # This is a VERY EARLY DEV VERSION!
  9. # Any issues NEED to be reported!
  10. #
  11. # v1.2
  12.  
  13.  
  14. options:
  15.  
  16. default group: ENTER-HERE # Please enter in your default group name.
  17. chat format: "[PREFIX] [PLAYER]: [MESSAGE]"
  18.  
  19.  
  20. P: &c[skPerm]&7
  21.  
  22. on script load:
  23. broadcast ""
  24. broadcast "{@P} RELOADED - Please read &n/skperm&7 before continuing!"
  25. broadcast ""
  26. set {_DF} to "{@default group}"
  27. if {_DF} is "ENTER-HERE":
  28. broadcast "{@P} &e&lWARNING &7It is important to setup a default group, and configure it in the script config!"
  29. broadcast ""
  30.  
  31. on join:
  32. if "{@default group}" is not "ENTER-HERE":
  33. if {skPerm::user-group::%player's uuid%} is not set:
  34. console command "/setgroup %player% {@default group}"
  35.  
  36. on command:
  37. if player is not op:
  38. if {skPerm::user-group::%player's uuid%} is set:
  39. if {skPerm::group::%{skPerm::user-group::%player's uuid%}%::*} contains command:
  40. stop
  41. else:
  42. cancel event
  43. send "{@P} Insufficent permissions..."
  44. else:
  45. if {skPerm::user::%player's uuid%::*} contains command:
  46. stop
  47. else:
  48. cancel event
  49. send "{@P} Insufficent permissions..."
  50.  
  51.  
  52. on chat:
  53. set {_F} to {@chat format}
  54. if {skPerm::user-group::%player's uuid%} is set:
  55. if {skPerm::group-prefix::%{skPerm::user-group::%player's uuid%}%} is set:
  56. replace all "[PREFIX]" with "[%{skPerm::group-prefix::%{skPerm::user-group::%player's uuid%}%}%&f]" in {_F}
  57. else:
  58. replace all "[PREFIX]" with "" in {_F}
  59. else if {skPerm::user-prefix::%player's uuid%} is set:
  60. replace all "[PREFIX]" with "[%{skPerm::user-prefix::%player's uuid%}%&f]" in {_F}
  61. else if {skPerm::user-prefix::%player's uuid%} is not set:
  62. replace all "[PREFIX]" with "" in {_F}
  63. replace all "[PLAYER]" with "%player%" in {_F}
  64. replace all "[MESSAGE]" with "%message%" in {_F}
  65. cancel event
  66. broadcast "%{_F}%"
  67.  
  68. command /skperm:
  69. trigger:
  70. send ""
  71. send "{@P} &lHELP PAGE"
  72. send "&c> &7/skperm &7- Show this page"
  73. send "&c> &7/creategroup &7- Create a group"
  74. send "&c> &7/addcommand &7- Add a command to a player/group"
  75. send "&c> &7/removecommand &7- Remove a command from a player/group"
  76. send "&c> &7/delgroup &7- Delete a group"
  77. send "&c> &7/setgroup &7- Set a player's group"
  78. send "&c> &7/setprefix &7- Set a players/groups prefix"
  79. send "{@P} &lTHINGS TO NOTE"
  80. send "&c> &7Groups are higher up in the inheretince list, with commands and prefixes."
  81. send "&c> &7Eg if player has command ""/help"", but the group they are in doesn't, it will not work."
  82. send "&c> &7Operators can access all commands."
  83. send ""
  84.  
  85. command /addcommand [<text>] [<text>] [<text>]:
  86. trigger:
  87. if arg-1 is "player":
  88. if arg-2 is set:
  89. if arg-3 is set:
  90. set {_P} to arg-2 parsed as player
  91. set {_U} to {_P}'s uuid
  92. add arg-3 to {skPerm::user::%{_U}%::*}
  93. send "{@P} User &3%{_P}%&7 can now use the command &3%arg-3%&7."
  94. else:
  95. send ""
  96. send "{@P} /addcommand [""player""] [player] [command]"
  97. send ""
  98. else:
  99. send ""
  100. send "{@P} /addcommand [""player""] [player] [command]"
  101. send ""
  102. else if arg-1 is "group":
  103. if arg-2 is set:
  104. if arg-3 is set:
  105. if {skPerm::group::%arg-2%} is set:
  106. add arg-3 to {skPerm::group::%arg-2%::*}
  107. send "{@P} Group &3%arg-2%&7 can now use the command &3%arg-3%&7."
  108. else:
  109. send "{@P} Group &3%arg-3%&7 cannot be found."
  110. else:
  111. send ""
  112. send "{@P} /addcommand [""group""] [group] [command]"
  113. send ""
  114. else:
  115. send ""
  116. send "{@P} /addcommand [""group""] [group] [command]"
  117. send ""
  118. else:
  119. send ""
  120. send "{@P} /addcommand [""player""|""group""] [player|group] [command]"
  121. send "&c> &7eg /addcommand player 1c7 help"
  122. send "&c> &7eg /addcommand group admin ban"
  123. send ""
  124.  
  125. command /removecommand [<text>] [<text>] [<text>]:
  126. trigger:
  127. if arg-1 is "player":
  128. if arg-2 is set:
  129. if arg-3 is set:
  130. set {_P} to arg-2 parsed as player
  131. set {_U} to {_P}'s uuid
  132. remove arg-3 from {skPerm::user::%{_U}%::*}
  133. send "{@P} User &3%{_P}%&7 can no longer use the command &3%arg-3%&7."
  134. else:
  135. send ""
  136. send "{@P} /removecommand [""player""] [player] [command]"
  137. send ""
  138. else:
  139. send ""
  140. send "{@P} /removecommand [""player""] [player] [command]"
  141. send ""
  142. else if arg-1 is "group":
  143. if arg-2 is set:
  144. if arg-3 is set:
  145. if {skPerm::group::%arg-2%} is set:
  146. remove arg-3 from {skPerm::group::%arg-2%::*}
  147. send "{@P} Group &3%arg-2%&7 can no longer use the command &3%arg-3%&7."
  148. else:
  149. send "{@P} Group &3%arg-3%&7 cannot be found."
  150. else:
  151. send ""
  152. send "{@P} /removecommand [""group""] [group] [command]"
  153. send ""
  154. else:
  155. send ""
  156. send "{@P} /removecommand [""group""] [group] [command]"
  157. send ""
  158. else:
  159. send ""
  160. send "{@P} /removecommand [""player""|""group""] [player|group] [command]"
  161. send "&c> &7eg /removecommand player 1c7 help"
  162. send "&c> &7eg /removecommand group admin ban"
  163. send ""
  164.  
  165.  
  166. command /creategroup [<text>]:
  167. trigger:
  168. if arg-1 is set:
  169. if {skPerm::group::%arg-1%} is not set:
  170. set {skPerm::group::%arg-1%} to true
  171. set {skPerm::group-prefix::%arg-1%} to arg-1
  172. send "{@P} Group &3%arg-1%&7 has been created."
  173. else:
  174. send "{@P} This group has already been created. Use &3/deletegroup %arg-1%&7 or &3/addcommand&7."
  175. else:
  176. send ""
  177. send "{@P} /creategroup [group]"
  178. send "&c> &7eg /creategroup admin"
  179. send ""
  180.  
  181. command /delgroup [<text>]:
  182. trigger:
  183. if arg-1 is set:
  184. if {skPerm::group::%arg-1%} is set:
  185. loop {skPerm::user-group::*}:
  186. if loop-value is arg-1:
  187. delete {skPerm::user-group::%loop-index%}
  188. delete {skPerm::group::%arg-1%}
  189. send "{@P} Group &3%arg-1%&7 has been deleted, and all members have been removed."
  190. else:
  191. send "{@P} This group does not exist. Use &3/creategroup %arg-1%&7 or &3/addcommand&7."
  192. else:
  193. send ""
  194. send "{@P} /delgroup [group]"
  195. send "&c> &7eg /delgroup admin"
  196. send ""
  197.  
  198. command /setgroup [<player>] [<text>]:
  199. trigger:
  200. if arg-1 is set:
  201. if arg-2 is set:
  202. if {skPerm::group::%arg-2%} is set:
  203. set {skPerm::user-group::%arg-1's uuid%} to arg-2
  204. send "{@P} &3%arg-1%&7's group has been set to &3%arg-2%&7."
  205. else:
  206. send "{@P} This group doesn't exist. Use &3/creategroup &3%arg-2%&7."
  207. else:
  208. send "{@P} /setgroup [player] [group]"
  209. else:
  210. send ""
  211. send "{@P} /setgroup [player] [group]"
  212. send "&c> &7eg /setgroup 1c7 admin"
  213. send ""
  214.  
  215. command /setprefix [<text>] [<text>] [<text>]:
  216. trigger:
  217. if arg-1 is "player":
  218. if arg-2 is set:
  219. if arg-3 is set:
  220. set {_P} to arg-2 parsed as player
  221. set {_U} to {_P}'s uuid
  222. set {skPerm::user-prefix::%{_U}%} to coloured arg-3
  223. send "{@P} Player &3%arg-2%&7's prefix has been set to &3%arg-3%&7 [including colours]."
  224. else:
  225. send "{@P} /setprefix [""player""] [player] [prefix]"
  226. else:
  227. send "{@P} /setprefix [""player""] [player] [prefix]"
  228. else if arg-1 is "group":
  229. if arg-2 is set:
  230. if arg-3 is set:
  231. if {skPerm::group::%arg-2%} is set:
  232. set {skPerm::group-prefix::%arg-2%} to coloured arg-3
  233. send "{@P} Group &3%arg-2%&7's prefix has been set to &3%arg-3%&7 [including colours]."
  234. else:
  235. send "{@P} This group doesn't exist. Use &3/creategroup &3%arg-2%&7."
  236. else:
  237. send "{@P} /setprefix [""player""] [player] [prefix]"
  238. else:
  239. send "{@P} /setprefix [""player""] [player] [prefix]"
  240. else:
  241. send ""
  242. send "{@P} /setprefix [""player""|""group""] [player|group] [prefix]"
  243. send "&c> &7eg /setprefix player 1c7 coolPlayer"
  244. send "&c> &7eg /setprefix group admin coolGroup"
  245. send ""
  246.  
  247. command /delprefix [<text>] [<text>]:
  248. trigger:
  249. if arg-1 is "player":
  250. if arg-2 is set:
  251. set {_P} to arg-1 parsed as player
  252. set {_U} to {_P}'s uuid
  253. delete {skPerm::user-prefix::%{_U}%}
  254. send "{@P} &3%arg-2%&7's prefix has been reset."
  255. else:
  256. send "{@P} /delprefix [""player""] [player]"
  257. else if arg-1 is "group":
  258. if arg-2 is set:
  259. delete {skPerm::group-prefix::%arg-2%}
  260. send "{@P} &3%arg-2%&7's prefix has been reset."
  261. else:
  262. send "{@P} /delprefix [""group""] [player]"
  263. else:
  264. send ""
  265. send "{@P} /delprefix [""player""|""group""] [player|group]"
  266. send "&c> &7eg /delprefix player 1c7"
  267. send "&c> &7eg /delprefix group admin"
  268. send ""
Advertisement
Add Comment
Please, Sign In to add comment