ok so why won't this work?
PHP Code:
function onCreated() {
this.attr[1] = eswitch; //switch name
this.attr[2] = edoor; //door name
this.attr[3] = 3; //hide time
this.image = "block.png";
}
function onExplode() {
if (!this.exploded) {
this.image = "door.png";
this.exploded = true;
setTimer(3);
triggerclient(this.name, "boom");
}
}
function onTimeout() {
this.exploded = false;
this.image = "block.png";
}
//#CLIENTSIDE
function onCreated(){
m = this.attr[1];
n = this.attr[2];
o = this.attr[3];
this.level.n = this;
}
function onActionClientSide(cmd) {
if (cmd == "boom") {
this.chat = "ClientSide works";
this.level.n.wasExploded();
}
}
public function wasExploded(){
this.hide();
sleep(o);
this.show();
}
onExplode is when the bomb explodes and it has a distance that it hits.
I just can't get the clientside to function correctly. This is a switch that when it explodes it sends the wasExploded() to do something in another npc in the same level. Maybe public function needs to be server side, but a different puublic function works fine in clientside with a touch switch?