Entity.GetSpawnFlags

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:GetSpawnFlags( )
Description:
Returns the total spawn flags, set in Hammer, or a 'SpawnFlags = ' statement in the spawn list.
Returns: number
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.GetSpawnFlags]Entity.GetSpawnFlags [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionReturns true if an entity has a specific spawnflag, here the npc_citizen's Medic spawnflag, otherwise false.
Used onNewerShared.png
Code
function IsMedic( ent )
 
    if !ent:IsValid() then return false end
 
    local sClass = ent:GetClass()
    if sClass != "npc_citizen" then return false end
 
    return  ( ent:GetSpawnFlags() & 131072 ) 
end
OutputN/A


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox