IfNPC

From PGE Wiki
Jump to navigation Jump to search

Prototype

IfNPC,NPC ID,CONDITION,0,CUSTOM EVENT,Active time,OPTION

Description

Scans the level continuously so long as active time hasn't run out. If the scan finds that an NPC of NPC ID meets the condition, it activates CUSTOM EVENT.

Notes

There are two CONDITIONS this command can check CONDITION = 1 = The given NPC exists CONDITION = 2 = The given NPC does not exist

So this command can only check and activate events based on if an NPC exists somewhere in your level or not.

This command supports the "once" OPTION, meaning if you enter "once" as the final parameter it will only activate once and then delete itself.


Examples

// Activate custom event 1000 when the player picks up the axe (axe no longer exists). Only activates once
IfNPC,178,2,0,1000,0,once


// Activate custom event 1001 so long as the axe is still there
IfNPC,178,1,0,1001,0,0