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?

[lua]

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

That should work if you include some kind of choose menu.
[editline]15:50[/editline]
I could make a simple tutorial for you if you want.
[editline]15:50[/editline]
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…

[lua]
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 )
frame:MakePopup()

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” )
end

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” )
end

end
concommand.Add( “team_menu”, set_team )
[/lua]

Something like that? but where would i rename the teams

[editline]08:54AM[/editline]

I would appreciate that a lot :smiley:

[editline]08:54AM[/editline]

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