Okay, so, I'm making a minigame for my server and I need help finding the last player standing in the arena. I already have it where they will teleport to the spawn when they die, I just need it to find if there is only one player in the arena world, it can execute some things. Thank you!
Code:
Code:
code_language.skript:
set {game.active} to true
loop all players:
teleport loop-player to spawn of "./maps/%arg-2%/default"
set {%loop-player%.ingame} to true
send "&6&l&m=============================================" to loop-player
send "&6Game - &7Fighter Mania" to loop-player
send "&6Map - &7Default Map" to loop-player
send "&6 " to loop-player
send "&6Game Information" to loop-player
send "&eFree for all!"
send "&eFight your enemies to their death."
send "&eLast player standing wins!"
send "&c&lWARNING: &cThe arcade is in beta! Expect some bugs." to loop-player
send "&6&l&m=============================================" to loop-player
give loop-player 1 iron helmet named "&6&lHelmet &8(Equip)"
give loop-player 1 iron chestplate named "&6&lChestplate &8(Equip)"
give loop-player 1 iron leggings named "&6&lLeggings &8(Equip)"
give loop-player 1 iron boots named "&6&lBoots &8(Equip)"
give loop-player 1 stone sword named "&6&lSword"
wait 2 seconds
send "&6Game> &7A 10 second grace period has started!" to loop-player
wait 10 seconds
send "&6Game> &7The grace period has ended. Start fighting!"
set {pvp.enabled} to true
#Find last player standing...
#Whenever I add a last player standing thing, game will end (code below)
wait 2 seconds
set {pvp.enabled} to false
set {%loop-player%.ingame} to false
send "&6&l&m=============================================" to loop-player
send "&6&lGame Ended!" to loop-player
send "&aReturning to the waiting area..." to loop-player
send "&6&l&m=============================================" to loop-player
teleport loop-player to spawn of "./arcadelobby"