Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on load:
- clear {acvsystem::*}
- on join:
- set {_p} to player
- set {lvsystem::%{_p}%::exp} to 0 if {lvsystem::%{_p}%::exp} is not set
- set {lvsystem::%{_p}%::level} to 1 if {lvsystem::%{_p}%::level} is not set
- set {chatsystem::%{_p}%::prefix} to "&7" if {chatsystem::%{_p}%::prefix} is not set
- set {chatsystem::%{_p}%::suffix} to "&f@Guest" if {chatsystem::%{_p}%::suffix} is not set
- add 1 to {joinsystem::%{_p}%::count}
- if {joinsystem::%{_p}%::count} is 1:
- set {chatsystem::%{_p}%::prefix} to "&7"
- set {chatsystem::%{_p}%::suffix} to "&f@Guest"
- set join message to "&e&lPlayer Join &9&m&l*-&r &d%player% さんが初めて参加しました! &7(%player count% PLAYERS)"
- command "execute @a ~ ~ ~ playsound entity.player.levelup master @s ~ ~ ~ 1 0.5"
- achievement(player)
- else:
- set join message to "&e&lPlayer Join &9&m&l*-&r &e%player% さんが参加しました! &7(%player count% PLAYERS)"
- command "execute @a ~ ~ ~ playsound entity.player.levelup master @s"
- achievement(player)
- if mod({joinsystem::%{_p}%::count},50) is 0:
- broadcast " &a&l%{joinsystem::%{_p}%::count}%回目の参加です!"
- on quit:
- set quit message to "&c&lPlayer Quit &9&m&l*-&r &c%player% さんが退出しました。 &7(%player count% PLAYERS)"
- command "execute @a ~ ~ ~ playsound entity.creeper.primed master @s"
- command /chatsystem-reset <offline player>:
- permission: chatsystem.chatsystem-reset
- trigger:
- set {chatsystem::%arg 1%::prefix} to "&8[ - ]&7"
- set {chatsystem::%arg 1%::suffix} to "&f@Guest"
- command /skr:
- permission: skript.admin
- trigger:
- execute player command "skript reload scripts"
- # 【称号システム】関数の使い方
- # on load: のあと、wait a tick を挟んでから各関数を実行してください。
- # //////////////////////////
- #・実績を追加する
- # addacv(実績ID、実績名、実績獲得を判断する変数、実績獲得を判断する数字、獲得経験値)
- # 実績名にカラーコードは使わないでください。
- # たとえば『10回プレイする』のような称号のとき、
- # 「実績獲得を判断する変数」とはプレイ回数を保存している変数名(@pでプレイヤー名に置き換え)。
- # 「実績獲得を判断する数字」とはプレイ回数が何回以上で達成か(この場合は10)。
- # このとき記述する関数は、
- # addacv("play10", "10回プレイする", "player::%player%::playcount", 10, 100)
- # のようになります。
- # //////////////////////////
- #・称号を追加する
- # addtitle(称号ID, 称号名, 獲得に必要な実績のID, 未解禁のとき称号名を隠すかどうか)
- # 実績と称号はIDを被らせても問題ありません。
- # 称号名はカラーコードを使っても構いません。
- # 基本的には称号名は &8&l[ &8&l] で囲ってください。
- # 未解禁のとき称号名を隠すかどうかはtrue/falseで書いてください。
- # 関数例:
- # addtitle("play10", "&8&l[&a中級者&8&l]", "play10", false)
- # //////////////////////////
- #・称号一覧での称号の位置を設定すsる
- # settitle(称号ID, ページ, X位置, Y位置)
- # X位置は1~9、Y位置は1~5。
- # 関数例:
- # settitle("play10", 1, 1, 1)
- # //////////////////////////
- #・実績を獲得させる
- # achievement(プレイヤー)
- # 実績を獲得する処理が入った関数です
- # 実績を獲得する可能性のあるタイミングで実行してください
- function addacv(id: string, name: string, var: string, count: number, exp: integer):
- set {acvsystem::acvs::%{_id}%} to {_id}
- set {acvsystem::acvs::%{_id}%::name} to {_name}
- set {acvsystem::acvs::%{_id}%::var} to {_var}
- set {acvsystem::acvs::%{_id}%::count} to {_count}
- set {acvsystem::acvs::%{_id}%::exp} to {_exp}
- function addtitle(id: string, name: string, acvid: string, hide: boolean):
- set {acvsystem::titles::%{_id}%} to {_id}
- set {acvsystem::titles::%{_id}%::name} to {_name}
- set {acvsystem::titles::%{_id}%::acvid} to {_acvid}
- set {acvsystem::titles::%{_id}%::hide} to {_hide}
- function settitle(id: string, page: int, x: int, y: int):
- set {acvsystem::titlepos::%{_page}%::%{_x}%::%{_y}%} to {_id}
- function achievement(p: player):
- loop {acvsystem::acvs::*}:
- set {_var} to {acvsystem::acvs::%loop-index%::var}
- replace "@p" in {_var} with "%{_p}%"
- if {%{_var}%} > {acvsystem::acvs::%loop-index%::count}:
- {acvsystem.player::%{_p}%::acv::%loop-index%} is not set
- add 1 to {acvsystem.player::%{_p}%::acv::%loop-index%}
- broadcast "&c&lAchievement &9&m&l*-&r &e%{_p}%さんが実績&6&l「%{acvsystem::acvs::%loop-index%::name}%」&eを達成しました!"
- message "&6&l[ &d&l&n実績達成&6&l ]" to {_p}
- message "&e・%{acvsystem::acvs::%loop-index%::name}%" to {_p}
- loop {acvsystem::titles::*}:
- {acvsystem::titles::%loop-index-2%::acvid} is loop-index-1
- message "&a称号 %{acvsystem::titles::%loop-index-2%::name}%&a を手に入れた" to {_p}
- message "&a&l%{acvsystem::acvs::%loop-index%::exp}%EXP &aを手に入れた" to {_p}
- add {acvsystem::acvs::%loop-index%::exp} to {lvsystem::%{_p}%::exp}
- levelup({_p})
- command /achievement:
- permission: acvsystem.achievement
- trigger:
- achievement(player)
- command /achievementreset:
- permission: acvsystem.achievementreset
- trigger:
- clear {acvsystem.player::%player%::*}
- command /acv [<integer>]:
- trigger:
- achievement(player)
- set {_arg1} to arg 1
- if {_arg1} is not set:
- set {_arg1} to 1
- open chest with 6 rows named "&cAchievements & Titles &7(Page %{_arg1}%)" to player
- wait 1 tick
- set slot 45 of player's current inventory to arrow named "&7<< Prev" with lore "&fPage: %({_arg1}-1)%"
- set slot 53 of player's current inventory to arrow named "&7Next >>" with lore "&fPage: %({_arg1}+1)%"
- loop 45 times:
- set {_cnt} to loop-number - 1
- set {_x} to mod({_cnt}, 9) + 1
- set {_y} to floor({_cnt}/9) + 1
- if {acvsystem::titlepos::%{_arg1}%::%{_x}%::%{_y}%} is set:
- set {_id} to {acvsystem::titlepos::%{_arg1}%::%{_x}%::%{_y}%}
- set {_acvid} to {acvsystem::titles::%{_id}%::acvid}
- if {acvsystem.player::%player%::acv::%{_acvid}%} >= 1:
- 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}%」"
- else:
- if {acvsystem::titles::%{_id}%::hide} is false:
- 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}%」"
- else:
- set slot {_cnt} of player's current inventory to red stained glass pane named "&0???" with lore "&7解禁条件:" and " &c実績「%{acvsystem::acvs::%{_acvid}%::name}%」"
- on inventory click:
- if name of player's current inventory contains "&cAchievements & Titles":
- cancel event
- if clicked slot is 45 or 53:
- set {_clickedslot} to clicked slot
- set {_page::*} to lore of slot {_clickedslot} of player's current inventory
- set {_.page::*} to {_page::1} parsed as "%text% %number%"
- execute player command "/acv %{_.page::2}%"
- stop
- set {_..page::*} to name of player's current inventory split by " "
- set {_..page::5::*} to {_..page::5} parsed as "%integer%%string%"
- set {_page} to {_..page::5::1}
- set {_cnt} to clicked slot
- set {_x} to mod({_cnt}, 9) + 1
- set {_y} to floor({_cnt}/9) + 1
- if {acvsystem::titlepos::%{_page}%::%{_x}%::%{_y}%} is set:
- set {_id} to {acvsystem::titlepos::%{_page}%::%{_x}%::%{_y}%}
- set {_acvid} to {acvsystem::titles::%{_id}%::acvid}
- if {acvsystem.player::%player%::acv::%{_acvid}%} >= 1:
- message "&c&lAchievement &9&m&l*-&r &a称号を設定しました"
- command "prefix %player% %{acvsystem::titles::%{_id}%::name}%"
- else:
- message "&c&lAchievement &9&m&l*-&r &cこの称号は未解禁です"
- function levelup(p: player):
- set {_lvup} to floor((30+{lvsystem::%{_p}%::level}*5)^1.2)
- {lvsystem::%{_p}%::exp} > {_lvup}
- add 1 to {lvsystem::%{_p}%::level}
- remove {_lvup} from {lvsystem::%{_p}%::exp}
- broadcast "&a&lLevel Up &9&m&l*-&r &e%{_p}%のレベルは&l&n%{lvsystem::%{_p}%::level}%&eに上がった! &b&lおめでとう!"
- levelup({_p})
- command /prefix <offline player> <text>:
- permission: chatsystem.prefix
- trigger:
- evaluate "set {chatsystem::%arg 1%::prefix} to ""%colored arg 2%"""
- command /suffix <offline player> <text>:
- permission: chatsystem.suffix
- trigger:
- evaluate "set {chatsystem::%arg 1%::suffix} to ""%colored arg 2%"""
- on chat:
- cancel event
- set {_prefix} to {chatsystem::%player%::prefix}
- set {_suffix} to {chatsystem::%player%::suffix}
- loop all players:
- set {_message} to message
- replace "@%loop-player%" in {_message} with "&b&l@%loop-player%&6"
- if message contains "@%loop-player%":
- message "%{_prefix}%%player%%{_suffix}% &8&m&l-&r &6%{_message}%" to loop-player
- command "execute %loop-player% ~ ~ ~ playsound minecraft:block.note.xylophone master @s ~ ~ ~ 1 1.9"
- wait a tick
- command "execute %loop-player% ~ ~ ~ playsound minecraft:block.note.xylophone master @s ~ ~ ~ 1 1.8"
- wait a tick
- command "execute %loop-player% ~ ~ ~ playsound minecraft:block.note.xylophone master @s ~ ~ ~ 1 1.7"
- else:
- message "%{_prefix}%%player%%{_suffix}% &8&m&l-&r %{_message}%" to loop-player
Advertisement
Add Comment
Please, Sign In to add comment