Trouble with Paintball SWEP


function SWEP:PrimaryAttack()
	if ( !self:CanPrimaryAttack() ) then return end

		self.Weapon:EmitSound(Sound( "marker/pbfire.wav" ))
		self.Weapon:SetNextSecondaryFire( CurTime() + 0.10 )
		self.Weapon:SetNextPrimaryFire( CurTime() + 0.08 )
		self:ShootEffects()
		self:TakePrimaryAmmo( 1 )

		local pb = ents.Create("paint_ball")

		local shotpos = self.Owner:GetShootPos()
		shotpos = shotpos + self.Owner:GetForward() * 5
		shotpos = shotpos + self.Owner:GetRight() * 9
		shotpos = shotpos + self.Owner:GetUp() * -0.5

		pb:SetPos(shotpos)
		pb:SetOwner(self.Owner)
		pb:Spawn()

	if SERVER then
		local phys = pb:GetPhysicsObject()
		phys:ApplyForceCenter(self.Owner:GetAimVector() * 7000 )
	end
end

The error i get from local pb = ents.Create(“paint_ball”)

[Paintball Gun Sweep] lua/weapons/paintball_swep/shared.lua:90: attempt to call field ‘Create’ (a nil value)

  1. unknown - lua/weapons/paintball_swep/shared.lua:90

help would be appreciated :slight_smile:

Server side - Just a hint.