The t has to be random selected.
So if there is already a terrorist than no one else can join at t.
math.randomseed(os.time()) addhook("startround", "select_t") addhook("team", "check_team") function select_t() 	local t = player(0, "team1") 	local ct = player(0, "team2") 	for _, v in pairs(t) do 		parse("makect "..v) 	end 	local random_id = ct[math.random(1, #ct)] 	 	parse("maket "..random_id) 	msg(player(random_id, "name").." was selected as the terrorist.@C") end function check_team(id, t) 	if ( t == 1 ) then	-- if the player attempts to join the terrorists 		if ( #player(0, "team1") > 1 ) then 			parse("makect "..id) 			msg2(id, "©255000000You cannot join the terrorists at this time.@C") 		end 	end end
math.randomseed(os.time()) addhook("startround", "select_t") addhook("team", "check_team") function select_t() local t = player(0, "team1") local ct = player(0, "team2") 	while (#t > 1) do 		parse("makect "..t[1]) 		table.remove(t, 1) 	end 	ct = player(0, "team2") local random_id = ct[math.random(1, #ct)] parse("maket "..random_id) 	parse("makect "..t[1]) msg(player(random_id, "name").." was selected as the terrorist.@C") end function check_team(id, t) if ( t == 1 ) then -- if the player attempts to join the terrorists if ( #player(0, "team1") > 1 ) then parse("makect "..id) msg2(id, "©255000000You cannot join the terrorists at this time.@C") end end end