@velor
I added a defender cap
would it work?
local numraiders = 0
game.Players.PlayerAdded:connect(function(plr)
if not plr:IsInGroup(2896442) and numraiders ~= 15 then
plr.TeamColor = game.Teams.Raiders.TeamColor
numraiders = numraiders + 1
print('A raider has joined!')
elseif not plr:IsInGroup(2896442) and numraiders == 15 then
plr:Kick("Raider cap has been reached. Try again later!")
end
end)
game.Players.PlayerRemoving:connect(function(plr)
if plr.TeamColor == game.Teams.Raiders.TeamColor then
numraiders = numraiders - 1
print('A raider has left!')
end
end)
local numdefenders = 0
game.Players.PlayerAdded:connect(function(plr)
if plr:IsInGroup(2896442) and numdefenders ~= 15 then
plr.TeamColor = game.Teams.Aixon.TeamColor
numdefenders = numdefenders + 1
print('A defender has joined.')
elseif plr:IsInGroup(2896442) and numraiders == 15 then
plr:Kick("Defender cap reached. Try again later.")
end
end)
game.Players.PlayerRemoving:connect(function(plr)
if plr.TeamColor == game.Teams.Aixon.TeamColor then
numdefenders = numdefenders - 1
print('A defender has left.')
end
end)
|