"How is it fair that defenders can get more in to unbalance the ratio, but raiders can't unbalance it?"
Moron.
(expect errors, written inside forum)
local group = 2872551
local ratio = 2
local checkRatio = function()
local defenders = 0
local raiders = 0
for i,v in next, game.Players:GetPlayers() do
if v.TeamColor == settings.defenderTeam then
defenders = defenders + 1
elseif v.TeamColor == settings.raidTeam then
raiders = raiders + 1
end
end
return defenders,raiders
end
game.Players.PlayerAdded:connect(function(player)
if player:IsInGroup(group) then
local defenders,raiders = checkRatio()
if defenders >= raiders * ratio then
player:kick('Too many defenders')
end
else
local defenders,raiders = checkRatio()
if raiders >= defenders * ratio then
player:kick('Too many raiders')
end
end
end)
Doesn't let either side have more than 2x as much as the opposing team. This assumes no one leaves the raid except those kicked.
- Isosta |