Attaching a prop to bones? (SetParentAttachmentMaintainOffest Help)

*Posted this in the What do you need help with thread, but havn’t gotten any replies.

So… Currently I’ve been working on modifying a Riot Shield, and I’ve been having a ton of problems with using SetParentAttachmentMaintainOffest… It works fine, as long as I’m facing one direction… I was trying to research it, and I believe it was something to do with the world position/angle’s relativity to the local position/angle.

Here is the snippet from my code:

function SWEP:Deploy()
    if SERVER then
        if ValidEntity(self.ent) then return end //Makes it not able to spawn multiple entities.
        self.ent = ents.Create("prop_physics")
            par = self.ent:GetParent()
            hand = par:LookupBone("ValveBiped.Anim_Attachment_RH")
            local pos, ang = par:GetBonePosition( hand )
**            self.ent:SetPos(pos + Vector (-12,-10,-22))
            self.ent:SetAngles(ang + Angle(0,-180,0))
            self.ent:Fire("SetParentAttachmentMaintainOffest", "anim_attachment_RH", 0.01)**
            self.ent:SetCollisionGroup( COLLISION_GROUP_WORLD ) // Lets it not collide to anything but world. Taken from Nocollide 
    return true

Here are the screenshot’s of what happens:

This is when it is selected while facing the correction direction, and how I want it to look.

This is what happens otherwise…

I would prefer using SetParentAttachment but then I cant change the position/angle and it isn’t attached in the correct position.

Anyone know what I can do to fix it? Im quite new to lua scripting by the way…

Thank you.