7mm

Skript Config

7mm
Apr 25th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.22 KB | None | 0 0
  1. on load:
  2. clear {acvsystem::*}
  3.  
  4. on join:
  5. set {_p} to player
  6. set {lvsystem::%{_p}%::exp} to 0 if {lvsystem::%{_p}%::exp} is not set
  7. set {lvsystem::%{_p}%::level} to 1 if {lvsystem::%{_p}%::level} is not set
  8. set {chatsystem::%{_p}%::prefix} to "&7" if {chatsystem::%{_p}%::prefix} is not set
  9. set {chatsystem::%{_p}%::suffix} to "&f@Guest" if {chatsystem::%{_p}%::suffix} is not set
  10.  
  11. add 1 to {joinsystem::%{_p}%::count}
  12. if {joinsystem::%{_p}%::count} is 1:
  13. set {chatsystem::%{_p}%::prefix} to "&7"
  14. set {chatsystem::%{_p}%::suffix} to "&f@Guest"
  15. set join message to "&e&lPlayer Join &9&m&l*-&r &d%player% さんが初めて参加しました! &7(%player count% PLAYERS)"
  16. command "execute @a ~ ~ ~ playsound entity.player.levelup master @s ~ ~ ~ 1 0.5"
  17. achievement(player)
  18. else:
  19. set join message to "&e&lPlayer Join &9&m&l*-&r &e%player% さんが参加しました! &7(%player count% PLAYERS)"
  20. command "execute @a ~ ~ ~ playsound entity.player.levelup master @s"
  21. achievement(player)
  22. if mod({joinsystem::%{_p}%::count},50) is 0:
  23. broadcast " &a&l%{joinsystem::%{_p}%::count}%回目の参加です!"
  24.  
  25. on quit:
  26. set quit message to "&c&lPlayer Quit &9&m&l*-&r &c%player% さんが退出しました。 &7(%player count% PLAYERS)"
  27. command "execute @a ~ ~ ~ playsound entity.creeper.primed master @s"
  28.  
  29. command /chatsystem-reset <offline player>:
  30. permission: chatsystem.chatsystem-reset
  31. trigger:
  32. set {chatsystem::%arg 1%::prefix} to "&8[ - ]&7"
  33. set {chatsystem::%arg 1%::suffix} to "&f@Guest"
  34.  
  35. command /skr:
  36. permission: skript.admin
  37. trigger:
  38. execute player command "skript reload scripts"
  39.  
  40. # 【称号システム】関数の使い方
  41. # on load: のあと、wait a tick を挟んでから各関数を実行してください。
  42. # //////////////////////////
  43. #・実績を追加する
  44. # addacv(実績ID、実績名、実績獲得を判断する変数、実績獲得を判断する数字、獲得経験値)
  45. # 実績名にカラーコードは使わないでください。
  46. # たとえば『10回プレイする』のような称号のとき、
  47. # 「実績獲得を判断する変数」とはプレイ回数を保存している変数名(@pでプレイヤー名に置き換え)。
  48. # 「実績獲得を判断する数字」とはプレイ回数が何回以上で達成か(この場合は10)。
  49. # このとき記述する関数は、
  50. # addacv("play10", "10回プレイする", "player::%player%::playcount", 10, 100)
  51. # のようになります。
  52. # //////////////////////////
  53. #・称号を追加する
  54. # addtitle(称号ID, 称号名, 獲得に必要な実績のID, 未解禁のとき称号名を隠すかどうか)
  55. # 実績と称号はIDを被らせても問題ありません。
  56. # 称号名はカラーコードを使っても構いません。
  57. # 基本的には称号名は &8&l[ &8&l] で囲ってください。
  58. # 未解禁のとき称号名を隠すかどうかはtrue/falseで書いてください。
  59. # 関数例:
  60. # addtitle("play10", "&8&l[&a中級者&8&l]", "play10", false)
  61. # //////////////////////////
  62. #・称号一覧での称号の位置を設定すsる
  63. # settitle(称号ID, ページ, X位置, Y位置)
  64. # X位置は1~9、Y位置は1~5。
  65. # 関数例:
  66. # settitle("play10", 1, 1, 1)
  67. # //////////////////////////
  68. #・実績を獲得させる
  69. # achievement(プレイヤー)
  70. # 実績を獲得する処理が入った関数です
  71. # 実績を獲得する可能性のあるタイミングで実行してください
  72.  
  73. function addacv(id: string, name: string, var: string, count: number, exp: integer):
  74. set {acvsystem::acvs::%{_id}%} to {_id}
  75. set {acvsystem::acvs::%{_id}%::name} to {_name}
  76. set {acvsystem::acvs::%{_id}%::var} to {_var}
  77. set {acvsystem::acvs::%{_id}%::count} to {_count}
  78. set {acvsystem::acvs::%{_id}%::exp} to {_exp}
  79.  
  80. function addtitle(id: string, name: string, acvid: string, hide: boolean):
  81. set {acvsystem::titles::%{_id}%} to {_id}
  82. set {acvsystem::titles::%{_id}%::name} to {_name}
  83. set {acvsystem::titles::%{_id}%::acvid} to {_acvid}
  84. set {acvsystem::titles::%{_id}%::hide} to {_hide}
  85.  
  86. function settitle(id: string, page: int, x: int, y: int):
  87. set {acvsystem::titlepos::%{_page}%::%{_x}%::%{_y}%} to {_id}
  88.  
  89. function achievement(p: player):
  90. loop {acvsystem::acvs::*}:
  91. set {_var} to {acvsystem::acvs::%loop-index%::var}
  92. replace "@p" in {_var} with "%{_p}%"
  93. if {%{_var}%} > {acvsystem::acvs::%loop-index%::count}:
  94. {acvsystem.player::%{_p}%::acv::%loop-index%} is not set
  95. add 1 to {acvsystem.player::%{_p}%::acv::%loop-index%}
  96. broadcast "&c&lAchievement &9&m&l*-&r &e%{_p}%さんが実績&6&l「%{acvsystem::acvs::%loop-index%::name}%」&eを達成しました!"
  97. message "&6&l[ &d&l&n実績達成&6&l ]" to {_p}
  98. message "&e・%{acvsystem::acvs::%loop-index%::name}%" to {_p}
  99. loop {acvsystem::titles::*}:
  100. {acvsystem::titles::%loop-index-2%::acvid} is loop-index-1
  101. message "&a称号 %{acvsystem::titles::%loop-index-2%::name}%&a を手に入れた" to {_p}
  102. message "&a&l%{acvsystem::acvs::%loop-index%::exp}%EXP &aを手に入れた" to {_p}
  103. add {acvsystem::acvs::%loop-index%::exp} to {lvsystem::%{_p}%::exp}
  104. levelup({_p})
  105.  
  106. command /achievement:
  107. permission: acvsystem.achievement
  108. trigger:
  109. achievement(player)
  110.  
  111. command /achievementreset:
  112. permission: acvsystem.achievementreset
  113. trigger:
  114. clear {acvsystem.player::%player%::*}
  115.  
  116. command /acv [<integer>]:
  117. trigger:
  118. achievement(player)
  119. set {_arg1} to arg 1
  120. if {_arg1} is not set:
  121. set {_arg1} to 1
  122. open chest with 6 rows named "&cAchievements & Titles &7(Page %{_arg1}%)" to player
  123. wait 1 tick
  124. set slot 45 of player's current inventory to arrow named "&7<< Prev" with lore "&fPage: %({_arg1}-1)%"
  125. set slot 53 of player's current inventory to arrow named "&7Next >>" with lore "&fPage: %({_arg1}+1)%"
  126. loop 45 times:
  127. set {_cnt} to loop-number - 1
  128. set {_x} to mod({_cnt}, 9) + 1
  129. set {_y} to floor({_cnt}/9) + 1
  130. if {acvsystem::titlepos::%{_arg1}%::%{_x}%::%{_y}%} is set:
  131. set {_id} to {acvsystem::titlepos::%{_arg1}%::%{_x}%::%{_y}%}
  132. set {_acvid} to {acvsystem::titles::%{_id}%::acvid}
  133. if {acvsystem.player::%player%::acv::%{_acvid}%} >= 1:
  134. set slot {_cnt} of player's current inventory to light green stained glass pane named colored {acvsystem::titles::%{_id}%::name} with lore "&7解禁条件:" and " &6実績「%{acvsystem::acvs::%{_acvid}%::name}%」"
  135. else:
  136. if {acvsystem::titles::%{_id}%::hide} is false:
  137. set slot {_cnt} of player's current inventory to red stained glass pane named "&0%uncolored {acvsystem::titles::%{_id}%::name}%" with lore "&7解禁条件:" and " &e実績「%{acvsystem::acvs::%{_acvid}%::name}%」"
  138. else:
  139. set slot {_cnt} of player's current inventory to red stained glass pane named "&0???" with lore "&7解禁条件:" and " &c実績「%{acvsystem::acvs::%{_acvid}%::name}%」"
  140.  
  141. on inventory click:
  142. if name of player's current inventory contains "&cAchievements & Titles":
  143. cancel event
  144. if clicked slot is 45 or 53:
  145. set {_clickedslot} to clicked slot
  146. set {_page::*} to lore of slot {_clickedslot} of player's current inventory
  147. set {_.page::*} to {_page::1} parsed as "%text% %number%"
  148. execute player command "/acv %{_.page::2}%"
  149. stop
  150. set {_..page::*} to name of player's current inventory split by " "
  151. set {_..page::5::*} to {_..page::5} parsed as "%integer%%string%"
  152. set {_page} to {_..page::5::1}
  153. set {_cnt} to clicked slot
  154. set {_x} to mod({_cnt}, 9) + 1
  155. set {_y} to floor({_cnt}/9) + 1
  156. if {acvsystem::titlepos::%{_page}%::%{_x}%::%{_y}%} is set:
  157. set {_id} to {acvsystem::titlepos::%{_page}%::%{_x}%::%{_y}%}
  158. set {_acvid} to {acvsystem::titles::%{_id}%::acvid}
  159. if {acvsystem.player::%player%::acv::%{_acvid}%} >= 1:
  160. message "&c&lAchievement &9&m&l*-&r &a称号を設定しました"
  161. command "prefix %player% %{acvsystem::titles::%{_id}%::name}%"
  162. else:
  163. message "&c&lAchievement &9&m&l*-&r &cこの称号は未解禁です"
  164.  
  165. function levelup(p: player):
  166. set {_lvup} to floor((30+{lvsystem::%{_p}%::level}*5)^1.2)
  167. {lvsystem::%{_p}%::exp} > {_lvup}
  168. add 1 to {lvsystem::%{_p}%::level}
  169. remove {_lvup} from {lvsystem::%{_p}%::exp}
  170. broadcast "&a&lLevel Up &9&m&l*-&r &e%{_p}%のレベルは&l&n%{lvsystem::%{_p}%::level}%&eに上がった! &b&lおめでとう!"
  171. levelup({_p})
  172.  
  173. command /prefix <offline player> <text>:
  174. permission: chatsystem.prefix
  175. trigger:
  176. evaluate "set {chatsystem::%arg 1%::prefix} to ""%colored arg 2%"""
  177.  
  178. command /suffix <offline player> <text>:
  179. permission: chatsystem.suffix
  180. trigger:
  181. evaluate "set {chatsystem::%arg 1%::suffix} to ""%colored arg 2%"""
  182.  
  183. on chat:
  184. cancel event
  185. set {_prefix} to {chatsystem::%player%::prefix}
  186. set {_suffix} to {chatsystem::%player%::suffix}
  187. loop all players:
  188. set {_message} to message
  189. replace "@%loop-player%" in {_message} with "&b&l@%loop-player%&6"
  190. if message contains "@%loop-player%":
  191. message "%{_prefix}%%player%%{_suffix}% &8&m&l-&r &6%{_message}%" to loop-player
  192. command "execute %loop-player% ~ ~ ~ playsound minecraft:block.note.xylophone master @s ~ ~ ~ 1 1.9"
  193. wait a tick
  194. command "execute %loop-player% ~ ~ ~ playsound minecraft:block.note.xylophone master @s ~ ~ ~ 1 1.8"
  195. wait a tick
  196. command "execute %loop-player% ~ ~ ~ playsound minecraft:block.note.xylophone master @s ~ ~ ~ 1 1.7"
  197. else:
  198. message "%{_prefix}%%player%%{_suffix}% &8&m&l-&r %{_message}%" to loop-player
Advertisement
Add Comment
Please, Sign In to add comment