Entity doesn't initialize on some map.

Hi!
I have a hat entity witch is not works properly. On some map it initialize clientside and i can see it and on some map it doesn’t. What should i do?

The cl_init.lua:

[lua]
function ENT:Initialize()
LocalPlayer():ChatPrint(“Initialized clientside…”)
self:SetRenderBoundsWS( Vector( -20000, -20000, -20000 ), Vector( 20000, 20000, 20000 ) )
end

function ENT:Think()

if ( self:GetOwner() == LocalPlayer() and GetViewEntity() == LocalPlayer() ) then
		self:SetColor( 255, 255, 255, 255 )
	else
		self:SetColor( 255, 255, 255, 255 )

end

if self:GetOwner():Alive() == false then
	
	self:SetColor(255,255,255,0)
	
end

end

function ENT:Draw()
local hat = shop.hats[ self:GetOwner():GetNWString( “SHOP_HAT” ) ]
local index = self:GetOwner():LookupBone( “ValveBiped.Bip01_Head1” )
local pos, ang = self:GetOwner():GetBonePosition( index )

local ang2 = Angle( ang.p, ang.y, ang.r )
ang2:RotateAroundAxis( ang:Right(), hat.angle.p )
ang2:RotateAroundAxis( ang:Up(), hat.angle.y )
ang2:RotateAroundAxis( ang:Forward(), hat.angle.r )
self:SetAngles( ang2 )

self:SetPos( pos + ang:Up() * hat.position.x + ang:Right() * hat.position.y + ang:Forward() * hat.position.z )

self:SetModelScale( hat.scale )

self:DrawModel()

end
[/lua]

Can you show us the code that calls the entity…

[lua]SHOP_HAT_ENTITY = ents.Create( “shop_hat” )
SHOP_HAT_ENTITY:SetModel( shop.hats[shop.hat].model )
SHOP_HAT_ENTITY:SetOwner( self )
SHOP_HAT_ENTITY:Spawn()
SHOP_HAT_ENTITY:Activate()
[/lua]

In the serverconsole i can see it initailize the entity because i put there a print function. But on clientside it doesnt.