Try something like this
PHP Code:
function onCreated()
{
setshape( 1, 32, 32 );
}
function onActionNear( acc )
{
chat = acc SPC "is near me!";
}
//#CLIENTSIDE
function onCreated()
{
setTimer( .1 );
}
function onTimeOut()
{
if ( player.x in | this.x - 1, this.x + 2 | && player.y in | this.y - 2, this.y + 1 | )
{
triggeraction( this.x + .5, this.y + .5, "Near", player.account );
}
setTimer( .1 );
}