So I took what you said, but modified it a bit
PHP Code:
//#CLIENTSIDE
function onCreated() {
setImg("block.png");
onTimeout();
scheduleEvent("onDestroy", 1);
}
function onTimeout() {
if (player.x in |this.x, this.x + 2| && player.y in |this.y, this.y + 2|) {
triggerServer("weapon", "HealthSystem", "hitByBlock");
}
setTimer(.05);
}
function onDestroy(){
destroy()
}
Then in the weapon- "HealthSystem"
PHP Code:
function onActionServerSide(){
if (params[0] == "hitByBlock"){
[PHP]player.clientr.hp -= //whatever amount
}
}
[/PHP]
I haven't had a chance to test this but I don't see why it wouldn't work
SO my next question is...
How would I check local NPCs (Baddies) to trigger their "Hurt" function with that block too?
I want my "damage block" to not only effect players but NPCs also.