Player.SetTeam

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:SetTeam( Integer team index )
Description:
Sets the player's team.
Returns: nil
In Object: Player
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.SetTeam]Player.SetTeam [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionThe player can change to team 3 by typing team_3 in the console.
Used onNewerServer.png
Code
function JoinTeam3(ply)
	ply:SetTeam(3)
end
 
concommand.Add("team_3", JoinTeam3) 
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox