PLEASE don't use hitobjects -- remnant from GS1 for compatibility.
I would do something like this:
PHP Code:
function boomDaLaser()
{
for ( temp.a : players )
{
if ( temp.a.x in | player.x, player.x + vecx( player.dir ) * 10 | && temp.a.y in | player.y, player.y + vecy( player.dir ) * 10 | )
{
temp.BOOMLOL.add( temp.a.account );
}
triggerserver( "gui", name, "PIMPINLOL", temp.BOOMLOL );
}
}
Obviously that isn't perfected, but it would be easy to adjust the x & y's so it works well.
EDIT:
As an alternative to triggering the server, you could just send a triggeraction at their location. Would probably be better idea, you'd have to tinker with it. For npcs, do the same thing and just do like temp.BOOMSHAKALAKA[0].trigger( "PWNED", player.account ); or something.