Garry's Mod Wiki

Garry's Mod Wiki

  boolean Entity:HasSpawnFlags( number spawnFlags )

Description

Returns whether this entity has the specified spawnflags bits set.

Arguments

1 number spawnFlags
The spawnflag bits to check, see SF enum.

Returns

1 boolean
Whether the entity has that spawnflag set or not.

Example

As seen in sandbox's PhysgunPickup hook.

function GM:PhysgunPickup( ply, ent ) -- Don't move physboxes if the mapper logic says no if ( ent:GetClass() == "func_physbox" && ent:HasSpawnFlags( SF_PHYSBOX_MOTIONDISABLED ) ) then return false end return true 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...