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

make a dframe with buttons

[lua]button.DoClick() = function( ply )

ply:SetTeam() is server side.

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

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

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.