Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /skteam [<text>] [<text>] [<text>]:
- permission: skteam
- trigger:
- if arg-1 is not set:
- send "&a&l[SKTeam]&r&cコマンドの使い方が違います /skteam helpで使い方を表示します"
- else if arg-1 is "add":
- if arg-2 is not set:
- send "&a&l[Team]&r&c追加するチーム名を入力してください(例:/skteam add 赤チーム)"
- else:
- if {skteam::%arg-2%} is not set:
- send "&a&l[SKTeam]&r&b「%arg-2%」をチームとして登録しました"
- set {skteam::%arg-2%} to 0
- else:
- send "&a&l[SKTeam]&r&c「%arg-2%」は既にチームとして登録されています"
- else if arg-1 is "remove":
- if arg-2 is not set:
- send "&a&l[SKTeam]&r&c削除するチーム名を入力してください(例:/skteam remove 赤チーム)"
- else:
- if {skteam::%arg-2%} is not set:
- send "&a&l[SKTeam]&r&c指定したチーム名が登録されていません"
- else:
- delete {skteam::%arg-2%}
- delete {skteam.team.color.%arg-2%}
- delete {skteam.team.spawnpoint.%arg-2%}
- send "&a&l[SKTeam]&r&b「%arg-2%」の削除をしました"
- loop all players:
- if {skteam.player.team.%loop-player's uuid%} is set:
- removePlayer(loop-player)
- else if arg-1 is "list":
- set {_teamnum} to size of {skteam::*}
- if {_teamnum} = 0:
- send "&a&l[SKTeam]&r&b現在登録されているチームはありません"
- else:
- send "&a&l[SKTeam]&r&b現在登録されているチーム数:%size of {skteam::*}%"
- send "&a---------------------"
- loop {skteam::*}:
- if {skteam.team.color.%loop-index%} is set:
- set {_colorStatus} to colored "&a[カラーコード:登録済み(%{skteam.team.color.%loop-index%}%このように表示されます&a)]"
- else:
- set {_colorStatus} to colored "&c[カラーコード:未登録]"
- if {skteam.team.spawnpoint.%loop-index%} is set:
- set {_spawnpointStatus} to "&a[スポーン地点:登録済み"
- set {_spawnpointCommand} to text component from "&d(ここをクリックで設定した地点にテレポートします)"
- set click event of {_spawnpointCommand} to a new click event to run command "/skteam teleport %loop-index%"
- else:
- set {_spawnpointStatus} to colored "&c[スポーン地点:未登録]"
- send "&r&b[%loop-index%]"
- send "[現在の人数]:%loop-value%"
- send {_colorStatus}
- send {_spawnpointStatus}
- if {_spawnpointCommand} is set:
- send component {_spawnpointCommand}
- send "&a---------------------"
- else if arg-1 is "teleport":
- teleport player to {skteam.team.spawnpoint.%arg-2%}
- else if arg-1 is "setplayer":
- if arg-2 is not set:
- send "&a&l[SKTeam]&r&cチームに入れるプレイヤー、チーム名を指定してください(例:/skteam setplayer プレイヤー名 チーム名)"
- else if arg-3 is not set:
- send "&a&l[SKTeam]&r&cチームに入れるプレイヤー、チーム名を指定してください(例:/skteam setplayer プレイヤー名 チーム名)"
- else:
- set {_player} to arg-2 parsed as player
- if {_player} is online:
- if {skteam::%arg-3%} is not set:
- send "&a&l[SKTeam]&r&c入力したチームが登録されていません"
- else:
- send "&a&l[SKTeam]&r&b%{_player}%を「%arg-3%」に入れました"
- removePlayer({_player})
- add 1 to {skteam::%arg-3%}
- set {skteam.player.team.%{_player}'s uuid%} to arg-3
- updatePlayer({_player})
- else:
- send "&a&l[SKTeam]&r&c指定したプレイヤー(%arg-2%)がオンラインではありません"
- else if arg-1 is "setplayerrandom":
- if size of {skteam::*} = 0:
- send "&a&l[SKTeam]&r&cまだチームが一つも登録されていません。/skteam add <チーム名>でチームを登録してください"
- else:
- set {_player} to arg-2 parsed as player
- if {_player} is online:
- removePlayer({_player})
- set {_num} to 0
- loop {skteam::*}:
- if {_num} = 0:
- set {_onlinenum} to loop-value
- set {_result} to loop-index
- else:
- if loop-value <= {_onlinenum}:
- set {_rnd} to random integer between 1 and 2
- if {_rnd} = 1:
- continue
- set {_onlinenum} to loop-value
- set {_result} to loop-index-1
- add 1 to {_num}
- set {skteam.player.team.%{_player}'s uuid%} to {_result}
- add 1 to {skteam::%{_result}%}
- send "&a&l[SKTeam]&e「%{_result}%」&aチームになりました" to {_player}
- updatePlayer({_player})
- else:
- send "&a&l[SKTeam]&r&c指定したプレイヤー(%arg-2%)がオンラインではありません"
- else if arg-1 is "setallplayer":
- if size of {skteam::*} = 0:
- send "&a&l[SKTeam]&r&cまだチームが一つも登録されていません。/skteam add <チーム名>でチームを登録してください"
- else:
- broadcast "&a&l[SKTeam]&r&a全員にチームを割り当てました"
- set {_num} to 0
- loop all players:
- set {_p::%{_num}%} to loop-player
- removePlayer(loop-player)
- add 1 to {_num}
- set {_num} to size of {_p::*}
- loop {_num} times:
- set {_p} to random element out of {_p::*}
- loop {skteam::*}:
- if loop-number-2 = 0:
- set {_onlinenum} to loop-value-2
- set {_result} to loop-index-1
- else:
- if loop-value-2 <= {_onlinenum}:
- set {_rnd} to random integer between 1 and 2
- if {_rnd} = 1:
- continue
- set {_onlinenum} to loop-value-2
- set {_result} to loop-index-1
- set {skteam.player.team.%{_p}'s uuid%} to {_result}
- add 1 to {skteam::%{_result}%}
- send "&a&l[SKTeam]あなたは&e「%{_result}%」&aチームになりました" to {_p}
- remove {_p} from {_p::*}
- updatePlayers()
- else if arg-1 is "removeplayer":
- if arg-2 is not set:
- send "&a&l[SKTeam]&r&cチームに入れるプレイヤー、チーム名を指定してください(例:/skteam setplayer プレイヤー名 チーム名)"
- else:
- set {_p} to arg-2 parsed as player
- if {_p} is online:
- if {skteam.player.team.%{_p}'s uuid%} is not set:
- send "&a&l[SKTeam]&r&c指定したプレイヤー(%{_p}%)はチームに入っていません"
- else:
- removePlayer({_p})
- send "&a&l[SKTeam]&r&bプレイヤー(%{_p}%)をチームから外しました"
- else:
- send "&a&l[SKTeam]&r&cプレイヤーがオンラインではありません"
- else if arg-1 is "removeallplayer":
- loop all players:
- removePlayer(loop-player)
- broadcast "&a&l[SKTeam]&r&a全員をチームから外しました"
- else if arg-1 is "setcolor":
- if arg-2 is not set:
- send "&a&l[SKTeam]&r&cカラーコード、チーム名を指定してください(例:/skteam setcolor カラーコード チーム名)"
- else if arg-3 is not set:
- send "&a&l[SKTeam]&r&cカラーコード、チーム名を指定してください(例:/skteam setcolor カラーコード チーム名)"
- else:
- if {skteam::%arg-3%} is not set:
- send "&a&l[SKTeam]&r&c入力したチームが登録されていません"
- else:
- send "&a&l[SKTeam]&r&bカラーを設定しました"
- set {skteam.team.color.%arg-3%} to arg-2
- updatePlayers()
- else if arg-1 is "setspawn":
- if arg-2 is not set:
- send "&a&l[SKTeam]&r&cチーム名を指定してください(例:/skteam setspawn チーム名)"
- else:
- if {skteam::%arg-2%} is not set:
- send "&a&l[SKTeam]&r&cチーム名が登録されていません"
- else:
- send "&a&l[SKTeam]&r&b「%arg-2%」のスポーン地点をセットしました"
- set {skteam.team.spawnpoint.%arg-2%} to player's location
- else if arg-1 is "removespawn":
- if arg-2 is not set:
- send "&a&l[SKTeam]&r&cチーム名を指定してください(例:/skteam removespawn チーム名)"
- else:
- if {skteam::%arg-2%} is not set:
- send "&a&l[SKTeam]&r&cチーム名が登録されていません"
- else:
- if {skteam.team.spawnpoint.%arg-2%} is set:
- send "&a&l[SKTeam]&r&b「%arg-2%」のスポーン地点を削除しました"
- delete {skteam.team.spawnpoint.%arg-2%}
- else:
- send "&a&l[SKTeam]&r&c「%arg-2%」のスポーン地点はまだ登録されていません"
- else if arg-1 is "tpspawnpoint":
- set {_player} to arg-2 parsed as player
- if {_player} is online:
- if {skteam.team.spawnpoint.%{skteam.player.team.%{_player}'s uuid%}%} is set:
- send "&a&l[SKTeam]&r&bチームのスポーン地点に移動しました" to {_player}
- teleport player to {skteam.team.spawnpoint.%{skteam.player.team.%{_player}'s uuid%}%}
- else if {skteam.player.team.%{_player}'s uuid%} is set:
- send "&a&l[SKTeam]&r&c指定したプレイヤーのチーム(%{skteam.player.team.%{_player}'s uuid%}%)にスポーン地点がセットされていません!"
- else:
- send "&a&l[SKTeam]&r&c指定したプレイヤー(%{_player}%)はチームに入っていません!"
- else:
- send "&a&l[SKTeam]&r&c指定したプレイヤー(%{_player}%)がオンラインではありません"
- else if arg-1 is "friendlyFire":
- if arg-2 is not set:
- if {skteam.friendlyFire} is set:
- send "&a&l[SKTeam]現在フレンドリーファイアは&bON&aになっています"
- else:
- send "&a&l[SKTeam]現在フレンドリーファイアは&bOFF&aになっています"
- if arg-2 is "on":
- set {skteam.friendlyFire} to true
- send "&a&l[SKTeam]フレンドリーファイアを&bON&aにしました"
- if arg-2 is "off":
- delete {skteam.friendlyFire}
- send "&a&l[SKTeam]フレンドリーファイアを&bOFF&aにしました"
- else if arg-1 is "help":
- if arg-2 is not set:
- send "&a&l[SKTeam]&r&bSKTeamの使い方 <1ページ目>"
- send "&a---------------------"
- send "&e/skteam add <チーム名>:&dチームを登録します"
- send "&e/skteam remove <チーム名>:&dチームを削除します"
- send "&e/skteam list:&d登録されている全てのチームの情報を表示します"
- send "&e/skteam setplayer <プレイヤー名> <チーム名>:&d指定したプレイヤーをチームに入れます"
- send "&e/skteam setplayerrandom <プレイヤー名>:&d指定したプレイヤーをランダムなチームに入れます"
- send "&e/skteam setallplayer:&d全員をランダムなチームに入れます"
- send "&e/skteam removeplayer <プレイヤー名>:&d指定したプレイヤーをチームから外します"
- send "&e/skteam removeallplayer:&d全員をチームから外します"
- set {_nexthelp} to text component from "&b&l(ここをクリックで次のページを表示します)"
- set click event of {_nexthelp} to a new click event to run command "/skteam help 2"
- send component {_nexthelp}
- else if arg-2 is "2":
- send "&a&l[SKTeam]&r&bSKTeamの使い方 <2ページ目>"
- send "&a---------------------"
- send "&e/skteam tpspawnpoint <プレイヤー名>:&d指定したプレイヤーをチームのスポーン地点にテレポートさせます"
- send "&e/skteam setcolor <カラーコード> <チーム名>:&dカラーコードを入力することでそのチームに色を付けます(チャット欄、ネームタグ、タブリスト)"
- send "&e/skteam setspawn <チーム名>:&dそのチームがリスポーンする場所を設定できます このコマンドを入力した時の場所が登録されます"
- send "&e/skteam removespawn <チーム名>:&dリスポーン地点が設定されている場合、削除することが出来ます"
- send "&e/skteam friendlyFire <on/off>:&d同じチーム同士の攻撃を有効化あるいは無効化するか選べます"
- on tab complete of "/skteam":
- set tab completions for position 1 to "add" and "remove" and "list" and "setplayer" and "setplayerrandom" and "removeplayer" and "setcolor" and "setspawn" and "removespawn" and "help" and "friendlyFire" and "tpspawnpoint"
- if tab arg-1 is "remove":
- set tab completions for position 2 to indexes of {skteam::*}
- if tab arg-1 is "setplayer":
- set tab completions for position 2 to all players
- set tab completions for position 3 to indexes of {skteam::*}
- if tab arg-1 is "setplayerrandom":
- set tab completions for position 2 to all players
- if tab arg-1 is "removeplayer":
- set tab completions for position 2 to all players
- if tab arg-1 is "setcolor":
- set tab completions for position 3 to indexes of {skteam::*}
- if tab arg-1 is "setspawn":
- set tab completions for position 2 to indexes of {skteam::*}
- if tab arg-1 is "removespawn":
- set tab completions for position 2 to indexes of {skteam::*}
- if tab arg-1 is "friendlyFire":
- set tab completions for position 2 to "on" and "off"
- if tab arg-1 is "tpspawnpoint":
- set tab completions for position 2 to all players
- function updatePlayers():
- loop all players:
- if {skteam.player.team.%loop-player's uuid%} is set:
- set {_team} to {skteam.player.team.%loop-player's uuid%}
- if {skteam.team.color.%{_team}%} is set:
- set the loop-player's tablist name to colored "%{skteam.team.color.%{_team}%}%[%{_team}%]%loop-player%"
- set the loop-player's display name to colored "%{skteam.team.color.%{_team}%}%[%{_team}%]%loop-player%"
- else:
- set the loop-player's tablist name to "[%{_team}%]%loop-player%"
- set the loop-player's display name to "[%{_team}%]%loop-player%"
- function updatePlayer(p: player):
- if {skteam.player.team.%{_p}'s uuid%} is set:
- set {_team} to {skteam.player.team.%{_p}'s uuid%}
- if {skteam.team.color.%{_team}%} is set:
- set {_p}'s tablist name to colored "%{skteam.team.color.%{_team}%}%[%{_team}%]%{_p}%"
- set {_p}'s display name to colored "%{skteam.team.color.%{_team}%}%[%{_team}%]%{_p}%"
- else:
- set {_p}'s tablist name to "[%{_team}%]%{_p}%"
- set {_p}'s display name to "[%{_team}%]%{_p}%"
- function removePlayer(p: player):
- if {skteam.player.team.%{_p}'s uuid%} is set:
- remove 1 from {skteam::%{skteam.player.team.%{_p}'s uuid%}%}
- delete {skteam.player.team.%{_p}'s uuid%}
- set {_p}'s tablist name to "%{_p}%"
- set {_p}'s display name to "%{_p}%"
- on chat:
- if {skteam.player.team.%player's uuid%} is set:
- if {skteam.team.color.%{skteam.player.team.%player's uuid%}%} is set:
- set chat format to colored "%{skteam.team.color.%{skteam.player.team.%player's uuid%}%}%[%{skteam.player.team.%player's uuid%}%]%player% &6>> &r %message%"
- else:
- set chat format to "[%{skteam.player.team.%player's uuid%}%]%player% &6>> &r %message%"
- else:
- set chat format to "%player% &6>> &r %message%"
- on respawn:
- if {skteam.team.spawnpoint.%{skteam.player.team.%player's uuid%}%} is set:
- set respawn location to {skteam.team.spawnpoint.%{skteam.player.team.%player's uuid%}%}
- on leave:
- removePlayer(player)
- on damage:
- if attacker is player:
- if victim is player:
- if {skteam.player.team.%victim's uuid%} = {skteam.player.team.%attacker's uuid%}:
- if {skteam.player.team.%victim's uuid%} is set:
- if {skteam.friendlyFire} is not set:
- cancel event
- on rightclick holding a lime dye:
- if {skteam.player.team.%player's uuid%} is not set:
- if size of {skteam::*} = 0:
- send "&a&l[SKTeam]&r&cチーム分けが出来ない状態です!運営が対応するまでお待ちください" to player
- else:
- removePlayer(player)
- set {_num} to 0
- loop {skteam::*}:
- if {_num} = 0:
- set {_onlinenum} to loop-value
- set {_result} to loop-index
- else:
- if loop-value <= {_onlinenum}:
- set {_rnd} to random integer between 1 and 2
- if {_rnd} = 1:
- continue
- set {_onlinenum} to loop-value
- set {_result} to loop-index-1
- add 1 to {_num}
- set {skteam.player.team.%player's uuid%} to {_result}
- add 1 to {skteam::%{_result}%}
- send "&a&l[SKTeam]&e「%{_result}%」&aチームになりました" to player
- updatePlayer(player)
- if {skteam.team.spawnpoint.%{_result}%} is set:
- teleport player to {skteam.team.spawnpoint.%{_result}%}
- on rightclick holding a red dye:
- if {skteam.player.team.%player's uuid%} is set:
- removePlayer(player)
- send "&a&l[SKTeam]&e&aチームから外れました" to player
- command /setkillreward:
- permission: skteam
- trigger:
- set {killReward} to player's held item
- send "&a&l[KillReward]&r&b%{killReward}%をキル報酬に設定しました"
- on death of player:
- if attacker is player:
- if {killReward} is set:
- give {killReward} to attacker
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement