As you all know, if you can Spawn NPC’s as you need them, it saves the processing of them until
required, and might give you a few extra frames per second in speed.
This little piece of code allows you to set a ‘TRIGGER ZONE’ that Spawns as many NPC’s as you
want at the one time, as the Player steps onto the Trigger Zone.
-------------------------------------------------------------------------------------------------------------------------------------------
-- LUA Script - precede every function and global member with lowercase name of script + '_main'
-- Player Enters Win Zone
function spawn_npcs_1_init(e)
end
function spawn_npcs_1_main(e)
if g_Entity[e]['plrinzone']==1 then
PlaySound(e,0)
Spawn(136) -- ID Number of NPC - Found by placing mouse pointer
over NPC, and reading first Number in Bottom Editor Bar.
Spawn(58) -- Next NPC ID Number
Spawn(123) -- Next NPC ID Number
Spawn(119) -- Next NPC ID Number
Spawn(13) -- Next NPC ID Number
Spawn(94) -- Next NPC ID Number
Spawn(124) -- Next NPC ID Number
Spawn(66) -- Next NPC ID Number
Spawn(11) -- Next NPC ID Number
Spawn(148) -- Next NPC ID Number
Spawn(98) -- Next NPC ID Number
Destroy(e)
end
end
PLACE IN 'MAIN' IN TRIGGER ZONE