Teams in gamemodes

First of all, i would like to apologize if this would be the wrong section, I just didn’t see an appropriate section to place this in the game modes section.

Now, what i need to do is set it up so that when a player joins my server, he chooses to be red team or blue team, simple as that.

thanks for the help guys.

[Editline]8:37 AM[/Editline]

Oh by the way, would this work?


team.SetUp( 1, “TeamRED”, Color( 255, 55, 0, 155, 1 ) ) – for team red
team.SetUp( 1, “TeamBLUE”, Color( 0, 0, 255 ) ) – for team blue

That should work if you include some kind of choose menu.
I could make a simple tutorial for you if you want.
I´ll make it anyway.

This hasn´t been tested yet and may not work, and you will have to edit it to your needs.

So like a menu…

function set_team()

local frame = vgui.Create( “DFrame” )
frame:SetPos( ScrW() / 2, ScrH() / 2 ) --Set the window in the middle of the players screen/game window
frame:SetSize( 200, 210 ) --Set the size
frame:SetTitle( “Change Team” ) --Set title
frame:SetVisible( true )
frame:SetDraggable( false )
frame:ShowCloseButton( true )

team_1 = vgui.Create( “DButton”, frame )
team_1:SetPos( frame:GetTall() / 2, 5 ) --Place it half way on the tall and 5 units in horizontal
team_1:SetSize( 50, 100 )
team_1:SetText( “Team 1” )
team_1.DoClick = function() --Make the player join team 1
RunConsoleCommand( “team_1” )

team_2 = vgui.Create( “DButton”, frame )
team_2:SetPos( frame:GetTall() / 2, 105 ) --Place it next to our previous one
team_2:SetSize( 50, 100 )
team_2:SetText( “Team 2” )
team_2.DoClick = function() --Make the player join team 2
RunConsoleCommand( “team_2” )

concommand.Add( “team_menu”, set_team )

Something like that? but where would i rename the teams


I would appreciate that a lot :smiley:


That was like a oober bumpity bump XD

Done with the tutorial
[editline]16:17 CET[/editline]
By the way, add me on steam: “nissehutt”

I added you, im c-unit