Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Variables:
- {r.mem::*} = 0
- {b.mem::*} = 0
- {tfb.rsp} = 0
- {tfb.rp} = 0
- {tfb.bsp} = 0
- {tfb.bp} = 0
- {%player%.tfbj} = 0
- {tfb.st} = 0
- {tfb.timer} = 0
- {tfb.plx} = 0
- {tfb.ply} = 0
- {tfb.plz} = 0
- command /tfbsp <int> [<int>] [<int>] [<int>]:
- permission: skript.admin
- trigger:
- if arg 1 is 1:
- set {tfb.rsp} to player's location
- if arg 1 is 2:
- set {tfb.bsp} to player's location
- if arg 1 is 3:
- set {tfb.plx} to arg 2
- set {tfb.ply} to arg 3
- set {tfb.plz} to arg 4
- command /tfb <text> [<player>]:
- trigger:
- if arg 1 is "reset":
- set {tfbct} to 0
- loop size of {r.mem::*} times:
- set {%{r.mem::%{tfbct}%}%.tfbj} to 0
- set {tfbct} to {tfbct} + 1
- set {%{r.mem::%{tfbct}%}%.tfbj} to 0
- set {tfbct} to 0
- loop size of {b.mem::*} times:
- set {%{b.mem::%{tfbct}%}%.tfbj} to 0
- set {tfbct} to {tfbct} + 1
- set {%{b.mem::%{tfbct}%}%.tfbj} to 0
- delete {r.mem::*}
- delete {b.mem::*}
- set {tfb.bp} to 0
- set {tfb.rp} to 0
- set {%arg 2%.tfbj} to 0
- set {tfb.st} to 0
- set {tfb.timer} to 0
- if arg 1 is "begin":
- if {tfb.st} is not 0:
- message "既に始まっています!"
- if {tfb.st} is 0:
- set {tfb.st} to 1
- broadcast "&6&l占領チーム戦&b&lが始まります!&a&l/tfb joinしよう!"
- if arg 1 is "join":
- if {tfb.st} is 1:
- if size of {r.mem::*} is size of {b.mem::*}:
- if {%player%.tfbj} is not 0:
- message "You already joined"
- if {%player%.tfbj} is 0:
- add player to {r.mem::*}
- set {%player%.tfbj} to 1
- broadcast "%player% さんが赤チームに入りました!"
- if size of {r.mem::*} is more than size of {b.mem::*}:
- if {%player%.tfbj} is not 0:
- message "You already joined"
- if {%player%.tfbj} is 0:
- add player to {b.mem::*}
- set {%player%.tfbj} to 1
- broadcast "%player% さんが青チームに入りました!"
- if size of {r.mem::*} is less than size of {b.mem::*}:
- if {%player%.tfbj} is 0:
- add player to {r.mem::*}
- set {%player%.tfbj} to 1
- if {%player%.tfbj} is not 0:
- message "You already joined"
- every seconds:
- if {tfb.st} is 1:
- set {tfb.timer} to {tfb.timer} + 1
- if {tfb.timer} is more than 120:
- broadcast "ゲームが始まりますよ!"
- set {tfbct} to 0
- loop size of {b.mem::*} times:
- teleport {b.mem::%{tfbct}%} to {tfb.bsp}
- set {tfbct} to {tfbct} + 1
- teleport {b.mem::%{tfbct}%} to {tfb.bsp}
- set {tfbct} to 0
- loop size of {r.mem::*} times:
- teleport {r.mem::%{tfrct}%} to {tfr.bsp}
- set {tfbct} to {tfbct} + 1
- teleport {r.mem::%{tfrct}%} to {tfr.bsp}
- set {tfb.st} to 2
- set {tfb.timer} to 0
- if {tfb.st} is 2:
- set {tfb.timer} to {tfb.timer} + 1
- loop all players:
- if block below loop-player is wool:
- if {r.mem::*} contains loop-player:
- set {tfb.rp} to {tfb.rp} + 1
- set {_tfb.wr} to 1
- execute console command "/setblock %{tfb.plx}% %{tfb.ply}% %{tfb.plz}% wool 14"
- if {b.mem::*} contains loop-player:
- set {tfb.bp} to {tfb.bp} + 1
- set {_tfb.wb} to 1
- execute console command "/setblock %{tfb.plx}% %{tfb.ply}% %{tfb.plz}% wool 3"
- if {_tfb.wr} is 0:
- if {_tfb.wb} is 0:
- execute console command "/setblock %{tfb.plx}% %{tfb.ply}% %{tfb.plz}% wool"
- {_tps} = {tfb.rp} + {tfb.bp}
- {_atps} = 100 / {_tps}
- {_rps} = {tfb.rp} * {_atps}
- {_bps} = {tfb.bp} * {_atps}
- if {_rps} is more than 0:
- if {_rps} is less than 10:
- send actionbar "&c&l%{tfb.rp}%■■■■■■■■■&b&l■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
- if {_rps} is more than 10:
- if {_rps} is less than 20:
- send actionbar "&c&l%{tfb.rp}%■■■■■■■■&b&l■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
- if {_rps} is more than 20:
- if {_rps} is less than 30:
- send actionbar "&c&l%{tfb.rp}%■■■■■■■&b&l■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
- if {_rps} is more than 30:
- if {_rps} is less than 40:
- send actionbar "&c&l%{tfb.rp}%■■■■■■&b&l■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
- if {_rps} is more than 40:
- if {_rps} is less than 50:
- send actionbar "&c&l%{tfb.rp}%■■■■■&b&l■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
- if {_rps} is more than 50:
- if {_rps} is less than 60:
- send actionbar "&c&l%{tfb.rp}%■■■■&b&l■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
- if {_rps} is more than 60:
- if {_rps} is less than 70:
- send actionbar "&c&l%{tfb.rp}%■■■&b&l■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
- if {_rps} is more than 70:
- if {_rps} is less than 80:
- send actionbar "&c&l%{tfb.rp}%■■&b&l■■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
- if {_rps} is more than 80:
- if {_rps} is less than 90:
- send actionbar "&c&l%{tfb.rp}%■&b&l■■■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
- if {_rps} is more than 90:
- if {_rps} is less than 100:
- send actionbar "&c&l%{tfb.rp}%&b&l■■■■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
- if {_rps} is 100:
- send actionbar "&c&l%{tfb.rp}%&b&l■■■■■■■■■■%{tfb.bp}% capstat: &c&l%{_tfb.wr}% &b&l%{_tfb.wb}%" to all players
- if {tfb.st} is 300:
- if {tfb.rp} is more than {tfb.bp}:
- broadcast "終了です! 結果は... &a&l青%{tfb.bp}% &c&l赤%{tfb.rp}% &aよって、赤の勝ちです! /sp で戻ってね!"
- if {tfb.rp} is less than {tfb.bp}:
- broadcast "終了です! 結果は... &a&l青%{tfb.bp}% &c&l赤%{tfb.rp}% &aよって、青の勝ちです! /sp で戻ってね!"
- if {tfb.rp} is {tfb.bp}:
- broadcast "終了です! 結果は... &a&l青%{tfb.bp}% &c&l赤%{tfb.rp}% &aよって、引き分けです! /sp で戻ってね!"
- set {tfbct} to 0
- loop size of {r.mem::*} times:
- set {%{r.mem::%{tfbct}%}%.tfbj} to 0
- set {tfbct} to {tfbct} + 1
- set {%{r.mem::%{tfbct}%}%.tfbj} to 0
- set {tfbct} to 0
- loop size of {b.mem::*} times:
- set {%{b.mem::%{tfbct}%}%.tfbj} to 0
- set {tfbct} to {tfbct} + 1
- set {%{b.mem::%{tfbct}%}%.tfbj} to 0
- delete {r.mem::*}
- delete {b.mem::*}
- set {tfb.bp} to 0
- set {tfb.rp} to 0
- On damage:
- if {r.mem::*} contains victim:
- if {r.mem::*} contains attacker:
- cancel event
- if {b.mem::*} contains victim:
- if {b.mem::*} contains attacker:
- cancel event
- On death:
- if {b.mem::*} contains attacker:
- set {tfb.bp} to {tfb.bp} + 2
- if {r.mem::*} contains attacker:
- set {tfb.bp} to {tfb.bp} + 2
Add Comment
Please, Sign In to add comment