As in the question i have this model that is incorrectly orientated to the enemy, It rotates at the wrong direction and shoots bullets at the opposite direction, i tried searching many methods how to fix this but they all did nothing, So i wanna ask here how do i fix this problem.
You can use trigonometry for this, use the X and Z axis, and with the usage of an imaginary triangle you can calculate its angle.
It would probably look something like this:
local angle = math.Atan2(enemyPos.Z - playerPos.X ,enemyPos.X - playerPos.X) model.PrimaryPart.CFrame = CFrame.new(model.PrimaryPart.Position) * CFrame.Angles(0, angle, 0)
If this makes it reversed just try swapping the order of the variables inside of Atan2