GMOD Pointshop Pets Errors

So I’ve been attempting to get these pointshop pets working and there have been a few errors I’m bumping in to.

The first error seemed easy enough:



[ERROR] addons/p_pets/lua/effects/clouds/init.lua:33: attempt to call method 'VelocityDecay' (a nil value)
  1. unknown - addons/p_pets/lua/effects/clouds/init.lua:33

[ERROR] addons/p_pets/lua/effects/feathers_black/init.lua:40: attempt to call method 'VelocityDecay' (a nil value)
  1. unknown - addons/p_pets/lua/effects/feathers_black/init.lua:40


What I did to solve this was just by removing particle:VelocityDecay( false/true )

Then another error came up when a player attempted to equip it saying




[ERROR] addons/p_pets/lua/autorun/client/cl_followers.lua:48: Tried to use invalid object (type CLuaEmitter) (Object was NULL or not of the right type)
  1. SetPos - [C]:-1
   2. ParticleEmitter - addons/p_pets/lua/autorun/client/cl_followers.lua:48
    3. unknown - addons/p_pets/lua/effects/feathers_black/init.lua:7
     4. Effect - [C]:-1
      5. Fo_AttachParticles - addons/p_pets/lua/autorun/client/cl_followers.lua:15
       6. Initialize - addons/p_pets/lua/entities/base_follower/shared.lua:23
        7. unknown - addons/p_pets/lua/entities/nevermore/shared.lua:12


[ERROR] addons/p_pets/lua/autorun/client/cl_followers.lua:48: Tried to use invalid object (type CLuaEmitter) (Object was NULL or not of the right type)
  1. SetPos - [C]:-1
   2. ParticleEmitter - addons/p_pets/lua/autorun/client/cl_followers.lua:48
    3. unknown - addons/p_pets/lua/effects/dark_clouds/init.lua:7
     4. Effect - [C]:-1
      5. Fo_AttachParticles - addons/p_pets/lua/autorun/client/cl_followers.lua:15
       6. unknown - addons/p_pets/lua/entities/nevermore/shared.lua:15


[ERROR] addons/p_pets/lua/effects/feathers_black/init.lua:16: attempt to index field 'Emitter' (a nil value)
  1. unknown - addons/p_pets/lua/effects/feathers_black/init.lua:16


[ERROR] addons/p_pets/lua/effects/dark_clouds/init.lua:15: attempt to index field 'Emitter' (a nil value)
  1. unknown - addons/p_pets/lua/effects/dark_clouds/init.lua:15


Now the weird thing that i noticed is that when I already have it equipped before I remove the particle:VelocityDecay line, remove that line, then restart it, it seems to work perfectly fine. However, once I re-equip it or equip it for the first time after the restart I begin to get the errors above.

Heres the current addons/p_pets/lua/effects/feathers_black/init.lua file
[lua] function EFFECT:Init( data )

local ent = data:GetEntity()
if ( not IsValid( ent ) ) then return end

self.Owner = ent
self.Emitter = ParticleEmitter( self.Owner:GetPos() )

end

local particleDelay = 0.07
function EFFECT:Think()
if ( IsValid( self.Owner ) ) then

	local pos = self.Owner:GetPos()
	self.Emitter:SetPos( pos )
	
	local particle
	if ( not self.nextParticle ) or ( self.nextParticle < CurTime() ) then
		particle = self.Emitter:Add( "Effects/fleck_glass" .. math.random(1,3) , pos + Vector( math.random(-3,3),math.random(-3,3),math.random(4,6) ) ) 
		self.nextParticle = CurTime() + particleDelay
	end
	
	if (particle) then
		particle:SetVelocity( Vector(math.random(-50,50),math.random(-50,50), math.random( 30, 50 ) ))
		particle:SetLifeTime(0) 
		particle:SetDieTime(0.6) 
		particle:SetStartAlpha(255)
		particle:SetEndAlpha(0)
		particle:SetStartSize(2) 
		particle:SetRoll( 0 )
		particle:SetEndSize(1)
		particle:SetAngles(Angle( math.random( 0, 10 ),math.random( 0, 10 ),math.random( 0, 10 ) )  )
		particle:SetAngleVelocity( Angle( math.random( 0, 10 ),math.random( 0, 10 ),math.random( 0, 10 ) ) ) 
		
		local val = math.random( 150, 200 )
		particle:SetColor( 0,0,0, 255)
		particle:SetGravity( Vector( 0, 0, -200 ) )
		particle:SetAirResistance(20)  
		--particle:VelocityDecay( true )
		particle:SetCollide(false)
		particle:SetBounce(0)
	end

	return true
end

if ( self.Emitter ) then 
	self.Emitter:Finish()
end

return false

end

function EFFECT:Render()
end
[/lua]

Here’s the addons/p_pets/lua/autorun/client/cl_followers.lua file
[lua]
local Player = FindMetaTable( “Player” )
local Entity = FindMetaTable( “Entity” )

function Entity:Fo_AttachParticles( effectName )

if ( not effectName ) or ( not fo.EnableAllParticles ) then return end
if ( not fo.ShowFirstPersonParticles ) and ( self:Fo_GetOwner() == LocalPlayer() ) then return end

local vPoint = self:GetPos()
local effectdata = EffectData()
effectdata:SetStart( vPoint ) // not sure if ( we need a start and origin ( endpoint ) for this effect, but whatever
effectdata:SetOrigin( vPoint )
effectdata:SetEntity( self )
effectdata:SetScale( 1 )
util.Effect( effectName, effectdata )

end

function Entity:Fo_Draw()
if ( fo.ShowFirstPersonFollower ) then self:DrawModel() end
end

if ( !PARTICLE_EMITTER ) then PARTICLE_EMITTER = ParticleEmitter; end
function ParticleEmitter( _pos, _use3D )
if ( !_GLOBAL_PARTICLE_EMITTER ) then
_GLOBAL_PARTICLE_EMITTER = { };
end

if ( _use3D ) then
	if ( !_GLOBAL_PARTICLE_EMITTER.use3D ) then
		_GLOBAL_PARTICLE_EMITTER.use3D = PARTICLE_EMITTER( _pos, true );
	else
		_GLOBAL_PARTICLE_EMITTER.use3D:SetPos( _pos );
	end

	return _GLOBAL_PARTICLE_EMITTER.use3D;
else
	if ( !_GLOBAL_PARTICLE_EMITTER.use2D ) then
		_GLOBAL_PARTICLE_EMITTER.use2D = PARTICLE_EMITTER( _pos, false );
	else
		_GLOBAL_PARTICLE_EMITTER.use2D:SetPos( _pos );
	end

	return _GLOBAL_PARTICLE_EMITTER.use2D;
end

end
[/lua]

How about using up to date addons?

I’d like to but I can’t find anything like this updated