I'm pretty desperate for help on this. I'm in over my head.
I'm trying to sync the blocks with everyone in the level. My first guess was to use triggerServer or triggerAction but I can get neither of those to work inside of a class (I've since read that triggerServer doesn't work in local or class NPCs without a hacked workaround).
I thought something like this would work, but no dice on this as well. I just can't grasp what I'm doing wrong.
PHP Code:
function onActionFoo () {
// also tried onActionServerSide() when using 0,0 as triggerAction coordinates.
echo("bar");
}
//#CLIENTSIDE
function onCreated() {
setshape(1,32,32);
}
function onPlayerChats() {
if (player.chat == "foo") {
echo("foo");
triggerAction(x,y, "Foo", NULL);
}
}
I'm circling back around to having to use a timeout in the blocks, but I feel like that is a hack option and could cause lag if I had a level with dozens of blocks inside all with a nested loop.