Garry's Mod Wiki

Garry's Mod Wiki

  boolean GM:PhysgunPickup( Player player, Entity entity )
This hook is predicted. This means that in singleplayer, it will not be called in the Client realm.

Description

Called to determine if a player should be able to pick up an entity with the Physics Gun.

See GM:OnPhysgunPickup for a hook which is called when a player has successfully picked up an entity.

See GM:GravGunPickupAllowed for the Gravity Gun pickup variant.
See GM:AllowPlayerPickup for the +USE pickup variant.

Arguments

1 Player player
The player that is picking up using the Physics Gun.
2 Entity entity
The entity that is being picked up.

Returns

1 boolean
Returns whether the player can pick up the entity or not.

Example

Allows Admins to pick up players.

hook.Add( "PhysgunPickup", "AllowPlayerPickup", function( ply, ent ) if ( ply:IsAdmin() and ent:IsPlayer() ) then return true end 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 twice a day. Edits and history are not available.

Last Parsed: Loading...