You can convert the normal vectors to euler angles with the following function, you can use the phi for the so called Z rotation and the theta for one of the remaining (check it which one is better for you). It's a working function, I had a fun time with it shooting trash cans everywhere
function directionToEuler(dirX, dirY, dirZ)
local radius = (dirX*dirX + dirY*dirY + dirZ*dirZ) ^ 0.5
local theta = math.deg(math.acos(dirZ / radius))
local phi = math.deg(math.atan2(dirY, dirX)) % 360
return theta, phi
end