local factions = {'TF141','NavySeals','Rangers','Spetsnaz','NVA','DeltaForce'}
local ss = game:WaitForChild('ServerStorage')
game.Players.PlayerAdded:connect(function(p)
	local name = p.Name
    local plr = game.Players:WaitForChild(name)
    local starterg = plr:WaitForChild('PlayerGui')
    local strng = starterg:WaitForChild'Team'
    local random = math.random()
    strng.Name = factions[math.random(1,6)]
    local v = strng.Name
    if v then
	  local m = ss:FindFirstChild(v)
	  m:Clone().Parent = starterg
	  local soundsModule = ss:WaitForChild'Model'
	   local mu = soundsModule:FindFirstChild(v)
	   mu:Clone().Parent = starterg
	  mu:Play()
	
    end

    print(strng.Name)
    print(plr.Name)
end)


Basically, what i want to do is get the number of players and try to make it show up on 2 peoples screens. Basically, 2 people get 1 faction.

Example: 2 people - rangers 2 people - navyseals 2 people - Spetsnaz

and so on and so forth.

basically 16 players in total.

But i also want it to adjust if it has an uneven amount of players. such as, 5. Somebody. Help.

1 comment

0

first off all random isn't even used, you dont need the variable, second only when the player joins then that will happen.. so two people join at the same time in order for it to work.. Well at least thats what i think is going to happen..