Player/PickupObject

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (Forgot line break)
Line 1: Line 1:
 
{{Func
 
{{Func
|Description=This makes the player hold the provided entity.
+
|Description=This makes the player hold the provided entity.<br>
 
'''Note:''' Don't get this confused with picking up items like ammo or healthpacks.
 
'''Note:''' Don't get this confused with picking up items like ammo or healthpacks.
 
|Realm=Server
 
|Realm=Server

Revision as of 20:19, 20 July 2015

 Player:PickupObject( )

Contents

Description

This makes the player hold the provided entity.
Note: Don't get this confused with picking up items like ammo or healthpacks.

Arguments

Entity Entity

Entity to pick up.

Examples

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


Personal tools
Navigation