Weapon-like entity, Need help!

Can someone help me making weapon-like entity like Emplacement gun in HL2?
Because my code is just fubar. :tinfoil:

Are you asking for us to make something for you? Because no. Paste your code and hope we give you good tips.

No, i need to make it to weld with player, but it dont work( really works but not perfect )

function ENT:SpawnFunction( ply, tr, ClassName )

if ( !tr.Hit ) then return end
local SpawnPos = tr.HitPos + tr.HitNormal * 15

local ent = ents.Create( ClassName )
	ent:SetPos( SpawnPos )
	ent:SetParent( ply )
	ent:SetOwner( ply )

return ent


function ENT:Think()
effect = EffectData()
effect:SetStart( self:GetPos() )
effect:SetOrigin( self:GetAngles():Forward() )
–util.Effect( “ToolTracer”, effect )

self:SetAngles( self.Owner:GetAngles() )
--self.Parent:SetPos( self:GetPos() )