Help with entity - physgun beam bug

Hello there, Im having a little problem with my entity ( My first :v: ).
You can find it in the toybox, called CinemaHelper…

So the problem, everything works fine when im spawning it. But when im gonna pick it up the physgun beam stays at the same place the entity was spawned at, but the physgun is fully functional. It’s just the beam effect thats bugged somehow :S

please help me if you can, here’s my code.

[lua] ENT.Type = “anim”
ENT.Base = “base_anim”
ENT.PrintName = “CinemaHelper”
ENT.Author = “Bummie”
ENT.RenderGroup = RENDERGROUP_TRANSLUCENT

function ENT:Initialize()

self.Entity:SetModel("models/props_interiors/pot01a.mdl")
self.Entity:SetMaterial( "models/debug/debugwhite" )
self.Entity:SetColor( 255, 106, 0, 255 )
self.Entity:SetGravity( 0.5 )
self.Entity:PhysicsInit( SOLID_VPHYSICS )
self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
self.Entity:SetSolid( SOLID_VPHYSICS )

self.Entity.HP = 100
self.Entity.RegenCount = 0

 local phys = self:GetPhysicsObject()

if phys:IsValid() then 

    phys:Wake()


end

end

function ENT:Use( activator, caller )

RunConsoleCommand( "CinemaHelper" )

end

function ENT:OnRemove( )
local effectdata = EffectData()
effectdata:SetOrigin( self.Entity:GetPos() )
effectdata:SetScale( 1 )
effectdata:SetMagnitude( 1 )
util.Effect( “GlassImpact”, effectdata, true, true )
end

function ENT:Explosion()

local explode = ents.Create( "env_explosion" )
explode:SetPos( self:GetPos() )
explode:SetOwner( self )
explode:Spawn()
explode:SetKeyValue( "iMagnitude", 100 )
explode:Fire( "Explode", 0, 0 )
self:Remove()

end

function ENT:OnTakeDamage( dmginfo )

self.Entity:TakePhysicsDamage( dmginfo )

if self.Entity.HP <= 0 then return; end

self.Entity.HP = self.Entity.HP - dmginfo:GetDamage();

if self.Entity.HP <= 0 then
    
    self:Explosion()
    
end

end

function ENT:SpawnFunction( ply, tr )

if ( !tr.Hit ) then return end

local SpawnPos = tr.HitPos + tr.HitNormal * 16

local ent = ents.Create( ClassName )
    ent:SetPos( SpawnPos )
ent:Spawn()
ent:Activate()

return ent

end

CinemaHelp-panel code [/lua]

If you find anything else weird or something like that please tell me, cause i want to learn.

Sorry for my poor english :S

Thanks :smile: