Attach Entitys

How can I attach entity with good rotation:
I want the attached entity rotation don’t change but the coords change according to entity2
AttachEntityToEntity(entity, entity2, …)
How can I do this?