I need some help here as I am somewhat new to lua. I am making a scripted weapon that attaches a physics_cannister entity into an object using the manhack gun as a base, but I get this error when I spawn:
ERROR: Trying to derive entity physics_cannister from non existant entity nil!
Which means I can’t spawn the cannister, and if I try to use the primary function, it gives me this error:
ERROR: Trying to derive entity physics_cannister from non existant entity nil! Error: Tried to make a SENT (physics_cannister) but the 'Type' (phys) was invalid! [ERROR] lua/weapons/cannister_welder.lua:76: attempt to call method 'SetPos' (a nil value) 1. unknown - lua/weapons/cannister_welder.lua:76
Here’s the mentioned line:
ent:SetPos( tr.HitPos + self.Owner:GetAimVector() * 1 )