The t has to be random selected.
So if there is already a terrorist than no one else can join at t.
Scripts
Simple script needed
Simple script needed
1

.
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
This message i get random
this happend when i am alone in the server.
If i add a bot the script creates a loop again and it keep saying terrorist win and if i add another bot it starts to say counter terrorists win in a loop.
1
