NPC.GetBlockingEntity

From GMod Wiki

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