Spawning entities

Liu-Kang

Member
Quick question, is there any way to have an entity spawn on ONLY 1 player? So if there's 2, 3, or 4 players on stage then that certain entity won't spawn? I want Npc backup, but only for single player.
 
It's doable with script
I assume you want to have this script in level

Here's how to do it:
spawn HelperNPC
@script
void main()
{
    void self = getlocalvar("self"); //Get calling entity
    if(openborvariant("count_players")>1){
      killentity(self);
    }
}
@end_script
coords -80 200 1
at 200

This script will remove HelperNPC if by time you reached scroll position 200, there are more than one player.
This script is only run ONCE so if say you are playing alone when you reached scrollpos 200 allowing Helper NPC to be spawned, then another player joins after that, HelperNPC won't be removed.

HTH
 
Back
Top Bottom