Garry's Mod Wiki

Player:SetArmor

  Player:SetArmor( number Amount )

Description

Sets the player armor to the argument.

Arguments

1 number Amount
The amount that the player armor is going to be set to.

Example

Sets the player armor to 100 when they types "SetArmor" at the console.

concommand.Add( "SetArmor", function( ply ) ply:SetArmor( 100 ) end )
Output: Sets the player armor to 100

Example

Gives the player armor to first vararg when they types "AddArmor" at the console.

concommand.Add( "AddArmor", function( ply, cmd, args ) local Armor = args[1] or 100 ply:SetArmor( ply:Armor() + Armor ) end )
Output: Adds the player armor to first vararg