Basic Team select, (maybe even classes?)

I’m completely new to lua coding just doing it for a few days, i got a hud working and a spawning codes that spawns you with weapons.

But for my first gamemode i want to make a Team Deathmatch gamemode. (don’t ask why) Does some one have a lua script where when people join can choose to join 2 different teams? Both with different guns and models.

PS: If that’s very easy and someone has a script where in each team you can also choose between different classes it would be great!

Thanks, Syl3rr

[lua]if ply:Team() == 1 then
–weapons and shit
elseif ply:Team() == 2 then
–weapons and shit
end[/lua]

make a dframe with buttons

[lua]button.DoClick() = function( ply )
ply:SetTeam(#)
end[/lua]

ply:SetTeam() is server side.

The easiest way to do it is to make a function with a command

Example:
[lua]
function SetTeam1(pl)
pl:SetTeam(1)
end
concommand.Add(“team1”, SetTeam1)
[/lua]
or the other way
[lua]
function SetTeam(pl, cmd, args)
if args[1] == nil then return end
pl:SetTeam(args[1])
end
concommand.Add(“setteam”, SetTeam)
//I had to code this in web browser cause I’m in school but this should work :o
[/lua]

usage: setteam 1
in console.

Okay i’ve got the teams now does anyone have the code to make different classes in eachs team with different weapons?

You’ll have to write your own class system for that I believe. Which should be fairly simple, it’s the same with team except it doesn’t have stuff pre-build around (who can damage who, the UI, etc.)

So, could someone show me how to make a Fretta Class Select?

I’m sure someone in the request section is willing to help you with that.