Garry's Mod Wiki

Garry's Mod Wiki

  Player:PickupObject( Entity entity )

Description

This makes the player hold (same as pressing e on a small prop) given entity.

Not to be confused with picking up items like ammo or health kits.

This picks up the passed entity regardless of its mass or distance from the player.

Arguments

1 Entity entity
Entity to pick up.

Example

An extra function to make sure the object isn't held before being picked up.

function PlayerPickupObject( ply, obj ) if ( obj:IsPlayerHolding() ) then return end ply:PickupObject( obj ) end

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...