So far so good. Everything works.
Except that once I added an explosion to the ent, and tried to fire it, it said tried to use a NULL entity.
So if you can help… Here is the part of the code that I believe is causing the error…
function ENT:Touch(ent)
if ent:GetPhysicsObject():IsValid() or ent:IsWorld() or ent:IsPlayer() or ent:IsNPC() then
local pos = self.Entity:GetPos()
local explode = ents.Create( "env_explosion" )
explode:SetPos( pos )
explode:SetOwner( self.Owner )
explode:Spawn()
explode:SetKeyValue( "iMagnitude", "75" )
explode:Fire( "Explode", 0, 0 )
explode:EmitSound( "weapon_AWP.Single", 100, 100 )
self.Remove
end
end
thnx