help me making a serverside script with rounds and teams:terrorist and counter terrorist.

hello i want to have a script that makes rounds with time limit of 3 mins,team and the players of team “terrorist” spawn at func_player_start_terrorist and counter terrorists spawn at func_player_start_counter_terrorist (im using the css maps and there are terrorist start funcs and stuff and they only seem to work when you specify them in a script and normally gmod chooses random func_player_start) and because i suck at lua (cant even make a working derma!) o want to have help of you guys. so plz help me . (im going to test the round and team script with bots, as serverside because i understand that only serverside scripts can force team to spawn at specified func_player_starts) sry but i forgot to say that if its possible in lua: could a team script contain a hook that checks if everybody of terrorist of counter terrorist team is dead?

so help plz.

(here is the script code for rounds system with spectate but i want it mixed with team script):
local round = {}

– Variables
round.Break = 5 – 30 second breaks
round.Time = 300 – 5 minute rounds

function round.Broadcast(Text)
for k, v in pairs(player.GetAll()) do
v:ChatPrint(Text)
end
end

function round.Begin()
for k,v in pairs(player.GetAll()) do
v:Spawn()
end

round.Broadcast(“The battle begins, The battle ends in " … round.Time … " seconds!”)
timer.Simple(round.Time, round.End)
end

function round.End()
for k,v in pairs(player.GetAll()) do
ply:KillSilent()
GM:ClearClientState()
GM:CleanUpMap()
ply:Spectate( OBS_MODE_NONE )
end

round.Broadcast(“The battle is over, Next battle in " … round.Break … " seconds!”)
timer.Simple(round.Break, round.Begin)
end

round.Begin()

function GM:DoPlayerDeath(ply)
ply:Spectate( OBS_MODE_CHASE )
ply:SpectateEntity( ent )
end