Garry's Mod Wiki

ENTITY:GravGunPunt

  boolean ENTITY:GravGunPunt( Player ply )

Description

Called when this entity is about to be punted with the gravity gun (primary fire).

Only works in Sandbox derived gamemodes and only if GM:GravGunPunt is not overridden.

Arguments

1 Player ply
The player pressing left-click with the gravity gun at an entity

Returns

1 boolean
Return true or false to enable or disable punting respectively.

Example

Enables a scripted entity to be punted even when frozen.

function ENT:GravGunPunt( ply ) self:GetPhysicsObject():EnableMotion( true ) return true end