Author Topic: brick.addevent(blah) only working when brick owner is in the server?  (Read 573 times)

Code: [Select]
%c = mainBrickGroup.getCount();
for(%i=0;%i<%c;%i++)
{
%brickGroup = mainBrickGroup.getObject(%i);
%c2 = %brickgroup.getCount();
for(%j=0;%j<%c2;%j++)
{
%brick = %brickGroup.getObject(%j);
%name = trim(strReplace(%brick.getname(),"_"," "));
if(%brick.getColorId() == 0)
{
%brick.clearEvents();
%brick.addEvent(1, 0, "OnPlayerTouch", "Player", "Kill");
}
}
}
Why does this only add the kill event to red bricks when their owner is in the server?
How do I fix it?
« Last Edit: November 06, 2012, 09:47:59 AM by Blocki »


You could make a new AiClient and hack that in as the brick's owner temporarily.

You could make a new AiClient and hack that in as the brick's owner temporarily.
ooo, why didn't I think of this.

I would recommend creating a single AClient and then just reuse it whenever you need to.