Hello. I am making an event, and I need to trigger more than one NPC in the level to change color. Basically, say NPCa is the 'control npc' of the level. Say I want to trigger a lot of other NPCs in the level, but I don't want to make things hard and exceed myself. If I just duplicate the NPCs, only one will work by the way.
NPC A (control npc):
PHP Code:
function onPlayerChats() {
level.npcb.onFoo(player.chat); //send to more than one npc, identical to npcb
}
NPC B:
PHP Code:
//let's pretend this code works. I may have messed up, doing this quickly
function onCreated() {
level.npcb = this;
}
public function onFoo(temp.baz) {
this.chat = temp.baz;
}
Say I wanted the code to be sent to more than one NPC? I don't want to change the code to each NPC individual though when I duplicate the first, because that would be hard