My function is spamming errors.


function SWEP:Think()
		local tr = util.TraceLine(trace)
if tr.HitNonWorld then
			if string.find(tr.Entity:GetClass(), "prop_ragdoll") then
				local Bone = tr.Entity:LookupBone("ValveBiped.Bip01_Head1")
			    self.HeadPos = tr.Entity:GetBonePosition( Bone ) 
											local Scale = 0.01
											end
											end
											end

What does it spam:


got niltable expected, got niltable expected, got niltable expected, got niltable expected, got niltable expected, got niltable expected, got niltable expected, got niltable expected, got niltable expected


local tr = util.TraceLine(trace)

trace is nil

It still spams the same error.

He didn’t provide you a fix, he told you what the problem was so you can fix it yourself and actually learn something instead of begging others to do it.