Entity/IsWorld

From Garry's Mod
Jump to: navigation, search
 Entity:IsWorld( )

Contents

Description

Returns if the entity is the map's Entity[0] worldspawn

Returns

boolean

isWorld

Examples

Example

Stool boilerplate for the ignite tool

function TOOL:LeftClick( trace )
 local ent = trace.Entity
 if !ent or !ent:IsValid() or ent:IsPlayer() or ent:IsWorld() then return false end
 ...

Output:

LeftClick will not run for no ent, invalid ents, players, or worldspawn.
Personal tools
Navigation