Entity.GetNetworkedBool

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:GetNetworkedBool( Var index [, Boolean default] )
Description:
Returns a networked Boolean in this entity set with Entity.SetNetworkedBool with the given index.
Returns: Boolean
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.GetNetworkedBool]Entity.GetNetworkedBool [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionIf any entity has bool "Unused" set, remove the entity.
Used onNewerServer.png
Code
function RemoveUnused()
    for _, v in pairs ( ents.GetAll() ) do
        if ( v:GetNetworkedBool( "Unused" ) ) 
            v:Remove()
        end
    end
end
hook.Add( "Think", "RemoveUnusedHook", RemoveUnused )
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox