NPC.GetBlockingEntity

From GMod Wiki

Revision as of 19:14, 3 March 2010 by Faith2712 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax NPC:GetBlockingEntity( )
Description:
Returns the Entity blocking the NPC from reaching its destination or nil
Returns: Entity
In Object: Npc
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=NPC.GetBlockingEntity]NPC.GetBlockingEntity [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionThis checks for a player blocking the NPCc
Used onNewerServer.png
Code
if ValidEntity(npc:GetBlockingEntity()) && npc:GetBlockingEntity():IsPlayer() then
   print("A Player is blocking the NPC!")
end
OutputA Player is blocking the NPC!
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox