That's pretty slick stuff. Nice to see something new for a change and congrats on user of the month
Definitely check out smallg's implementation of enemy firing upon enemy mechanics. I'd probably just try to use
IntersectAll: x=IntersectAll(x1,y1,z1,x2,y2,z2,IgnoreObj) -- returns 1 if the ray cast hits entity or lightmapped geometry
GetIntersectCollisionX: x=GetIntersectCollisionX() -- returns the X position of the entity hit position
GetIntersectCollisionY: y=GetIntersectCollisionY() -- returns the Y position of the entity hit position
GetIntersectCollisionZ: z=GetIntersectCollisionZ() -- returns the Z position of the entity hit position
As my guides for casting a ray out, then using that to determine if a hit was done and applying damage by setting a flag in a table, passing it to the enemy, having the enemy parse it and 'receive' damage. But smallg's implementation is a known quantity so that's definitely a plus