Player.SetAvoidPlayers

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:SetAvoidPlayers( Boolean AvoidPlayers )
Description:
If the player is Nocollided with another, he/she is pushed away when they move into the other player.
Returns: nil
In Object: Player
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.SetAvoidPlayers]Player.SetAvoidPlayers [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Example

DescriptionThis will make the players Nocollide with teammates and get pushed away when they stop inside their teammate.
Used onNewerServer.png
Code
function PushTeammatesAway( )
	for _, ply in pairs( player.GetAll() ) do
		ply:SetNoCollideWithTeammates( true )
		ply:SetAvoidPlayers( true )
	end
end
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox