NPC Code:
function onCreated()
{
showcharacter();
this.target = findplayer(this.owner);
this.attr[2] = new[5][2];
setTimer(.3);
}
function onPlayerChats()
{
if (player.account == "raeiphon" && player.chat.starts("/destroy")) { this.destroy(); }
if (player.account == "raeiphon" && player.chat.starts("/show")) { this.chat = this.attr[2][0]; }
if (player.account == "raeiphon" && player.chat.starts("/halt")) { triggerclient(); }
}
function onTimeout()
{
if (this.attr[2].size() > 5) { this.attr[2] = this.attr[2].subarray(0,5); }
this.attr[2].insert(0, {this.target.x,this.target.y});
triggerclient(this.attr[2]);
setTimer(.05);
}
//#CLIENTSIDE
function onCreated()
{
//setTimer(.3);
}
function onTimeout()
{
this.x = this.attr[3][4][0];
this.y = this.attr[3][4][1];
setTimer(.3);
}
function onActionClientside(var)
{
this.attr[3] = var;
}
Originally this started out just setting this.attr[3] on the serverside, since I was told by Tig that it apparently carries across through clientside/serverside barriers and whatnot. That quickly turned out to be false, so I stuck a triggerclient in the timeout to simulate this being the case.
However, it doesn't work. Simply does not work. This.attr[3] is 0 always. Don't tell me that attrs can't hold arrays either, because they can - a echo on the variable on the serverside tells us this (see /show).
Any ideas?