I found a few posts that could help:
Edit: this is how you convert coordinates from layer 1 to layer 0 (when sprite located on layer1):
CanvasToLayerX("Layer 0",LayerToCanvasX("Layer 1", sprite.X, sprite.Y) ,LayerToCanvasY("Layer 1", sprite.X, sprite.Y))
CanvasToLayerY("Layer 0",LayerToCanvasX("Layer 1", sprite.X, sprite.Y) ,LayerToCanvasY("Layer 1", sprite.X, sprite.Y))
For example, to fire a bullet from gun on layer 2 at player on layer 1:
Create object Bullet on layer 1,
set X to CanvasToLayerX(1, LayerToCanvasX(2, Gun.X, Gun.Y), LayerToCanvasY(2, Gun.X, Gun.Y))
set Y to CanvasToLayerY(1, LayerToCanvasX(2, Gun.X, Gun.Y), LayerToCanvasY(2, Gun.X, Gun.Y))
Set Bullet angle of motion to angle(bullet.X, bullet.Y, Player.X, Player.Y)