not working,
this code :
test = createWeapon ( 'ak-47' , Vector3 ( getElementPosition ( localPlayer ) ) )
exports [ 'bone_attach' ]:attachElementToBone ( test , localPlayer , 12 , 0 , 0 , 0 , 0 , -90 )
addEventHandler ( 'onClientPlayerWeaponFire' , root ,
function ( weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement , x , y , z )
setPedAimTarget ( localPlayer , hitX, hitY, hitZ , x , y , z )
fireWeapon ( test )
end
)