I think in an earlier version of gmod you had to access the weapon entity with self.Weapon
[editline]19th April 2017[/editline]
I’ve tried to recreate your weapon, but dropping the weapon and picking it up doesn’t seem to reset the counter for me
SWEP.PrintName = "Counter"
SWEP.Spawnable = true
SWEP.ViewModel = "models/weapons/v_pistol.mdl"
SWEP.WorldModel = "models/weapons/w_pistol.mdl"
function SWEP:SetupDataTables()
self:NetworkVar("Float",0,"Clicked")
end
function SWEP:PrimaryAttack()
self:SetClicked(self:GetClicked() + 1)
print(self:GetClicked())
end
function SWEP:Reload()
if SERVER then
self.Owner:DropWeapon(self)
end
end
function SWEP:Equip()
print("Count on Equip:".. self:GetClicked())
end