Quote:
Originally Posted by i8bit
I just fixed my thread post...
The "dmged" was a typo.. I rewrite some stuff to make it easier to read on forums.. I just forgot to change that.
With that being said, I want to do the chat within the "class" script. Not in the creation of the NPC.
So I would need a
PHP Code:
this.chat = params[1];
But it doesn't recognize params[1]... THAT'S my issue
|
well then theres a lot of ways you can do it, a few examples:
PHP Code:
/*
weapon
*/
temp.npc = this.level.putNPC2(player.x, player.y+1, "");
temp.npc.join("combat_dmgdisplay");
temp.npc.chatParam = params[1];
PHP Code:
/*
npc
*/
function onCreated() {
this.chat = this.chatParam;
}
PHP Code:
/*
weapon
*/
temp.npc = this.level.putNPC2(player.x, player.y+1, "");
temp.npc.join("combat_dmgdisplay");
temp.npc.trigger("SetChat", params[1]);
PHP Code:
/*
npc
*/
function onSetChat(temp.chat) {
this.chat = temp.chat;
}
but you wont be able to access the original params[1] outside of the onActionServerSide() event they were passed to