Ammo not working get error

Hello I’m having this problem that my ammo is not working.

This is the error:

[ERROR] gamemodes/darkrp/entities/entities/spawned_ammo/init.lua:10: bad argument #1 to ‘GiveAmmo’ (number expected, got nil)

  1. GiveAmmo - [C]:-1

  2. unknown - gamemodes/darkrp/entities/entities/spawned_ammo/init.lua:10

This is the code:



AddCSLuaFile("shared.lua")

include("shared.lua")

function ENT:Initialize()
    self.BaseClass.Initialize(self)
end

function ENT:Use(activator, caller)
    activator:GiveAmmo(self.amountGiven, self.ammoType) --<----This is line 10
    self:Remove()
end

function ENT:OnTakeDamage(dmg)
    self:TakePhysicsDamage(dmg)
end

Thank you for the help in advaced

Just change it to how much ammo you want it to be in a number, and what type…
example:
activator:GiveAmmo(50,“pistol”)

Nvm fixed it but thanks anyway