Garry's Mod Wiki

GM:AllowPlayerPickup

Description

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

See GM:GravGunPickupAllowed for the Gravity Gun pickup variant.

Arguments

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

Returns

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

Example

Allows only admins to pick up things

local function up( ply, ent ) return ply:IsAdmin() end hook.Add( "AllowPlayerPickup", "some_unique_name", up )

Page Links


Special Pages


Wikis

?

Render Time: 39ms

DB GetPage 4
Generate Html 11
SaveChanges 10
Render Body 0
Render Sidebar 12