1
2
3
4
5
6
7
8
function spawn_(id)
	if (player( id, 'team' ) == 1 and player( id, 'team' ) == 2) then
		parse('sethealth ' .. id .. ' 250')
		parse('setarmor ' .. id .. ' 250')
	end
end
addhook("spawn","spawn_")
1
2
3
4
5
6
7
8
9
function spawnWP(id)
	for _, id in ipairs( player(0, 'table') ) do
		local player1 = math.random(1, 'team1')
		local player2 = math.random(1, 'team2')
		return "" -- Weapon IDs here
	end
end
addhook("spawn","spawnWP")
Two local variables assigned to math.random function so on spawn it'll be given weapons to random players. Not sure though if it works so I beg pardon and would like if someone corrects any wrong syntax or structure of the second snippet of code (if there are any).