Code:
command /event [<text>] [<text>]:
trigger:
if arg 1 isn't set:
send "&7/event help"
if arg 1 is "help":
player has permission "event.admin":
send "&8&m---------- &cHELP &8&m----------"
send "&7/event join"
send "&7/event leave"
send "&7soon more"
else:
send "&8&m---------- &cHELP &8&m----------"
send "&7/event join"
send "&7/event leave"
if arg 1 is "join":
if arg 2 isn't set:
send "&cWrong syntax!"
else:
if {ingame.%player%} is true:
send "&cYou already in game!"
else:
clear player's inventory
teleport player to {spawn.%arg 2%}
set {ingame.%player%} to true
set {arena.%player%} to arg 2
send "&7You joined the game!"
wait 1 tick
give player stick of knockback 1 named "&fThis is just a normal stick!"
if arg 1 is "leave":
if arg 2 isn't set:
send "&cWrong syntax!"
else:
if {ingame.%player%} is true:
send "&7You left the game!"
clear player's inventory
delete {arena.%player%}
teleport player to {lobby.%arg 2%}
set {ingame.%player%} to false
How do I create a player limit on an area. Max of 2 players. If someone joins max of 1 player and if someone leaves then max 2 players again?