Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SPHERE BATTLE
- #Skript code made by KabanFriends
- #
- #REQUIRED PLUGINS:
- # Skript
- # skript-mirror
- # SkQuery
- # Skellett
- # skript-yaml
- # TuSKe
- # SkUtilities
- # MundoSK
- # HolographicDisplaysAddon
- # ProtocolLib
- # Multiverse-Core
- # HolographicDisplays
- options:
- DefaultLanguage: en_us
- NeededPlayersToStart: 2
- StartingCountdownTime: 30
- RespawnCooldownTime: 3
- MapHandlerName: kfSphereBattleMapHandler
- import:
- org.bukkit.event.player.PlayerSwapHandItemsEvent
- org.bukkit.event.player.PlayerChatEvent
- on script stop:
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- kfsbLeaveGame(loop-player)
- kfsbResetStatus()
- function kfsbSetFacing(player: player, facing: text, location: location):
- if {_facing} is "south":
- set {_yaw} to 360
- set {_pitch} to 0.01
- else if {_facing} is "north":
- set {_yaw} to -180
- set {_pitch} to 0.01
- else if {_facing} is "east":
- set {_yaw} to -90
- set {_pitch} to 0.01
- else if {_facing} is "west":
- set {_yaw} to 90
- set {_pitch} to 0.01
- else if {_facing} is "below":
- set {_yaw} to 0.01
- set {_pitch} to 90
- else if {_facing} is "above":
- set {_yaw} to 0.01
- set {_pitch} to -90
- set yaw of {_location} to {_yaw}
- set pitch of {_location} to {_pitch}
- teleport {_player} to {_location}
- function kfsbDeleteHologram(player: player):
- {kfsb.hologram::%{_player}%} is set
- unregister hologram {kfsb.hologram::%{_player}%}
- delete {kfsb.hologram::%{_player}%}
- function kfsbPlaceHologram(player: player):
- {kfsb.ingame::%{_player}%} is set
- if {kfsb.team::%{_player}%} is "red":
- set {_temp1} to yaml value "hologram-redspawn-1" from {kfsb.lang.%{_player}%}
- set {_temp2} to yaml value "hologram-redspawn-2" from {kfsb.lang.%{_player}%}
- if {kfsb.hologram::%{_player}%} is set:
- kfsbDeleteHologram({_player})
- set {kfsb.hologram::%{_player}%} to new hologram at location 1.5 meter above {kfsb.mapdata.redspawn}
- hide hologram {kfsb.hologram::%{_player}%} from all players
- add text {_temp1} to hologram {kfsb.hologram::%{_player}%}
- add text {_temp2} to hologram {kfsb.hologram::%{_player}%}
- else if {kfsb.team::%{_player}%} is "blue":
- set {_temp1} to yaml value "hologram-bluespawn-1" from {kfsb.lang.%{_player}%}
- set {_temp2} to yaml value "hologram-bluespawn-2" from {kfsb.lang.%{_player}%}
- if {kfsb.hologram::%{_player}%} is set:
- kfsbDeleteHologram({_player})
- set {kfsb.hologram::%{_player}%} to new hologram at location 1.5 meter above {kfsb.mapdata.bluespawn}
- hide hologram {kfsb.hologram::%{_player}%} from all players
- add text {_temp1} to hologram {kfsb.hologram::%{_player}%}
- add text {_temp2} to hologram {kfsb.hologram::%{_player}%}
- set {_temp1} to yaml value "hologram-%{kfsb.team::%{_player}%}%spawn-1" from {kfsb.lang.%{_player}%}
- show hologram {kfsb.hologram::%{_player}%} to {_player}
- function kfsbEndgame():
- set {_temp2} to ""
- loop all players:
- if "%{kfsb.team::%loop-player%}%" is "%{kfsb.winteam}%":
- set {_temp2} to "%{_temp2}% %loop-player%"
- loop all players:
- if {kfsb.ingame::%loop-player%} is set:
- send yaml value "chat-greenbar" from "%{kfsb.lang.%loop-player%}%" to loop-player
- send centered yaml value "chat-winmessage-1" from "%{kfsb.lang.%loop-player%}%" to loop-player
- send centered yaml value "chat-winmessage-2" from "%{kfsb.lang.%loop-player%}%" to loop-player
- send centered yaml value "chat-winmessage-3-%{kfsb.winteam}%" from "%{kfsb.lang.%loop-player%}%" to loop-player
- set {_temp.%loop-player%} to yaml value "chat-winmessage-4" from "%{kfsb.lang.%loop-player%}%"
- replace every "{members}" with {_temp2} in {_temp.%loop-player%}
- send centered {_temp.%loop-player%} to loop-player
- send centered yaml value "chat-winmessage-5" from "%{kfsb.lang.%loop-player%}%" to loop-player
- send yaml value "chat-greenbar" from "%{kfsb.lang.%loop-player%}%" to loop-player
- wait 10 seconds
- kfsbResetGame()
- function kfsbOpenTeleporterGui(player: player):
- set {_size} to size of {kfsb.redalive::*} + size of {kfsb.bluealive::*}
- set {_row} to ceil({_size} / 9) + 1
- if {_player} doesn't have a gui:
- set {_temp} to yaml value "gui-teleporter-title" from {kfsb.lang.%{_player}%}
- set {_guiname} to "%{_temp}%&1&2&3&4&f&r"
- open chest with {_row} row named {_guiname} to {_player}
- inventory name of {_player}'s current inventory contains "&1&2&3&4&f&r"
- create a gui slot 4 of {_player} with barrier named yaml value "item-gui-close-name" from {kfsb.lang.%{_player}%} to close
- set {_slot} to 9
- set {_temp} to yaml value "gui-clicktoteleport" from {kfsb.lang.%{_player}%}
- loop {kfsb.redalive::*}:
- create a gui slot {_slot} of {_player} with skull of ("%loop-value%" parsed as an offline player) named "&c&l[RED]&a %loop-value%" with lore "||%{_temp}%" to close then run function kfsbTeleport({_player}, location of {kfsb.redalive::%loop-index%})
- add 1 to {_slot}
- loop {kfsb.bluealive::*}:
- create a gui slot {_slot} of {_player} with skull of ("%loop-value%" parsed as an offline player) named "&9&l[BLUE]&a %loop-value%" with lore "||%{_temp}%" to close then run function kfsbTeleport({_player}, location of {kfsb.bluealive::%loop-index%})
- add 1 to {_slot}
- function kfsbTeleport(player: player, location: location):
- teleport {_player} to {_location}
- function kfsbSetSpectator(player: player, isSpectator: boolean):
- if {_isSpectator} is true:
- set {_player}'s gamemode to survival
- {_player}.setAllowFlight(true)
- {_player}.setFlying(true)
- hide {_player} from all players
- set {_count} to 0
- loop 41 times:
- set slot {_count} of {_player}'s inventory to air
- add 1 to {_count}
- set hunger of {_player} to 10
- set saturation of {_player} to 10
- set health of {_player} to 10
- set max health of {_player} to 10
- clear potion effects of {_player}
- set {_temp} to yaml value "item-returntolobby-name" from {kfsb.lang.%{_player}%}
- set {_itemname} to "%{_temp}%&1&2&3&4&r&2&l"
- set slot 8 of {_player} to {_item}
- set {_x} to (x coordinate of {kfsb.mapdata.redspawn} + x coordinate of {kfsb.mapdata.bluespawn}) / 2
- set {_y} to (y coordinate of {kfsb.mapdata.redspawn} + y coordinate of {kfsb.mapdata.bluespawn}) / 2 + 15
- set {_z} to (z coordinate of {kfsb.mapdata.redspawn} + z coordinate of {kfsb.mapdata.bluespawn}) / 2
- set {_centerLocation} to location({_x}, {_y}, {_z}, world of {_player})
- set {kfsb.isSpectator::%{_player}%} to true
- teleport {_player} to {_centerLocation}
- wait 10 ticks
- set {_temp} to yaml value "item-teleporter-name" from {kfsb.lang.%{_player}%}
- set {_itemname} to "%{_temp}%&1&2&3&4&r&e&m"
- set slot 4 of {_player}'s inventory to a minecart named {_itemname} with lore yaml value "item-teleporter-lore" from {kfsb.lang.%{_player}%}
- else if {_isSpectator} is false:
- reveal {_player} to all players
- clear {_player}'s inventory
- set hunger of {_player} to 10
- set saturation of {_player} to 10
- set health of {_player} to 10
- set max health of {_player} to 10
- clear potion effects of {_player}
- {_player}.setAllowFlight(false)
- {_player}.setFlying(false)
- function kfsbGetUsername(player: player) :: text:
- set {_temp} to "&e%{_player}%"
- if {kfsb.ingame::%{_player}%} is set:
- if {kfsb.team::%{_player}%} is "red":
- set {_temp} to "&c%{_player}%"
- else if {kfsb.team::%{_player}%} is "blue":
- set {_temp} to "&9%{_player}%"
- return {_temp}
- function kfsbDeathEvent(player: player):
- if {kfsb.status} is "ingame":
- delete {kfsb.respawnCountdown.%{_player}%}
- loop name of all items of {_player}:
- if loop-string contains "&1&2&3&4&r&1":
- set {kfsb.spawnmoving.red} to true
- set {kfsb.spawnbroken.red} to true
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-diedwithspawnblock-red" from {kfsb.lang.%loop-player%}
- replace every "{player}" with kfsbGetUsername({_player}) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- {kfsb.team::%loop-player%} is "red"
- send title yaml value "title-spawn-has-lost" from {kfsb.lang.%loop-player%} with subtitle yaml value "title-spawn-destroyed-sub" from {kfsb.lang.%loop-player%} to loop-player for 4 seconds and 0 ticks and 0 ticks
- play "ENTITY_ENDERDRAGON_GROWL" to loop-player at volume 10 at pitch 5
- else if loop-string contains "&1&2&3&4&b&1":
- set {kfsb.spawnmoving.blue} to true
- set {kfsb.spawnbroken.blue} to true
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-diedwithspawnblock-red" from {kfsb.lang.%loop-player%}
- replace every "{player}" with kfsbGetUsername({_player}) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- {kfsb.team::%loop-player%} is "blue"
- send title yaml value "title-spawn-has-lost" from {kfsb.lang.%loop-player%} with subtitle yaml value "title-spawn-destroyed-sub" from {kfsb.lang.%loop-player%} to loop-player for 4 seconds and 0 ticks and 0 ticks
- play "ENTITY_ENDERDRAGON_GROWL" to loop-player at volume 10 at pitch 5
- if {kfsb.redalive::%{_player}%} is set:
- delete {kfsb.redalive::%{_player}%}
- if {kfsb.bluealive::%{_player}%} is set:
- delete {kfsb.bluealive::%{_player}%}
- if {kfsb.noSetSpectator.%{_player}%} is not set:
- kfsbSetSpectator({_player}, true)
- else:
- delete {kfsb.noSetSpectator.%{_player}%}
- function kfsbResetGame():
- delete {kfsb.status}
- loop {kfsb.redalive::*}:
- delete {kfsb.redalive::%loop-index%}
- loop {kfsb.bluealive::*}:
- delete {kfsb.bluealive::%loop-index%}
- loop {kfsb.kills::*}:
- delete {kfsb.kills::%loop-index%}
- loop {kfsb.team::*}:
- delete {kfsb.team::%loop-index%}
- loop {kfsb.playerstatus::*}:
- delete {kfsb.playerstatus::%loop-index%}
- loop {kfsb.isSpectator::*}:
- delete {kfsb.isSpectator::%loop-index%}
- loop {kfsb.lastteam::*}:
- delete {kfsb.lastteam::%loop-index%}
- loop {kfsb.lastvotedmap::*}:
- delete {kfsb.lastvotedmap::%loop-index%}
- loop {kfsb.map::*}:
- loop {kfsb.votes.%loop-value%::*}:
- delete {kfsb.votes.%loop-value-1%::%loop-index-2%}
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- kfsbDeleteHologram(loop-player)
- clear potion effects of loop-player
- reveal loop-player to all players
- teleport loop-player to {kfsb.lobby}
- set loop-player's health to 10
- set loop-player's max health to 10
- set loop-player's health to 10
- set loop-player's hunger to 10
- set loop-player's level to 0
- set loop-player's level progress to 0
- set loop-player's saturation to 10
- set loop-player's health to 10
- clear potion effects of loop-player
- clear inventory of loop-player
- set {_temp.%loop-player%} to yaml value "item-vote-name" from {kfsb.lang.%loop-player%}
- set {_itemname.%loop-player%} to "%{_temp.%loop-player%}%&1&2&3&4&e&o"
- set slot 4 of loop-player's inventory to emerald named {_itemname.%loop-player%} with lore yaml value "item-vote-lore" from {kfsb.lang.%loop-player%}
- loop-player.setAllowFlight(false)
- loop-player.setFlying(false)
- delete {kfsb.noSetSpectator.%loop-player%}
- delete {kfsb.startCountDown}
- delete {kfsb.spawnmoving.red}
- delete {kfsb.spawnmoving.blue}
- delete {kfsb.spawnbroken.red}
- delete {kfsb.spawnbroken.blue}
- function kfsbResetStatus():
- delete {kfsb.status}
- loop {kfsb.redalive::*}:
- delete {kfsb.redalive::%loop-index%}
- loop {kfsb.bluealive::*}:
- delete {kfsb.bluealive::%loop-index%}
- loop {kfsb.kills::*}:
- delete {kfsb.kills::%loop-index%}
- loop {kfsb.team::*}:
- delete {kfsb.team::%loop-index%}
- loop {kfsb.playerstatus::*}:
- delete {kfsb.playerstatus::%loop-index%}
- loop {kfsb.isSpectator::*}:
- delete {kfsb.isSpectator::%loop-index%}
- loop {kfsb.lastteam::*}:
- delete {kfsb.lastteam::%loop-index%}
- loop {kfsb.lastvotedmap::*}:
- delete {kfsb.lastvotedmap::%loop-index%}
- loop {kfsb.map::*}:
- loop {kfsb.votes.%loop-value%::*}:
- delete {kfsb.votes.%loop-value-1%::%loop-index-2%}
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- kfsbDeleteHologram(loop-player)
- reveal loop-player to all players
- clear potion effects of loop-player
- loop-player.setAllowFlight(false)
- loop-player.setFlying(false)
- delete {kfsb.noSetSpectator.%loop-player%}
- loop {kfsb.ingame::*}:
- delete {kfsb.ingame::%loop-index%}
- delete {kfsb.startCountDown}
- delete {kfsb.spawnmoving.red}
- delete {kfsb.spawnmoving.blue}
- delete {kfsb.spawnbroken.red}
- delete {kfsb.spawnbroken.blue}
- function kfsbOpenMapVoteGui(player: player):
- loop {kfsb.map::*}:
- delete {kfsb.validmap::%loop-index%}
- {kfsb.location::%loop-index%::redspawn} is set
- {kfsb.location::%loop-index%::bluespawn} is set
- {kfsb.location::%loop-index%::pos1} is set
- {kfsb.location::%loop-index%::pos2} is set
- set {kfsb.validmap::%loop-index%} to loop-value
- set {_row} to ceil((size of {kfsb.validmap::*} + 1 ) / 9) + 1
- if {_player} doesn't have a gui:
- set {_temp} to yaml value "gui-mapvote-title" from {kfsb.lang.%{_player}%}
- set {_guiname} to "%{_temp}%&1&2&3&4&e&o"
- open chest with {_row} row named {_guiname} to {_player}
- inventory name of {_player}'s current inventory contains "&1&2&3&4&e&o"
- create a gui slot 4 of {_player} with barrier named yaml value "item-gui-close-name" from {kfsb.lang.%{_player}%} to close
- set {_temp} to yaml value "gui-clicktoselect" from {kfsb.lang.%{_player}%}
- create a gui slot 9 of {_player} with paper named yaml value "item-gui-novote-name" from {kfsb.lang.%{_player}%} with lore "||%{_temp}%" to run {_player} command "spherebattle vote"
- set {_slot} to 10
- loop {kfsb.validmap::*}:
- if {kfsb.votes.%loop-value%::%{_player}%} is set:
- set {_temp} to yaml value "gui-currentvotes" from {kfsb.lang.%{_player}%}
- replace every "{votes}" with "%size of {kfsb.votes.%loop-value%::*}%" in {_temp}
- set {_temp2} to yaml value "gui-alreadyvoted" from {kfsb.lang.%{_player}%}
- create a gui slot {_slot} of {_player} with glowing map named "&a&l%loop-value%" with lore "%{_temp2}%||||%{_temp}%"
- else:
- set {_temp} to yaml value "gui-clicktovote" from {kfsb.lang.%{_player}%}
- set {_temp2} to yaml value "gui-currentvotes" from {kfsb.lang.%{_player}%}
- replace every "{votes}" with "%size of {kfsb.votes.%loop-value%::*}%" in {_temp2}
- create a gui slot {_slot} of {_player} with map named "&a&l%loop-value%" with lore "||%{_temp2}%||%{_temp}%" to run {_player} command "spherebattle vote %loop-value%"
- add 1 to {_slot}
- function kfsbClearScoreboard(player: player):
- {kfsb.ingame::%{_player}%} is set
- set {_slot} to 1
- loop 15 times:
- delete id based score "kfsbLine%{_slot}%.%{_player}%" from stylish scoreboard "kfsbScoreboard-%{_player}%"
- add 1 to {_slot}
- function kfsbUpdateScoreboard(player: player):
- {kfsb.ingame::%{_player}%} is set
- set the title of stylish scoreboard "kfsbScoreboard-%{_player}%" to yaml value "scoreboard-title" from {kfsb.lang.%{_player}%}
- if {kfsb.playerstatus::%{_player}%} is not set:
- if {kfsb.lastScoreboard.%{_player}%} is not "waiting":
- set {kfsb.lastScoreboard.%{_player}%} to "waiting"
- kfsbClearScoreboard({_player})
- if {kfsb.startCountDown} is set:
- create a new id based score "kfsbLine1.%{_player}%" with text yaml value "scoreboard-website" from {kfsb.lang.%{_player}%} slot 1 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- create a new id based score "kfsbLine2.%{_player}%" with text "&r" slot 2 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- set {_temp} to yaml value "scoreboard-starting" from {kfsb.lang.%{_player}%}
- replace every "{seconds}" with "%{kfsb.startCountDown}%" in {_temp}
- create a new id based score "kfsbLine3.%{_player}%" with text {_temp} slot 3 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- create a new id based score "kfsbLine4.%{_player}%" with text "&r&r" slot 4 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- set {_temp} to yaml value "scoreboard-players" from {kfsb.lang.%{_player}%}
- replace every "{players}" with "%size of {kfsb.ingame::*}%" in {_temp}
- create a new id based score "kfsbLine5.%{_player}%" with text {_temp} slot 5 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- create a new id based score "kfsbLine6.%{_player}%" with text "&r&r&r" slot 6 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- else:
- create a new id based score "kfsbLine1.%{_player}%" with text yaml value "scoreboard-website" from {kfsb.lang.%{_player}%} slot 1 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- create a new id based score "kfsbLine2.%{_player}%" with text "&r" slot 2 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- create a new id based score "kfsbLine3.%{_player}%" with text yaml value "scoreboard-waiting" from {kfsb.lang.%{_player}%} slot 3 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- create a new id based score "kfsbLine4.%{_player}%" with text "&r&r" slot 4 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- set {_temp} to yaml value "scoreboard-players" from {kfsb.lang.%{_player}%}
- replace every "{players}" with "%size of {kfsb.ingame::*}%" in {_temp}
- create a new id based score "kfsbLine5.%{_player}%" with text {_temp} slot 5 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- create a new id based score "kfsbLine6.%{_player}%" with text "&r&r&r" slot 6 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- else:
- if {kfsb.startCountDown} is set:
- set name of id based score "kfsbLine1.%{_player}%" to yaml value "scoreboard-website" from {kfsb.lang.%{_player}%}
- set name of id based score "kfsbLine2.%{_player}%" to "&r"
- set {_temp} to yaml value "scoreboard-starting" from {kfsb.lang.%{_player}%}
- replace every "{seconds}" with "%{kfsb.startCountDown}%" in {_temp}
- set name of id based score "kfsbLine3.%{_player}%" to {_temp}
- set name of id based score "kfsbLine4.%{_player}%" to "&r&r"
- set {_temp} to yaml value "scoreboard-players" from {kfsb.lang.%{_player}%}
- replace every "{players}" with "%size of {kfsb.ingame::*}%" in {_temp}
- set name of id based score "kfsbLine5.%{_player}%" to {_temp}
- set name of id based score "kfsbLine6.%{_player}%" to "&r&r&r"
- else:
- set name of id based score "kfsbLine1.%{_player}%" to yaml value "scoreboard-website" from {kfsb.lang.%{_player}%}
- set name of id based score "kfsbLine2.%{_player}%" to "&r"
- set name of id based score "kfsbLine3.%{_player}%" to yaml value "scoreboard-waiting" from {kfsb.lang.%{_player}%}
- set name of id based score "kfsbLine4.%{_player}%" to "&r&r"
- set {_temp} to yaml value "scoreboard-players" from {kfsb.lang.%{_player}%}
- replace every "{players}" with "%size of {kfsb.ingame::*}%" in {_temp}
- set name of id based score "kfsbLine5.%{_player}%" to {_temp}
- set name of id based score "kfsbLine6.%{_player}%" to "&r&r&r"
- else if {kfsb.playerstatus::%{_player}%} is "ingame" or "ending":
- if {kfsb.lastScoreboard.%{_player}%} is not "ingame":
- set {kfsb.lastScoreboard.%{_player}%} to "ingame"
- kfsbClearScoreboard({_player})
- create a new id based score "kfsbLine1.%{_player}%" with text yaml value "scoreboard-website" from {kfsb.lang.%{_player}%} slot 1 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- create a new id based score "kfsbLine2.%{_player}%" with text "&r" slot 2 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- set {_temp} to yaml value "scoreboard-kills" from {kfsb.lang.%{_player}%}
- replace every "{kills}" with "%{kfsb.kills::%{_player}%}%" in {_temp}
- create a new id based score "kfsbLine3.%{_player}%" with text {_temp} slot 3 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- create a new id based score "kfsbLine4.%{_player}%" with text "&r&r" slot 4 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- if {kfsb.team::%{_player}%} is "red":
- set {_you} to yaml value "scoreboard-team-you" from {kfsb.lang.%{_player}%}
- set {_temp} to yaml value "scoreboard-blue" from {kfsb.lang.%{_player}%}
- replace every "{status}" with "%{kfsb.bluestatus}%" in {_temp}
- create a new id based score "kfsbLine5.%{_player}%" with text {_temp} slot 5 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- set {_temp} to yaml value "scoreboard-red" from {kfsb.lang.%{_player}%}
- replace every "{status}" with "%{kfsb.redstatus}%" in {_temp}
- create a new id based score "kfsbLine6.%{_player}%" with text "%{_temp}% %{_you}%" slot 6 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- else if {kfsb.team::%{_player}%} is "blue":
- set {_you} to yaml value "scoreboard-team-you" from {kfsb.lang.%{_player}%}
- set {_temp} to yaml value "scoreboard-blue" from {kfsb.lang.%{_player}%}
- replace every "{status}" with "%{kfsb.bluestatus}%" in {_temp}
- create a new id based score "kfsbLine5.%{_player}%" with text "%{_temp}% %{_you}%" slot 5 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- set {_temp} to yaml value "scoreboard-red" from {kfsb.lang.%{_player}%}
- replace every "{status}" with "%{kfsb.redstatus}%" in {_temp}
- create a new id based score "kfsbLine6.%{_player}%" with text {_temp} slot 6 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- else:
- set {_temp} to yaml value "scoreboard-blue" from {kfsb.lang.%{_player}%}
- replace every "{status}" with "%{kfsb.bluestatus}%" in {_temp}
- create a new id based score "kfsbLine5.%{_player}%" with text {_temp} slot 5 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- set {_temp} to yaml value "scoreboard-red" from {kfsb.lang.%{_player}%}
- replace every "{status}" with "%{kfsb.redstatus}%" in {_temp}
- create a new id based score "kfsbLine6.%{_player}%" with text {_temp} slot 6 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- create a new id based score "kfsbLine7.%{_player}%" with text "&r&r&r" slot 7 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- set {_temp} to yaml value "scoreboard-players" from {kfsb.lang.%{_player}%}
- replace every "{players}" with "%size of {kfsb.ingame::*}%" in {_temp}
- create a new id based score "kfsbLine8.%{_player}%" with text {_temp} slot 8 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- set {_temp} to yaml value "scoreboard-map" from {kfsb.lang.%{_player}%}
- replace every "{map}" with "%{kfsb.selectedMap}%" in {_temp}
- create a new id based score "kfsbLine9.%{_player}%" with text {_temp} slot 9 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- create a new id based score "kfsbLine10.%{_player}%" with text "&r&r&r&r" slot 10 for stylish scoreboard "kfsbScoreboard-%{_player}%"
- else:
- set name of id based score "kfsbLine1.%{_player}%" to yaml value "scoreboard-website" from {kfsb.lang.%{_player}%}
- set name of id based score "kfsbLine2.%{_player}%" to "&r"
- set {_temp} to yaml value "scoreboard-kills" from {kfsb.lang.%{_player}%}
- replace every "{kills}" with "%{kfsb.kills::%{_player}%}%" in {_temp}
- set name of id based score "kfsbLine3.%{_player}%" to {_temp}
- set name of id based score "kfsbLine4.%{_player}%" to "&r&r"
- if {kfsb.team::%{_player}%} is "red":
- set {_you} to yaml value "scoreboard-team-you" from {kfsb.lang.%{_player}%}
- set {_temp} to yaml value "scoreboard-blue" from {kfsb.lang.%{_player}%}
- replace every "{status}" with "%{kfsb.bluestatus}%" in {_temp}
- set name of id based score "kfsbLine5.%{_player}%" to {_temp}
- set {_temp} to yaml value "scoreboard-red" from {kfsb.lang.%{_player}%}
- replace every "{status}" with "%{kfsb.redstatus}%" in {_temp}
- set name of id based score "kfsbLine6.%{_player}%" to "%{_temp}% %{_you}%"
- else if {kfsb.team::%{_player}%} is "blue":
- set {_you} to yaml value "scoreboard-team-you" from {kfsb.lang.%{_player}%}
- set {_temp} to yaml value "scoreboard-blue" from {kfsb.lang.%{_player}%}
- replace every "{status}" with "%{kfsb.bluestatus}%" in {_temp}
- set name of id based score "kfsbLine5.%{_player}%" to "%{_temp}% %{_you}%"
- set {_temp} to yaml value "scoreboard-red" from {kfsb.lang.%{_player}%}
- replace every "{status}" with "%{kfsb.redstatus}%" in {_temp}
- set name of id based score "kfsbLine6.%{_player}%" to {_temp}
- else:
- set {_temp} to yaml value "scoreboard-blue" from {kfsb.lang.%{_player}%}
- replace every "{status}" with "%{kfsb.bluestatus}%" in {_temp}
- set name of id based score "kfsbLine5.%{_player}%" to {_temp}
- set {_temp} to yaml value "scoreboard-red" from {kfsb.lang.%{_player}%}
- replace every "{status}" with "%{kfsb.redstatus}%" in {_temp}
- set name of id based score "kfsbLine6.%{_player}%" to {_temp}
- set name of id based score "kfsbLine7.%{_player}%" to "&r&r&r"
- set {_temp} to yaml value "scoreboard-players" from {kfsb.lang.%{_player}%}
- replace every "{players}" with "%size of {kfsb.ingame::*}%" in {_temp}
- set name of id based score "kfsbLine8.%{_player}%" to {_temp}
- set {_temp} to yaml value "scoreboard-map" from {kfsb.lang.%{_player}%}
- replace every "{map}" with "%{kfsb.selectedMap}%" in {_temp}
- set name of id based score "kfsbLine9.%{_player}%" to {_temp}
- set name of id based score "kfsbLine10.%{_player}%" to "&r&r&r&r"
- function kfsbJoinGame(player: player):
- if {kfsb.ingame::%{_player}%} is not set:
- set {kfsb.ingame::%{_player}%} to true
- set {kfsb.savedinfo::%{_player}%::location} to location of {_player}
- set {kfsb.savedinfo::%{_player}%::maxhealth} to max health of {_player}
- set {kfsb.savedinfo::%{_player}%::saturation} to saturation of {_player}
- set {kfsb.savedinfo::%{_player}%::currenthealth} to health of {_player}
- set {kfsb.savedinfo::%{_player}%::hunger} to hunger of {_player}
- set {kfsb.savedinfo::%{_player}%::gamemode} to gamemode of {_player}
- teleport {_player} to {kfsb.lobby}
- set max health of {_player} to 10
- set saturation of {_player} to 10
- set health of {_player} to 10
- set hunger of {_player} to 10
- set gamemode of {_player} to adventure
- set {_count} to 0
- loop all active potions on {_player}:
- set {kfsb.savedinfo::%{_player}%::potion::%{_count}%} to loop-value
- add 1 to {_count}
- clear potion effects of {_player}
- set {_count} to 0
- loop 41 times:
- set {_call} to slot {_count} of {_player}'s inventory
- set {kfsb.savedinfo::%{_player}%::inventory::%{_count}%} to {_call}
- set slot {_count} of {_player}'s inventory to air
- add 1 to {_count}
- set {_temp} to yaml value "item-vote-name" from {kfsb.lang.%{_player}%}
- set {_itemname} to "%{_temp}%&1&2&3&4&e&o"
- set slot 4 of {_player}'s inventory to emerald named {_itemname} with lore yaml value "item-vote-lore" from {kfsb.lang.%{_player}%}
- set {_temp} to yaml value "item-returntolobby-name" from {kfsb.lang.%{_player}%}
- set {_itemname} to "%{_temp}%&1&2&3&4&r&2&l"
- delete {kfsb.lastScoreboard.%{_player}%}
- create a new stylish scoreboard "kfsbScoreboard-%{_player}%"
- set {_player}'s stylish scoreboard to "kfsbScoreboard-%{_player}%"
- kfsbUpdateScoreboard({_player})
- if {kfsb.status} is not set:
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-joined-lobby" from {kfsb.lang.%loop-player%}
- replace every "{playername}" with "%{_player}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else if {kfsb.status} is "ending":
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-joined-lobby" from {kfsb.lang.%loop-player%}
- replace every "{playername}" with "%{_player}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else if {kfsb.status} is "ingame":
- if {kfsb.isSpectator::%{_player}%} is set:
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-joined-lobby" from {kfsb.lang.%loop-player%}
- replace every "{playername}" with "%{_player}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else if {kfsb.lastteam::%{_player}%} is set:
- set {kfsb.team::%{_player}%} to {kfsb.lastteam::%{_player}%}
- delete {kfsb.lastteam::%{_player}%}
- if {kfsb.spawnbroken.%{kfsb.team::%{_player}%}%} is true:
- delete {kfsb.team::%{_player}%}
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-joined-lobby" from {kfsb.lang.%loop-player%}
- replace every "{playername}" with "%{_player}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- stop
- else if {kfsb.spawnmoving.%{kfsb.team::%{_player}%}%} is true:
- delete {kfsb.team::%{_player}%}
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-joined-lobby" from {kfsb.lang.%loop-player%}
- replace every "{playername}" with "%{_player}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- stop
- else:
- set {kfsb.playerstatus::%{_player}%} to "ingame"
- delete {kfsb.lastScoreboard.%{_player}%}
- create a new stylish scoreboard "kfsbScoreboard-%{_player}%"
- set {_player}'s stylish scoreboard to "kfsbScoreboard-%{_player}%"
- kfsbUpdateScoreboard({_player})
- set {_player}'s health to 10
- set {_player}'s max health to 10
- set {_player}'s health to 10
- set {_player}'s hunger to 10
- set {_player}'s level to 0
- set {_player}'s level progress to 0
- set {_player}'s saturation to 10
- set {_player}'s health to 10
- set {kfsb.playerstatus::%{_player}%} to "ingame"
- if {kfsb.kills::%{_player}%} is not set:
- set {kfsb.kills::%{_player}%} to 0
- set {kfsb.playerstatus::%{_player}%} to "ingame"
- clear {_player}'s inventory
- clear potion effects of {_player}
- kfsbSetFacing({_player}, "%{kfsb.%{kfsb.team::%{_player}%}%facing.%{kfsb.selectedMap}%}%", location 1 meter above {kfsb.mapdata.%{kfsb.team::%{_player}%}%spawn})
- set {kfsb.%{kfsb.team::%{_player}%}%alive::%{_player}%} to {_player}
- if {kfsb.team::%{_player}%} is "red":
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-joined-as-red" from {kfsb.lang.%loop-player%}
- replace every "{playername}" with "%{_player}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else:
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-joined-as-blue" from {kfsb.lang.%loop-player%}
- replace every "{playername}" with "%{_player}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- wait 4 ticks
- delete {kfsb.nodeathaction.%{_player}%}
- else:
- set {kfsb.team::%{_player}%} to {kfsb.nextjointeam}
- delete {kfsb.lastteam::%{_player}%}
- if {kfsb.spawnbroken.%{kfsb.team::%{_player}%}%} is true:
- delete {kfsb.team::%{_player}%}
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-joined-lobby" from {kfsb.lang.%loop-player%}
- replace every "{playername}" with "%{_player}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- stop
- else if {kfsb.spawnmoving.%{kfsb.team::%{_player}%}%} is true:
- delete {kfsb.team::%{_player}%}
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-joined-lobby" from {kfsb.lang.%loop-player%}
- replace every "{playername}" with "%{_player}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- stop
- else:
- set {kfsb.playerstatus::%{_player}%} to "ingame"
- delete {kfsb.lastScoreboard.%{_player}%}
- create a new stylish scoreboard "kfsbScoreboard-%{_player}%"
- set {_player}'s stylish scoreboard to "kfsbScoreboard-%{_player}%"
- kfsbUpdateScoreboard({_player})
- set {_player}'s health to 10
- set {_player}'s max health to 10
- set {_player}'s health to 10
- set {_player}'s hunger to 10
- set {_player}'s level to 0
- set {_player}'s level progress to 0
- set {_player}'s saturation to 10
- set {_player}'s health to 10
- if {kfsb.kills::%{_player}%} is not set:
- set {kfsb.kills::%{_player}%} to 0
- set {kfsb.playerstatus::%{_player}%} to "ingame"
- clear {_player}'s inventory
- clear potion effects of {_player}
- kfsbSetFacing({_player}, "%{kfsb.%{kfsb.team::%{_player}%}%facing.%{kfsb.selectedMap}%}%", location 1 meter above {kfsb.mapdata.%{kfsb.team::%{_player}%}%spawn})
- set {kfsb.%{kfsb.team::%{_player}%}%alive::%{_player}%} to {_player}
- if {kfsb.nextjointeam} is "red":
- set {kfsb.nextjointeam} to "blue"
- else if {kfsb.nextjointeam} is "blue":
- set {kfsb.nextjointeam} to "red"
- if {kfsb.team::%{_player}%} is "red":
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-joined-as-red" from {kfsb.lang.%loop-player%}
- replace every "{playername}" with "%{_player}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else:
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-joined-as-blue" from {kfsb.lang.%loop-player%}
- replace every "{playername}" with "%{_player}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- wait 4 ticks
- delete {kfsb.nodeathaction.%{_player}%}
- else:
- send yaml value "command-join-already" from {kfsb.lang.%{_player}%} to {_player}
- function kfsbLeaveGame(player: player):
- if {kfsb.ingame::%{_player}%} is set:
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-left" from {kfsb.lang.%loop-player%}
- replace every "{playername}" with "%{_player}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- delete {kfsb.ingame::%{_player}%}
- if size of {kfsb.ingame::*} is smaller than {@NeededPlayersToStart}:
- {kfsb.startCountDown} is set
- {kfsb.status} is not set
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- send yaml value "chat-start-cancelled" from {kfsb.lang.%loop-player%} to loop-player
- send title yaml value "title-start-cancelled" from {kfsb.lang.%loop-player%} with subtitle "" to loop-player for 3 seconds and 0 ticks and 0 ticks
- play sound "UI_BUTTON_CLICK" to loop-player at volume 10 at pitch 5
- delete {kfsb.startCountDown}
- teleport {_player} to {kfsb.savedinfo::%{_player}%::location}
- set {kfsb.lastteam::%{_player}%} to {kfsb.team::%{_player}%}
- set {kfsb.noSetSpectator.%{_player}%} to true
- kfsbDeathEvent({_player})
- set max health of {_player} to {kfsb.savedinfo::%{_player}%::maxhealth}
- set saturation of {_player} to {kfsb.savedinfo::%{_player}%::saturation}
- set health of {_player} to {kfsb.savedinfo::%{_player}%::currenthealth}
- set hunger of {_player} to {kfsb.savedinfo::%{_player}%::hunger}
- set gamemode of {_player} to {kfsb.savedinfo::%{_player}%::gamemode}
- delete {kfsb.respawnCountdown.%{_player}%}
- delete {kfsb.lastScoreboard.%{_player}%}
- delete {kfsb.votes.%{kfsb.lastvotedmap::%{_player}%}%::%{_player}%}
- delete {kfsb.savedinfo::%{_player}%::location}
- delete {kfsb.savedinfo::%{_player}%::maxhealth}
- delete {kfsb.savedinfo::%{_player}%::saturation}
- delete {kfsb.savedinfo::%{_player}%::currenthealth}
- delete {kfsb.savedinfo::%{_player}%::hunger}
- delete {kfsb.savedinfo::%{_player}%::gamemode}
- delete {kfsb.team::%{_player}%}
- delete {kfsb.respawnCountdown.%{_player}%}
- delete stylish scoreboard "kfsbScoreboard-%{_player}%"
- kfsbDeleteHologram({_player})
- reveal {_player} to all players
- set {_count} to 0
- loop {kfsb.savedinfo::%{_player}%::potion::*}:
- delete {kfsb.savedinfo::%{_player}%::potion::%{_count}%}
- add 1 to {_count}
- set {_count} to 0
- loop 41 times:
- set slot {_count} of {_player}'s inventory to {kfsb.savedinfo::%{_player}%::inventory::%{_count}%}
- delete {kfsb.savedinfo::%{_player}%::inventory::%{_count}%}
- add 1 to {_count}
- else:
- send yaml value "command-leave-notin" from {kfsb.lang.%{_player}%} to {_player}
- on script load:
- if file "plugins/Skript/scripts/SphereBattle/lang/{@DefaultLanguage}.yml" doesn't exist:
- create file "plugins/Skript/scripts/SphereBattle/lang/{@DefaultLanguage}.yml"
- load yaml "plugins/Skript/scripts/SphereBattle/lang/{@DefaultLanguage}.yml" as "{@DefaultLanguage}"
- set skript-yaml value "hello" from "{@DefaultLanguage}" to "I'm sorry, but there was something wrong in the installation of this Skript..."
- save yaml "{@DefaultLanguage}"
- loop {kfsb.langlist::*}:
- delete {kfsb.langlist::%loop-index%}
- loop directory "plugins/Skript/scripts/SphereBattle/lang/"'s files:
- if loop-string.endsWith(".yml") is true:
- set {_temp} to relative path of loop-string
- set {_temp2} to {_temp}
- replace every ".yml" with "" in {_temp}
- replace every "plugins/Skript/scripts/SphereBattle/lang/" with "" in {_temp}
- replace every "plugins\Skript\scripts\SphereBattle\lang\" with "" in {_temp}
- load yaml "%{_temp2}%" as "%{_temp}%"
- set {kfsb.langlist::%{_temp}%} to {_temp}
- on join:
- if {kfsb.lang.%player%} is not set:
- set {kfsb.lang.%player%} to player.getLocale()
- if {kfsb.langlist::*} does not contain {kfsb.lang.%player%}:
- set {kfsb.lang.%player%} to "{@DefaultLanguage}"
- every 5 ticks:
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- {kfsb.isSpectator::%loop-player%} is set
- loop all players:
- {kfsb.ingame::%loop-player-1%} is set
- hide loop-player-1 from loop-player-2
- else:
- reveal loop-player-1 to loop-player-2
- if size of {kfsb.ingame::*} >= {@NeededPlayersToStart}:
- if {kfsb.startCountDown} is not set:
- {kfsb.status} is not set
- set {kfsb.startCountDown} to {@StartingCountdownTime}
- while {kfsb.startCountDown} > 0:
- if {kfsb.startCountDown} >= 30:
- if {kfsb.startCountDown} is {@StartingCountdownTime}:
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- play "BLOCK_NOTE_HAT" to loop-player at volume 10 at pitch 5
- set {_temp.%loop-player%} to yaml value "chat-starting-1" from {kfsb.lang.%loop-player%}
- replace every "{seconds}" with "%{kfsb.startCountDown}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else if "%{kfsb.startCountDown}%".endsWith("0") is true:
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- play "BLOCK_NOTE_HAT" to loop-player at volume 10 at pitch 5
- set {_temp.%loop-player%} to yaml value "chat-starting-1" from {kfsb.lang.%loop-player%}
- replace every "{seconds}" with "%{kfsb.startCountDown}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else if {kfsb.startCountDown} >= 20:
- if {kfsb.startCountDown} is {@StartingCountdownTime}:
- loop all players:
- play "BLOCK_NOTE_HAT" to loop-player at volume 10 at pitch 5
- set {_temp.%loop-player%} to yaml value "chat-starting-2" from {kfsb.lang.%loop-player%}
- replace every "{seconds}" with "%{kfsb.startCountDown}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else if "%{kfsb.startCountDown}%".endsWith("0") is true:
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- play "BLOCK_NOTE_HAT" to loop-player at volume 10 at pitch 5
- set {_temp.%loop-player%} to yaml value "chat-starting-2" from {kfsb.lang.%loop-player%}
- replace every "{seconds}" with "%{kfsb.startCountDown}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else if {kfsb.startCountDown} >= 10:
- if {kfsb.startCountDown} is {@StartingCountdownTime}:
- loop all players:
- play "BLOCK_NOTE_HAT" to loop-player at volume 10 at pitch 5
- set {_temp.%loop-player%} to yaml value "chat-starting-3" from {kfsb.lang.%loop-player%}
- replace every "{seconds}" with "%{kfsb.startCountDown}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else if "%{kfsb.startCountDown}%".endsWith("0") is true:
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- play "BLOCK_NOTE_HAT" to loop-player at volume 10 at pitch 5
- set {_temp.%loop-player%} to yaml value "chat-starting-3" from {kfsb.lang.%loop-player%}
- replace every "{seconds}" with "%{kfsb.startCountDown}%" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else if {kfsb.startCountDown} <= 5:
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- play "BLOCK_NOTE_HAT" to loop-player at volume 10 at pitch 5
- set {_temp.%loop-player%} to yaml value "chat-starting-4" from {kfsb.lang.%loop-player%}
- replace every "{seconds}" with "%{kfsb.startCountDown}%" in {_temp.%loop-player%}
- if {kfsb.startCountDown} is not 1:
- replace every "{s}" with "s" in {_temp.%loop-player%}
- else:
- replace every "{s}" with "" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- wait 1 second
- if size of {kfsb.ingame::*} is bigger than or equal to {@NeededPlayersToStart}:
- remove 1 from {kfsb.startCountDown}
- if size of {kfsb.ingame::*} is smaller than {@NeededPlayersToStart}:
- stop
- set {kfsb.status} to "ingame"
- loop {kfsb.map::*}:
- delete {kfsb.validmap::%loop-index%}
- {kfsb.location::%loop-index%::redspawn} is set
- {kfsb.location::%loop-index%::bluespawn} is set
- {kfsb.location::%loop-index%::pos1} is set
- {kfsb.location::%loop-index%::pos2} is set
- set {kfsb.validmap::%loop-index%} to loop-value
- loop {kfsb.validmap::*}:
- if size of {kfsb.votes.%loop-value%::*} is not 0:
- set {_votecheck::%loop-value%} to size of {kfsb.votes.%loop-value%::*}
- set {_sortedcheck::*} to sorted {_votecheck::*}
- if size of {_votecheck::*} is 0:
- set {kfsb.selectedMap} to random object out of {kfsb.validmap::*}
- else:
- loop {kfsb.validmap::*}:
- if size of {kfsb.votes.%loop-value%::*} is {_sortedcheck::1}:
- set {_finalcheck::%loop-value%} to loop-value
- set {kfsb.selectedMap} to random object out of {_finalcheck::*}
- delete {kfsb.startCountDown}
- set {_teamplayers1} to floor(size of {kfsb.ingame::*} / 2)
- set {_teamplayers2} to size of {kfsb.ingame::*} - {_teamplayers1}
- set {_team1} to random object out of "red" or "blue"
- if {_team1} is "red":
- set {_team2} to "blue"
- set {kfsb.nextjointeam} to "red"
- if {_team1} is "blue":
- set {_team2} to "red"
- set {kfsb.nextjointeam} to "blue"
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_selectPlayers::%loop-player%} to loop-player
- loop {_teamplayers1} times:
- set {_selectedPlayer} to random object out of {_selectPlayers::*}
- delete {_selectPlayers::%{_selectedPlayer}%}
- set {kfsb.%{_team1}%team::%{_selectedPlayer}%} to {_selectedPlayer}
- set {kfsb.team::%{_selectedPlayer}%} to {_team1}
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- {_selectPlayers::%loop-player%} is set
- set {kfsb.%{_team2}%team::%loop-player%} to loop-player
- set {kfsb.team::%loop-player%} to {_team2}
- set {_world} to world of {kfsb.location::%{kfsb.selectedMap}%::pos1}
- execute console command "multiverse-core:mv delete {@MapHandlerName}"
- execute console command "multiverse-core:mvconfirm"
- execute console command "multiverse-core:mv clone %{_world}% {@MapHandlerName}"
- execute console command "multiverse-core:mv modify set mode survival {@MapHandlerName}"
- execute console command "multiverse-core:mv gamerule doDaylightCycle false {@MapHandlerName}"
- execute console command "multiverse-core:mv gamerule doWeatherCycle false {@MapHandlerName}"
- execute console command "multiverse-core:mv gamerule doMobSpawning false {@MapHandlerName}"
- execute console command "multiverse-core:mv gamerule doMobLoot false {@MapHandlerName}"
- execute console command "multiverse-core:mv gamerule doTileDrops true {@MapHandlerName}"
- execute console command "multiverse-core:mv gamerule mobGriefing false {@MapHandlerName}"
- set {kfsb.mapdata.redspawn} to {kfsb.location::%{kfsb.selectedMap}%::redspawn}
- set world of {kfsb.mapdata.redspawn} to "{@MapHandlerName}" parsed as a world
- set {kfsb.mapdata.bluespawn} to {kfsb.location::%{kfsb.selectedMap}%::bluespawn}
- set world of {kfsb.mapdata.bluespawn} to "{@MapHandlerName}" parsed as a world
- set {kfsb.mapdata.pos1} to {kfsb.location::%{kfsb.selectedMap}%::pos1}
- set world of {kfsb.mapdata.pos1} to "{@MapHandlerName}" parsed as a world
- set {kfsb.mapdata.pos2} to {kfsb.location::%{kfsb.selectedMap}%::pos2}
- set world of {kfsb.mapdata.pos2} to "{@MapHandlerName}" parsed as a world
- set block at {kfsb.mapdata.redspawn} to red wool
- set block at {kfsb.mapdata.bluespawn} to blue wool
- set {kfsb.redstatus} to "&a?"
- set {kfsb.bluestatus} to "&a?"
- delete {kfsb.spawnmoving.red}
- delete {kfsb.spawnmoving.blue}
- delete {kfsb.spawnbroken.red}
- delete {kfsb.spawnbroken.blue}
- loop {kfsb.redalive::*}:
- delete {kfsb.redalive::%loop-index%}
- loop {kfsb.bluealive::*}:
- delete {kfsb.bluealive::%loop-index%}
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- clear loop-player's inventory
- set loop-player's gamemode to survival
- set {kfsb.kills::%loop-player%} to 0
- set {kfsb.playerstatus::%loop-player%} to "ingame"
- if {kfsb.team::%loop-player%} is "red":
- kfsbSetFacing(loop-player, "%{kfsb.redfacing.%{kfsb.selectedMap}%}%", {kfsb.mapdata.redspawn})
- set {kfsb.redalive::%loop-player%} to loop-player
- else if {kfsb.team::%loop-player%} is "blue":
- kfsbSetFacing(loop-player, "%{kfsb.bluefacing.%{kfsb.selectedMap}%}%", {kfsb.mapdata.bluespawn})
- set {kfsb.bluealive::%loop-player%} to loop-player
- send yaml value "chat-greenbar" from {kfsb.lang.%loop-player%} to loop-player
- set {_line} to 1
- loop 10 times:
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- send centered yaml value "chat-description-%{_line}%" from {kfsb.lang.%loop-player%} to loop-player
- add 1 to {_line}
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- send yaml value "chat-greenbar" from {kfsb.lang.%loop-player%} to loop-player
- send yaml value "chat-spawntip" from {kfsb.lang.%loop-player%} to loop-player
- send yaml value "chat-shouttip" from {kfsb.lang.%loop-player%} to loop-player
- kfsbPlaceHologram(loop-player)
- if {kfsb.spawnbroken.red} is set:
- if size of {kfsb.redalive::*} is 0:
- set {kfsb.redstatus} to "&c?"
- else:
- set {kfsb.redstatus} to "&e%size of {kfsb.redalive::*}%"
- else:
- set {kfsb.redstatus} to "&a?"
- if {kfsb.spawnbroken.blue} is set:
- if size of {kfsb.bluealive::*} is 0:
- set {kfsb.bluestatus} to "&c?"
- else:
- set {kfsb.bluestatus} to "&e%size of {kfsb.bluealive::*}%"
- else:
- set {kfsb.bluestatus} to "&a?"
- if {kfsb.status} is "ingame":
- if size of {kfsb.ingame::*} < {@NeededPlayersToStart}:
- kfsbResetGame()
- loop all players:
- if {kfsb.playerstatus::%loop-player%} is "ingame":
- if location of loop-player is not within {kfsb.mapdata.pos1} to {kfsb.mapdata.pos2}:
- set {_temp} to loop-player.isOnGround()
- if {_temp} is true:
- teleport loop-player to {kfsb.playerlocation.%loop-player%}
- else:
- set {kfsb.playerlocation.%loop-player%} to location of loop-player
- loop all players:
- if {kfsb.ingame::%loop-player%} is set:
- if {kfsb.playerstatus::%loop-player%} is not set:
- set loop-player's health to 10
- set loop-player's saturation to 10
- set loop-player's level to 0
- set loop-player's level progress to 0
- set loop-player's hunger to 10
- kfsbUpdateScoreboard(loop-player)
- if {kfsb.selfsetlang.%loop-player%} isn't set:
- set {kfsb.lang.%loop-player%} to loop-player.getLocale()
- if {kfsb.langlist::*} does not contain {kfsb.lang.%loop-player%}:
- set {kfsb.lang.%loop-player%} to "{@DefaultLanguage}"
- if {kfsb.status} is "ingame":
- if size of {kfsb.redalive::*} is smaller than 1:
- set {kfsb.status} to "ending"
- set {kfsb.winteam} to "blue"
- kfsbEndgame()
- if size of {kfsb.bluealive::*} is smaller than 1:
- set {kfsb.status} to "ending"
- set {kfsb.winteam} to "red"
- kfsbEndgame()
- command /SphereBattle [<text>] [<text>] [<text>] [<text>]:
- aliases: /sb, /sphere
- trigger:
- if arg 1 is "setlang" or "lang":
- if arg 2 isn't set:
- send skript-yaml value "detecting-language" from "%{kfsb.lang.%player%}%"
- set {kfsb.lang.%player%} to player.getLocale()
- delete {kfsb.selfsetlang.%player%}
- else:
- set {kfsb.selfsetlang.%player%} to 1
- set {kfsb.lang.%player%} to arg 2
- if {kfsb.langlist::*} does not contain {kfsb.lang.%player%}:
- set {kfsb.lang.%player%} to "{@DefaultLanguage}"
- send skript-yaml value "language-detected" from "%{kfsb.lang.%player%}%"
- if arg 1 is "reload":
- if player doesn't have permission "kfsb.reload":
- send yaml value "no-permission" from "%{kfsb.lang.%player%}%"
- else:
- loop {kfsb.langlist::*}:
- delete {kfsb.langlist::%loop-index%}
- loop directory "plugins/Skript/scripts/SphereBattle/lang/"'s files:
- if loop-string.endsWith(".yml") is true:
- set {_temp} to relative path of loop-string
- set {_temp2} to {_temp}
- replace every ".yml" with "" in {_temp}
- replace every "plugins/Skript/scripts/SphereBattle/lang/" with "" in {_temp}
- replace every "plugins\Skript\scripts\SphereBattle\lang\" with "" in {_temp}
- load yaml "%{_temp2}%" as "%{_temp}%"
- set {kfsb.langlist::%{_temp}%} to {_temp}
- send yaml value "reloaded" from "%{kfsb.lang.%player%}%"
- if arg 1 is not set:
- set {_showHelp} to true
- else if arg 1 is "help":
- set {_showHelp} to true
- if {_showHelp} is true:
- send yaml value "command-help" from "%{kfsb.lang.%player%}%"
- if arg 1 is "admin":
- if player has permission "spherebattle.admin":
- if arg 2 is not set:
- set {_showHelp} to true
- else if arg 2 is "help":
- set {_showHelp} to true
- if {_showHelp} is true:
- send yaml value "command-admin-help" from {kfsb.lang.%player%}
- else if arg 2 is "addmap":
- if arg 3 is not set:
- send yaml value "command-addmap-noname" from {kfsb.lang.%player%}
- else if {kfsb.map::%arg 3%} is set:
- send yaml value "command-addmap-dupe" from {kfsb.lang.%player%}
- else:
- set {_temp} to yaml value "command-addmap-success" from {kfsb.lang.%player%}
- replace every "{mapname}" with arg 3 in {_temp}
- send {_temp}
- set {kfsb.map::%arg 3%} to arg 3
- else if arg 2 is "removemap":
- if arg 3 is not set:
- send yaml value "command-removemap-noname" from {kfsb.lang.%player%}
- else if {kfsb.map::%arg 3%} is not set:
- send yaml value "command-removemap-unexist" from {kfsb.lang.%player%}
- else:
- set {_temp} to yaml value "command-removemap-success" from {kfsb.lang.%player%}
- replace every "{mapname}" with arg 3 in {_temp}
- send {_temp}
- delete {kfsb.map::%arg 3%}
- delete {kfsb.location::%arg 3%::redspawn}
- delete {kfsb.location::%arg 3%::bluespawn}
- delete {kfsb.location::%arg 3%::pos1}
- delete {kfsb.location::%arg 3%::pos2}
- delete {kfsb.redfacing.%arg 3%}
- delete {kfsb.bluefacing.%arg 3%}
- else if arg 2 is "setspawn":
- if arg 3 is not set:
- send yaml value "command-setspawn-nomap" from {kfsb.lang.%player%}
- else if {kfsb.map::%arg 3%} is not set:
- send yaml value "command-setspawn-mapunexist" from {kfsb.lang.%player%}
- else if arg 4 is not set:
- send yaml value "command-setspawn-noteam" from {kfsb.lang.%player%}
- else if arg 4 is not "red" or "blue":
- send yaml value "command-setspawn-invalidteam" from {kfsb.lang.%player%}
- else:
- set {_temp} to yaml value "command-setspawn-success" from {kfsb.lang.%player%}
- replace every "{team}" with arg 4 in {_temp}
- replace every "{mapname}" with arg 3 in {_temp}
- send {_temp}
- set {_loc} to location of player
- if arg 4 is "red":
- set {_temp} to red wool
- else if arg 4 is "blue":
- set {_temp} to blue wool
- set block at {_loc} to {_temp}
- set {kfsb.location::%arg 3%::%uncolored arg 4%spawn} to location of block at {_loc}
- set {kfsb.%uncolored arg 4%facing.%arg 3%} to facing of player
- kfsbSetFacing(player, "%{kfsb.%uncolored arg 4%facing.%arg 3%}%", location above {kfsb.location::%arg 3%::%uncolored arg 4%spawn})
- else if arg 2 is "wand":
- send yaml value "command-wand-success" from {kfsb.lang.%player%}
- set {_itemname} to yaml value "item-wand-name" from {kfsb.lang.%player%}
- set {_itemname} to "%{_itemname}%&1&2&3&4&f&r"
- give player 1 of glowing blaze rod named {_itemname} with lore yaml value "item-wand-lore" from {kfsb.lang.%player%}
- else if arg 2 is "setregion":
- if arg 3 is not set:
- send yaml value "command-setregion-noname" from {kfsb.lang.%player%}
- else if {kfsb.map::%arg 3%} is not set:
- send yaml value "command-setregion-unexist" from {kfsb.lang.%player%}
- else if {kfsb.selection.pos1.%player%} is not set:
- send yaml value "command-setregion-noregion" from {kfsb.lang.%player%}
- else if {kfsb.selection.pos2.%player%} is not set:
- send yaml value "command-setregion-noregion" from {kfsb.lang.%player%}
- else:
- set {_temp} to yaml value "command-setregion-success" from {kfsb.lang.%player%}
- replace every "{mapname}" with arg 3 in {_temp}
- set {kfsb.location::%arg 3%::pos1} to {kfsb.selection.pos1.%player%}
- set {kfsb.location::%arg 3%::pos2} to {kfsb.selection.pos2.%player%}
- send {_temp}
- else if arg 2 is "setlobby":
- send yaml value "command-setlobby-success" from {kfsb.lang.%player%}
- set {kfsb.lobby} to location of player
- if pitch of {kfsb.lobby} is 0:
- set pitch of {kfsb.lobby} to 0.01
- if yaw of {kfsb.lobby} is 0:
- set yaw of {kfsb.lobby} to 0.01
- teleport player to {kfsb.lobby}
- else if arg 2 is "start":
- if {kfsb.status} is not set:
- if size of {kfsb.ingame::*} >= {@NeededPlayersToStart}:
- send yaml value "command-start-success" from {kfsb.lang.%player%}
- set {kfsb.startCountDown} to 1
- else:
- send yaml value "command-start-notenough" from {kfsb.lang.%player%}
- else:
- send yaml value "command-start-alreadystarted" from {kfsb.lang.%player%}
- else:
- send yaml value "no-permission" from {kfsb.lang.%player%}
- else if arg 1 is "join":
- kfsbJoinGame(player)
- else if arg 1 is "leave":
- kfsbLeaveGame(player)
- else if arg 1 is "vote":
- if {kfsb.ingame::%player%} is set:
- if {kfsb.playerstatus::%{_player}%} is not set:
- if arg 2 is not set:
- send yaml value "command-vote-unvote" from {kfsb.lang.%player%}
- delete {kfsb.votes.%{kfsb.lastvotedmap::%player%}%::%player%}
- if player has a gui:
- kfsbOpenMapVoteGui(player)
- else if {kfsb.map::%arg 2%} is not set:
- send yaml value "command-vote-unexist" from {kfsb.lang.%player%}
- else:
- delete {kfsb.votes.%{kfsb.lastvotedmap::%player%}%::%player%}
- set {_temp} to yaml value "command-vote-success" from {kfsb.lang.%player%}
- replace every "{mapname}" with arg 2 in {_temp}
- send {_temp}
- set {kfsb.lastvotedmap::%player%} to arg 2
- set {kfsb.votes.%arg 2%::%player%} to true
- if player has a gui:
- kfsbOpenMapVoteGui(player)
- loop all players:
- if loop-player has a gui:
- if inventory name of loop-player's current inventory contains "&1&2&3&4&e&o":
- kfsbOpenMapVoteGui(loop-player)
- else:
- send yaml value "command-vote-disabled" from {kfsb.lang.%player%}
- else:
- send yaml value "command-vote-disabled" from {kfsb.lang.%player%}
- else if arg 1 is "shout":
- if {kfsb.ingame::%player%} is set:
- if {kfsb.playerstatus::%player%} is "ingame" or "ending":
- if arg 2 is not set:
- send yaml value "command-shout-nomessage" from {kfsb.lang.%player%}
- else:
- set {kfsb.shoutchat.%player%} to true
- set {_temp} to arg 2
- if arg 3 is set:
- set {_temp} to "%arg 2% %arg 3%"
- if arg 4 is set:
- set {_temp} to "%arg 2% %arg 3% %arg 4%"
- player.chat({_temp})
- else:
- send yaml value "command-shout-disabled" from {kfsb.lang.%player%}
- else:
- send yaml value "command-shout-disabled" from {kfsb.lang.%player%}
- on break:
- if {kfsb.respawnCountdown.%player%} is set:
- cancel event
- stop
- if name of player's tool contains "&1&2&3&4&f&r":
- player has permission "spherebattle.admin"
- cancel event
- on left click:
- if name of player's tool contains "&1&2&3&4&f&r":
- player's target block is set
- player has permission "spherebattle.admin"
- set {_temp} to yaml value "chat-wand-pos1" from {kfsb.lang.%player%}
- replace every "{location}" with "%location of target block%" in {_temp}
- set {kfsb.selection.pos1.%player%} to location of target block
- send {_temp}
- on right click:
- if {kfsb.isSpectator::%player%} is set:
- cancel event
- if name of player's tool contains "&1&2&3&4&f&r":
- player's target block is set
- player has permission "spherebattle.admin"
- cancel event
- set {_temp} to yaml value "chat-wand-pos2" from {kfsb.lang.%player%}
- replace every "{location}" with "%location of target block%" in {_temp}
- set {kfsb.selection.pos2.%player%} to location of target block
- send {_temp}
- else if name of player's tool contains "&1&2&3&4&e&o":
- {kfsb.ingame::%player%} is set
- kfsbOpenMapVoteGui(player)
- else if name of player's tool contains "&1&2&3&4&r&e&m":
- {kfsb.ingame::%player%} is set
- kfsbOpenTeleporterGui(player)
- else if {kfsb.ingame::%player%} is set:
- if {kfsb.isSpectator::%player%} is set:
- cancel event
- if target block of player is chest:
- open "CHEST" to player
- set {_opened} to true
- if target block of player is furnace:
- open "FURNACE" to player
- set {_opened} to true
- if target block of player is hopper:
- open "HOPPER" to player
- set {_opened} to true
- if target block of player is dispenser:
- open "DISPENSER" to player
- set {_opened} to true
- if target block of player is dropper:
- open "DROPPER" to player
- set {_opened} to true
- if target block of player is trapped chest:
- open "CHEST" to player
- set {_opened} to true
- if {_opened} is true:
- set {ksfb.blockloc.%player%} to location of target block of player
- set {_slot} to 0
- loop 27 times:
- set {_invitem::%{_slot}%} to slot {_slot} of target block of player's inventory
- create a gui slot {_slot} of player with {_invitem::%{_slot}%}
- add 1 to {_slot}
- on quit:
- kfsbLeaveGame(player)
- delete {kfsb.selection.pos1.%player%}
- delete {kfsb.selection.pos2.%player%}
- on place:
- if {kfsb.respawnCountdown.%player%} is set:
- cancel event
- stop
- if {kfsb.isSpectator::%player%} is set:
- cancel event
- stop
- if {kfsb.ingame::%player%} is set:
- if {kfsb.playerstatus::%player%} is not set:
- cancel event
- stop
- if {kfsb.respawnCountdown.%player%} is set:
- cancel event
- stop
- on break:
- if {kfsb.isSpectator::%player%} is set:
- cancel event
- stop
- if {kfsb.respawnCountdown.%player%} is set:
- cancel event
- stop
- if {kfsb.ingame::%player%} is set:
- if {kfsb.playerstatus::%player%} is not set:
- cancel event
- else if {kfsb.playerstatus::%player%} is "ingame":
- if location of event-block is not within {kfsb.mapdata.pos1} to {kfsb.mapdata.pos2}:
- cancel event
- send yaml value "chat-cantbreakblocksthere" from {kfsb.lang.%player%}
- else if event-block is blue wool:
- if {kfsb.team::%player%} is "blue":
- "%{kfsb.mapdata.bluespawn}%" is "%location of event-block%"
- cancel event
- set block at location of event-block to air
- set {_temp} to yaml value "item-bluespawn-name" from {kfsb.lang.%player%}
- set {_itemname} to "%{_temp}%&1&2&3&4&b&1"
- give blue wool named {_itemname} to player
- set {kfsb.spawnmoving.blue} to true
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- {kfsb.team::%loop-player%} is "blue"
- send yaml value "chat-spawnismoving" from {kfsb.lang.%loop-player%} to loop-player
- kfsbDeleteHologram(loop-player)
- else:
- "%{kfsb.mapdata.bluespawn}%" is "%location of event-block%"
- cancel event
- set block at location of event-block to air
- set {kfsb.spawnmoving.blue} to true
- set {kfsb.spawnbroken.blue} to true
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-spawnbroke-blue-broadcast" from {kfsb.lang.%loop-player%}
- replace every "{player}" with kfsbGetUsername(player) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- {kfsb.team::%loop-player%} is "blue"
- kfsbDeleteHologram(loop-player)
- set {_temp.%loop-player%} to yaml value "chat-spawnbroke" from {kfsb.lang.%loop-player%}
- replace every "{player}" with kfsbGetUsername(player) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- play "ENTITY_ENDERDRAGON_GROWL" to loop-player at volume 10 at pitch 5
- send title yaml value "title-spawn-destroyed" from {kfsb.lang.%loop-player%} with subtitle yaml value "title-spawn-destroyed-sub" from {kfsb.lang.%loop-player%} to loop-player for 4 seconds and 0 ticks and 0 ticks
- else if event-block is red wool:
- if {kfsb.team::%player%} is "red":
- "%{kfsb.mapdata.redspawn}%" is "%location of event-block%"
- cancel event
- set block at location of event-block to air
- set {_temp} to yaml value "item-redspawn-name" from {kfsb.lang.%player%}
- set {_itemname} to "%{_temp}%&1&2&3&4&r&1"
- give red wool named {_itemname} to player
- set {kfsb.spawnmoving.red} to true
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- {kfsb.team::%loop-player%} is "red"
- send yaml value "chat-spawnismoving" from {kfsb.lang.%loop-player%} to loop-player
- kfsbDeleteHologram(loop-player)
- else:
- set {kfsb.spawnmoving.red} to true
- set {kfsb.spawnbroken.red} to true
- loop all players:
- "%{kfsb.mapdata.redspawn}%" is "%location of event-block%"
- cancel event
- set block at location of event-block to air
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-spawnbroke-red-broadcast" from {kfsb.lang.%loop-player%}
- replace every "{player}" with kfsbGetUsername(player) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- {kfsb.team::%loop-player%} is "red"
- kfsbDeleteHologram(loop-player)
- set {_temp.%loop-player%} to yaml value "chat-spawnbroke" from {kfsb.lang.%loop-player%}
- replace every "{player}" with kfsbGetUsername(player) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- play "ENTITY_ENDERDRAGON_GROWL" to loop-player at volume 10 at pitch 5
- send title yaml value "title-spawn-destroyed" from {kfsb.lang.%loop-player%} with subtitle yaml value "title-spawn-destroyed-sub" from {kfsb.lang.%loop-player%} to loop-player for 4 seconds and 0 ticks and 0 ticks
- on drop:
- if {kfsb.isSpectator::%player%} is set:
- cancel event
- stop
- if {kfsb.ingame::%player%} is set:
- if {kfsb.playerstatus::%player%} is not set:
- cancel event
- else if {kfsb.playerstatus::%player%} is "ingame":
- if name of event-item contains "&1&2&3&4&b&1":
- cancel event
- else if name of event-item contains "&1&2&3&4&r&1":
- cancel event
- on PlayerSwapHandItemsEvent:
- set {_player} to event.getPlayer()
- if name of event.getOffHandItem() contains "&1&2&3&4&b&1":
- cancel event
- if name of event.getOffHandItem() contains "&1&2&3&4&r&1":
- cancel event
- if {kfsb.isSpectator::%{_player}%} is set:
- cancel event
- stop
- if {kfsb.ingame::%{_player}%} is set:
- if {kfsb.playerstatus::%{_player}%} is not set:
- cancel event
- on inventory click:
- send "%name of event-item%" to console
- if clicked item is blue wool:
- clicked item's name contains "&1&2&3&4&b&1"
- cancel event
- if clicked item is red wool:
- clicked item's name contains "&1&2&3&4&r&1"
- cancel event
- if {kfsb.isSpectator::%player%} is set:
- cancel event
- stop
- if {kfsb.ingame::%player%} is set:
- if {kfsb.playerstatus::%player%} is not set:
- cancel event
- on damage:
- if {kfsb.respawnCountdown.%victim%} is set:
- cancel event
- if {kfsb.respawnCountdown.%attacker%} is set:
- cancel event
- if {kfsb.isSpectator::%victim%} is set:
- cancel event
- if {kfsb.isSpectator::%attacker%} is set:
- cancel event
- victim is a player
- if {kfsb.ingame::%victim%} is set:
- if {kfsb.playerstatus::%victim%} is not set:
- cancel event
- else if {kfsb.status} is "ingame":
- if {kfsb.team::%attacker%} is {kfsb.team::%victim%}:
- cancel event
- stop
- else if {kfsb.status} is "ending":
- cancel event
- on death of player:
- {kfsb.ingame::%player%} is set
- delete {kfsb.noSetSpectator.%victim%}
- set death message to ""
- if victim's tool is totem of undying:
- "%damage cause%" is not "void"
- stop
- if {kfsb.spawnmoving.%{kfsb.team::%victim%}%} is not set:
- heal victim
- set victim's health to 10
- set victim's max health to 10
- set victim's health to 10
- set victim's hunger to 10
- set victim's level to 0
- set victim's level progress to 0
- set victim's saturation to 10
- set victim's health to 10
- loop all items of victim:
- clear loop-item
- clear potion effects of victim
- if "%damage cause%" is "void":
- set {kfsb.nodeathaction.%victim%} to true
- if {kfsb.lasthit::%victim%} is set:
- add 1 to {kfsb.kills::%{kfsb.lasthit::%victim%}%}
- play "ENTITY_EXPERIENCE_ORB_PICKUP" to {kfsb.lasthit::%victim%} at volume 10 at pitch 5
- set {_temp} to yaml value "chat-deathmessage-knockedintothevoid-you" from {kfsb.lang.%victim%}
- replace every "{attacker}" with kfsbGetUsername({kfsb.lasthit::%victim%}) in {_temp}
- send {_temp} to victim
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- if loop-player is not victim:
- set {_temp.%loop-player%} to yaml value "chat-deathmessage-knockedintothevoid" from {kfsb.lang.%loop-player%}
- replace every "{victim}" with kfsbGetUsername(victim) in {_temp.%loop-player%}
- replace every "{attacker}" with kfsbGetUsername({kfsb.lasthit::%victim%}) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else:
- send yaml value "chat-deathmessage-fellintothevoid-you" from {kfsb.lang.%victim%} to victim
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- if loop-player is not victim:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-deathmessage-fellintothevoid" from {kfsb.lang.%loop-player%}
- replace every "{victim}" with kfsbGetUsername(victim) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else if attacker is a player:
- add 1 to {kfsb.kills::%attacker%}
- play "ENTITY_EXPERIENCE_ORB_PICKUP" to attacker at volume 10 at pitch 5
- set {_temp} to yaml value "chat-deathmessage-killed-you" from {kfsb.lang.%victim%}
- replace every "{attacker}" with kfsbGetUsername(attacker) in {_temp}
- send {_temp} to victim
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- if loop-player is not victim:
- set {_temp.%loop-player%} to yaml value "chat-deathmessage-killed" from {kfsb.lang.%loop-player%}
- replace every "{victim}" with kfsbGetUsername(victim) in {_temp.%loop-player%}
- replace every "{attacker}" with kfsbGetUsername(attacker) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else if "%damage cause%" is "fall":
- send yaml value "chat-deathmessage-fellfromahighplace-you" from {kfsb.lang.%victim%} to victim
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- if loop-player is not victim:
- set {_temp.%loop-player%} to yaml value "chat-deathmessage-fellfromahighplace" from {kfsb.lang.%loop-player%}
- replace every "{victim}" with kfsbGetUsername(victim) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else:
- send yaml value "chat-deathmessage-died-you" from {kfsb.lang.%victim%} to victim
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- if loop-player is not victim:
- set {_temp.%loop-player%} to yaml value "chat-deathmessage-died" from {kfsb.lang.%loop-player%}
- replace every "{victim}" with kfsbGetUsername(victim) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- set {_stayLocation.%victim%} to location of victim
- victim.setAllowFlight(true)
- victim.setFlying(true)
- apply blindness without particles to victim for 9999 days
- set {kfsb.respawnCountdown.%victim%} to "{@RespawnCooldownTime}" parsed as integer
- hide victim from all players
- loop {@RespawnCooldownTime} times:
- if {kfsb.ingame::%victim%} is not set:
- stop
- play "BLOCK_NOTE_HAT" to victim at volume 10 at pitch 5
- set {_temp} to yaml value "chat-respawning" from {kfsb.lang.%victim%}
- replace every "{seconds}" with "%{kfsb.respawnCountdown.%victim%}%" in {_temp}
- if {kfsb.respawnCountDown.%victim%} < 2:
- replace every "{s}" with "" in {_temp}
- else:
- replace every "{s}" with "s" in {_temp}
- set {_temp2} to {_temp}
- if {_firstmessage} is not set:
- set {_temp3} to yaml value "chat-youdied" from {kfsb.lang.%victim%}
- set {_temp2} to "%{_temp3}% %{_temp}%"
- set {_firstmessage} to true
- send {_temp2} to victim
- set {_temp} to yaml value "title-respawning" from {kfsb.lang.%victim%}
- replace every "{seconds}" with "%{kfsb.respawnCountdown.%victim%}%" in {_temp}
- send title yaml value "title-youdied" from {kfsb.lang.%victim%} with subtitle {_temp} to victim for 2 seconds and 0 ticks and 0 ticks
- remove 1 from {kfsb.respawnCountdown.%victim%}
- loop 20 times:
- teleport victim to {_stayLocation.%victim%}
- wait a tick
- delete {kfsb.respawnCountdown.%victim%}
- remove blindness from victim
- victim.setAllowFlight(false)
- reveal victim to all players
- send yaml value "chat-respawned" from {kfsb.lang.%victim%} to victim
- send title yaml value "title-respawned" from {kfsb.lang.%victim%} with subtitle "" to victim for 1 seconds and 0 ticks and 10 ticks
- kfsbSetFacing(victim, "%{kfsb.%{kfsb.team::%victim%}%facing.%{kfsb.selectedMap}%}%", location of victim)
- set victim's fall distance to 0
- teleport victim to location 1 meter above {kfsb.mapdata.%{kfsb.team::%victim%}%spawn}
- play "BLOCK_NOTE_HARP" to victim at volume 10 at pitch 5
- else if {kfsb.spawnbroken.%{kfsb.team::%victim%}%} is not set:
- heal victim
- set victim's health to 10
- set victim's max health to 10
- set victim's health to 10
- set victim's hunger to 10
- set victim's level to 0
- set victim's level progress to 0
- set victim's saturation to 10
- set victim's health to 10
- loop name of all items of victim:
- if loop-string contains "&1&2&3&4&r&1" or "&1&2&3&4&b&1":
- set {_hasSpawnBlock} to true
- loop all items of victim:
- if name of loop-item contains "&1&2&3&4&r&1" or "&1&2&3&4&b&1":
- remove loop-item from drops
- if {_hasSpawnBlock} is not set:
- clear loop-item
- clear drops
- loop all items of victim:
- if name of loop-item contains "&1&2&3&4&r&1":
- set {_uselessVariable} to true
- else if name of loop-item contains "&1&2&3&4&b&1":
- set {_uselessVariable} to true
- else:
- set {_dropLoc} to location 0.5 meters above victim
- set x-coordinate of {_dropLoc} to x-coordinate of {_dropLoc} + 0.5
- set z-coordinate of {_dropLoc} to z-coordinate of {_dropLoc} + 0.5
- drop loop-item at {_dropLoc}
- clear loop-item
- clear potion effects of victim
- if "%damage cause%" is "void":
- set {kfsb.nodeathaction.%victim%} to true
- if {kfsb.lasthit::%victim%} is set:
- add 1 to {kfsb.kills::%{kfsb.lasthit::%victim%}%}
- play "ENTITY_EXPERIENCE_ORB_PICKUP" to {kfsb.lasthit::%victim%} at volume 10 at pitch 5
- set {_temp} to yaml value "chat-deathmessage-knockedintothevoid-you" from {kfsb.lang.%victim%}
- replace every "{attacker}" with kfsbGetUsername({kfsb.lasthit::%victim%}) in {_temp}
- send {_temp} to victim
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- if loop-player is not victim:
- set {_temp.%loop-player%} to yaml value "chat-deathmessage-knockedintothevoid" from {kfsb.lang.%loop-player%}
- replace every "{victim}" with kfsbGetUsername(victim) in {_temp.%loop-player%}
- replace every "{attacker}" with kfsbGetUsername({kfsb.lasthit::%victim%}) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else:
- send yaml value "chat-deathmessage-fellintothevoid-you" from {kfsb.lang.%victim%} to victim
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- if loop-player is not victim:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-deathmessage-fellintothevoid" from {kfsb.lang.%loop-player%}
- replace every "{victim}" with kfsbGetUsername(victim) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else if attacker is a player:
- add 1 to {kfsb.kills::%attacker%}
- play "ENTITY_EXPERIENCE_ORB_PICKUP" to attacker at volume 10 at pitch 5
- set {_temp} to yaml value "chat-deathmessage-killed-you" from {kfsb.lang.%victim%}
- replace every "{attacker}" with kfsbGetUsername(attacker) in {_temp}
- send {_temp} to victim
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- if loop-player is not victim:
- set {_temp.%loop-player%} to yaml value "chat-deathmessage-killed" from {kfsb.lang.%loop-player%}
- replace every "{victim}" with kfsbGetUsername(victim) in {_temp.%loop-player%}
- replace every "{attacker}" with kfsbGetUsername(attacker) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else if "%damage cause%" is "fall":
- send yaml value "chat-deathmessage-fellfromahighplace-you" from {kfsb.lang.%victim%} to victim
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- if loop-player is not victim:
- set {_temp.%loop-player%} to yaml value "chat-deathmessage-fellfromahighplace" from {kfsb.lang.%loop-player%}
- replace every "{victim}" with kfsbGetUsername(victim) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else:
- send yaml value "chat-deathmessage-died-you" from {kfsb.lang.%victim%} to victim
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- if loop-player is not victim:
- set {_temp.%loop-player%} to yaml value "chat-deathmessage-died" from {kfsb.lang.%loop-player%}
- replace every "{victim}" with kfsbGetUsername(victim) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- set {_stayLocation.%victim%} to location of victim
- victim.setAllowFlight(true)
- victim.setFlying(true)
- apply blindness without particles to victim for 9999 days
- hide victim from all players
- if {_hasSpawnBlock} is true:
- delete {kfsb.noSetSpectator.%victim%}
- kfsbDeathEvent(victim)
- else:
- set {kfsb.respawnCountdown.%victim%} to 1
- while {kfsb.spawnmoving.%{kfsb.team::%victim%}%} is true:
- if {kfsb.ingame::%victim%} is not set:
- stop
- if {kfsb.spawnbroken.%{kfsb.team::%victim%}%} is set:
- delete {kfsb.noSetSpectator.%victim%}
- kfsbDeathEvent(victim)
- stop
- if {_firstmessage} is not set:
- set {_firstmessage} to true
- send yaml value "chat-youdied" from {kfsb.lang.%victim%} to victim
- send yaml value "chat-respawnwaiting" from {kfsb.lang.%victim%} to victim
- send title yaml value "title-youdied" from {kfsb.lang.%victim%} with subtitle yaml value "title-respawnwaiting" from {kfsb.lang.%victim%} to victim for 2 seconds and 0 ticks and 0 ticks
- teleport victim to {_stayLocation.%victim%}
- wait a tick
- delete {kfsb.respawnCountdown.%victim%}
- remove blindness from victim
- victim.setAllowFlight(false)
- reveal victim to all players
- send yaml value "chat-respawned" from {kfsb.lang.%victim%} to victim
- send title yaml value "title-respawned" from {kfsb.lang.%victim%} with subtitle "" to victim for 1 seconds and 0 ticks and 10 ticks
- kfsbSetFacing(victim, "%{kfsb.%{kfsb.team::%victim%}%facing.%{kfsb.selectedMap}%}%", location of victim)
- set victim's fall distance to 0
- teleport victim to location 1 meter above {kfsb.mapdata.%{kfsb.team::%victim%}%spawn}
- play "BLOCK_NOTE_HARP" to victim at volume 10 at pitch 5
- else:
- heal victim
- if "%damage cause%" is "void":
- set {kfsb.nodeathaction.%victim%} to true
- if {kfsb.lasthit::%victim%} is set:
- add 1 to {kfsb.kills::%{kfsb.lasthit::%victim%}%}
- play "ENTITY_EXPERIENCE_ORB_PICKUP" to {kfsb.lasthit::%victim%} at volume 10 at pitch 5
- set {_temp} to yaml value "chat-deathmessage-knockedintothevoid-you" from {kfsb.lang.%victim%}
- replace every "{attacker}" with kfsbGetUsername({kfsb.lasthit::%victim%}) in {_temp}
- send {_temp} to victim
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- if loop-player is not victim:
- set {_temp.%loop-player%} to yaml value "chat-deathmessage-knockedintothevoid" from {kfsb.lang.%loop-player%}
- replace every "{victim}" with kfsbGetUsername(victim) in {_temp.%loop-player%}
- replace every "{attacker}" with kfsbGetUsername({kfsb.lasthit::%victim%}) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else:
- send yaml value "chat-deathmessage-fellintothevoid-you" from {kfsb.lang.%victim%} to victim
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- if loop-player is not victim:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-deathmessage-fellintothevoid" from {kfsb.lang.%loop-player%}
- replace every "{victim}" with kfsbGetUsername(victim) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else if attacker is a player:
- add 1 to {kfsb.kills::%attacker%}
- play "ENTITY_EXPERIENCE_ORB_PICKUP" to attacker at volume 10 at pitch 5
- set {_temp} to yaml value "chat-deathmessage-killed-you" from {kfsb.lang.%victim%}
- replace every "{attacker}" with kfsbGetUsername(attacker) in {_temp}
- send {_temp} to victim
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- if loop-player is not victim:
- set {_temp.%loop-player%} to yaml value "chat-deathmessage-killed" from {kfsb.lang.%loop-player%}
- replace every "{victim}" with kfsbGetUsername(victim) in {_temp.%loop-player%}
- replace every "{attacker}" with kfsbGetUsername(attacker) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else if "%damage cause%" is "fall":
- send yaml value "chat-deathmessage-fellfromahighplace-you" from {kfsb.lang.%victim%} to victim
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- if loop-player is not victim:
- set {_temp.%loop-player%} to yaml value "chat-deathmessage-fellfromahighplace" from {kfsb.lang.%loop-player%}
- replace every "{victim}" with kfsbGetUsername(victim) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- else:
- send yaml value "chat-deathmessage-died-you" from {kfsb.lang.%victim%} to victim
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- if loop-player is not victim:
- set {_temp.%loop-player%} to yaml value "chat-deathmessage-died" from {kfsb.lang.%loop-player%}
- replace every "{victim}" with kfsbGetUsername(victim) in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- clear drops
- loop all items of victim:
- if name of loop-item contains "&1&2&3&4&r&1":
- set {_uselessVariable} to true
- else if name of loop-item contains "&1&2&3&4&b&1":
- set {_uselessVariable} to true
- else:
- set {_dropLoc} to location 0.5 meters above victim
- set x-coordinate of {_dropLoc} to x-coordinate of {_dropLoc} + 0.5
- set z-coordinate of {_dropLoc} to z-coordinate of {_dropLoc} + 0.5
- drop loop-item at {_dropLoc}
- clear loop-item
- kfsbDeathEvent(victim)
- on place:
- {kfsb.isSpectator::%player%} is not set
- if {kfsb.ingame::%player%} is set:
- if {kfsb.playerstatus::%player%} is "ingame":
- if location of event-block is not within {kfsb.mapdata.pos1} to {kfsb.mapdata.pos2}:
- cancel event
- send yaml value "chat-cantplaceblocksthere" from {kfsb.lang.%player%}
- else if event-block is blue wool:
- player's tool's name contains "&1&2&3&4&b&1"
- {kfsb.spawnmoving.blue} is true
- delete {kfsb.spawnmoving.blue}
- set {kfsb.mapdata.bluespawn} to location of event-block
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- {kfsb.team::%loop-player%} is "blue"
- send yaml value "chat-spawnplaced" from {kfsb.lang.%loop-player%} to loop-player
- kfsbPlaceHologram(loop-player)
- else if event-block is red wool:
- player's tool's name contains "&1&2&3&4&r&1"
- {kfsb.spawnmoving.red} is true
- delete {kfsb.spawnmoving.red}
- set {kfsb.mapdata.redspawn} to location of event-block
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- {kfsb.team::%loop-player%} is "red"
- send yaml value "chat-spawnplaced" from {kfsb.lang.%loop-player%} to loop-player
- kfsbPlaceHologram(loop-player)
- on damage:
- if {kfsb.respawnCountdown.%victim%} is set:
- cancel event
- stop
- if attacker is a player:
- set {kfsb.lasthit::%victim%} to attacker
- every 5 ticks:
- loop all players:
- set {_temp.%loop-player%} to loop-player.isOnGround()
- if {_temp.%loop-player%} is true:
- delete {kfsb.lasthit::%loop-player%}
- on quit:
- delete {kfsb.lasthit::%player%}
- delete {kfsb.respawnCountdown.%player%}
- on PlayerChatEvent with priority lowest:
- set {_player} to event.getPlayer()
- if {kfsb.ingame::%{_player}%} is set:
- if {kfsb.status} is "ingame":
- if {kfsb.playerstatus::%{_player}%} is "ingame":
- cancel event
- if {kfsb.isSpectator::%{_player}%} is set:
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- {kfsb.isSpectator::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-playerchat-spectator" from {kfsb.lang.%loop-player%}
- replace every "{player}" with "%{_player}%" in {_temp.%loop-player%}
- replace every "{message}" with event.getMessage() in {_temp.%loop-player%}
- if {kfsb.team::%{_player}%} is "red":
- replace every "{team}" with "&c[RED]" in {_temp.%loop-player%}
- else if {kfsb.team::%{_player}%} is "blue":
- replace every "{team}" with "&9[BLUE]" in {_temp.%loop-player%}
- send {_temp.%loop-player%} to loop-player
- stop
- if {kfsb.shoutchat.%{_player}%} is set:
- delete {kfsb.shoutchat.%{_player}%}
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-playerchat-shout" from {kfsb.lang.%loop-player%}
- replace every "{player}" with "%{_player}%" in {_temp.%loop-player%}
- replace every "{message}" with event.getMessage() in {_temp.%loop-player%}
- if {kfsb.team::%{_player}%} is "red":
- replace every "{team}" with "&c[RED]" in {_temp.%loop-player%}
- else if {kfsb.team::%{_player}%} is "blue":
- replace every "{team}" with "&9[BLUE]" in {_temp.%loop-player%}
- send "%{_temp.%loop-player%}%" to loop-player
- else:
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- {kfsb.team::%loop-player%} is {kfsb.team::%{_player}%}
- set {_temp.%loop-player%} to yaml value "chat-playerchat-team" from {kfsb.lang.%loop-player%}
- replace every "{player}" with "%{_player}%" in {_temp.%loop-player%}
- replace every "{message}" with event.getMessage() in {_temp.%loop-player%}
- if {kfsb.team::%{_player}%} is "red":
- replace every "{team}" with "&c[RED]" in {_temp.%loop-player%}
- else if {kfsb.team::%{_player}%} is "blue":
- replace every "{team}" with "&9[BLUE]" in {_temp.%loop-player%}
- send "%{_temp.%loop-player%}%" to loop-player
- else if {kfsb.status} is "ending":
- cancel event
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- set {_temp.%loop-player%} to yaml value "chat-playerchat-shout" from {kfsb.lang.%loop-player%}
- replace every "{player}" with "%{_player}%" in {_temp.%loop-player%}
- replace every "{message}" with event.getMessage() in {_temp.%loop-player%}
- if {kfsb.team::%{_player}%} is "red":
- replace every "{team}" with "&c[RED]" in {_temp.%loop-player%}
- else if {kfsb.team::%{_player}%} is "blue":
- replace every "{team}" with "&9[BLUE]" in {_temp.%loop-player%}
- send "%{_temp.%loop-player%}%" to loop-player
- else if {kfsb.playerstatus::%{_player}%} is not "ingame":
- delete {kfsb.shoutchat.%{_player}%}
- else:
- delete {kfsb.shoutchat.%{_player}%}
- every 5 ticks:
- loop all players:
- {kfsb.ingame::%loop-player%} is set
- {kfsb.isSpectator::%loop-player%} is set
- if {kfsb.blockloc.%loop-player%} is set:
- if block at {kfsb.blockloc.%loop-player%} is not chest or furnace or dropper or dispenser or hopper or trapped chest:
- close loop-player's inventory
- delete {kfsb.blockloc.%loop-player%}
- stop
- set {_slot} to 0
- loop 27 times:
- set {_invitem::%{_slot}%} to slot {_slot} of block at {kfsb.blockloc.%loop-player%}'s inventory
- create a gui slot {_slot} of loop-player with {_invitem::%{_slot}%}
- add 1 to {_slot}
- if loop-player does not have a gui:
- delete {kfsb.blockloc.%loop-player%}
- on drop:
- if {kfsb.respawnCountdown.%player%} is set:
- cancel event
- stop
- if {kfsb.isSpectator::%player%} is set:
- cancel event
- stop
- if {kfsb.respawnCountdown.%player%} is set:
- cancel event
- stop
- on pickup:
- if {kfsb.respawnCountdown.%player%} is set:
- cancel event
- stop
- if {kfsb.isSpectator::%player%} is set:
- cancel event
- stop
- if {kfsb.respawnCountdown.%player%} is set:
- cancel event
- stop
- on target:
- if {kfsb.respawnCountdown.%player%} is set:
- cancel event
- stop
- if {kfsb.isSpectator::%player%} is set:
- cancel event
- stop
- if {kfsb.respawnCountdown.%player%} is set:
- cancel event
- stop
Add Comment
Please, Sign In to add comment