for Era?
[The Class]
HTML Code:
function onCreated() {
this.setShape(1, 32, 32);
}
function onActionDetect() {
//Public function for doing damage
}
//#CLIENTSIDE
function onPlayerEnters() {
this.x = random(this.x - 10, this.x + 10); //Make it random...
setTimer(0.05);
}
function onTimeout() {
if (player.x in |this.x, this.x + 32| && player.y in |this.y, this.y + 32|) {
if (this.wait =< 0) {
triggeraction(this.x, this.y, "Detect", "");
this.wait = 4;
}
}
if (this.wait > 0) this.wait -= 0.05;
setTimer(0.05);
}