Pointshop Hats Glitching

So I’ve been searching for this answer for a long time, most the reason I haven’t found it is because for some reason I can’t use the ‘Search’ function anymore with facepunch. Anyways, my problem is:

The hats in pointshop are parented to the player’s head, right? Well, the hat tries going from the current angle of the player’s head to the angles he spawned at. How do I fix this?

Your having the same problem i am. Doesn’t it like spaz out on the persons head?

Yep. Last night I couldn’t provide the Lua snippet so here we go… This is the most obvious things I could find that are related to the hats, placement, etc.

[lua]
–sh_items.lua
–random hat thats glitchy
ModifyHat = function(ent, pos, ang)
ent:SetModelScale(Vector(1.6, 1.6, 1.6))
pos = pos + (ang:Forward() * -2.5)
ang:RotateAroundAxis(ang:Right(), -15)
return ent, {Pos = pos, Ang = ang}
end,

–cl_init.lua
function ENT:Draw()
if not self.ItemData then
if POINTSHOP.FindItemByID(self:GetNWString(“item_id”)) then
self.ItemData = POINTSHOP.FindItemByID(self:GetNWString(“item_id”))
return
end
end

local owner = self:GetOwner()

if owner == LocalPlayer() and GetViewEntity():GetClass() == "player" then return end

if owner and owner:IsValid() and owner:Alive() then
	local attach = owner:GetAttachment(owner:LookupAttachment("eyes"))
	if not attach then attach = owner:GetAttachment(owner:LookupAttachment("head")) end
	
	if attach then
		if self.ItemData then
			if self.ItemData.Functions and self.ItemData.Functions.ModifyHat then
				self, attach = self.ItemData.Functions.ModifyHat(self, attach.Pos, attach.Ang)
			end
			
			self:SetPos(attach.Pos)
			self:SetAngles(attach.Ang)
			
			self:DrawModel()
		end
	end
end

end
[/lua]

bump