Garry's Mod Wiki


  boolean GM:AllowPlayerPickup( Player ply, Entity ent )


Called when a player tries to pick up something using the "use" key, return to override.

This hook will not be called if sv_playerpickupallowed is set to 0.

See GM:GravGunPickupAllowed for the Gravity Gun pickup variant.
See GM:PhysgunPickup for the Physics Gun pickup variant.


1 Player ply
The player trying to pick up something.
2 Entity ent
The Entity the player attempted to pick up.


1 boolean
Allow the player to pick up the entity or not.


Allows only admins to pick up things.

hook.Add( "AllowPlayerPickup", "AllowAdminsPickUp", function( ply, ent ) return ply:IsAdmin() end )