Swep makeing bugs

Hey I can not seem to find the reason as to why this code will not work can you guys possibly help me?

here is my SWEP code


 

if SERVER then 
AddCSLuaFile( "shared.lua" )
end 

if CLIENT then
   SWEP.PrintName = "mp5"
   SWEP.Slot = 2
   
   SWEP.ViewModelFOV     = 72
   SWEP.ViewModelFlip    = true
 
 end 
 
 SWEP.Base                              = "ttt_base"
 SWEP.HoldType                          = "ar2"
 
 
 SWEP.Primary.Delay           = 0.01
 SWEP.Primary.Recoil          = 0.01
 SWEP.Primary.Automatic       = false 
 SWEP.Primary.Damage          = 25
 SWEP.Primary.Cone            = 0.01
 SWEP.Primary.ClipSize        = 15
 SWEP.Primary.ClipMax         = 90
 SWEP.Primary.Ammo            = "smg1"
 SWEP.Primary.DeafailtClip    = 1
 SWEP.Primary.Sound           = Sound( "Weapon_MP5Navy.Single" ) 
 
 SWEP.IronSightsPos = Vector( 6.05, -5, 2.4 ) 
 SWEP.IronSightsAng = Vector( 2.2, -0.1, 0 ) 
 
 SWEP.ViewModel = "models/weapons/v_smg_mp5.mdl"
 SWEP.WorldModel = "models/weapons/w_smg_mp5.mdl"
 
 SWEP.Kind = WEAPON_HEAVY
 SWEP.AmmoEnt = "item_ammo_smg1_ttt"
 SWEP.AutoSpawnable = false
 SWEP.InLoadoutFor = nil
 SWEP.AllowDrop = true
 SWEP.IsSilent = false 
 SWEP.NoSights = false


function SWEP:GetHeadshotMultiplier(victim, dmginfo)
   local att = dmginfo:GetAttacker()
   if not IsValid(att) then return 2 end

   local dist = victim:GetPos():Distance(att:GetPos())
   local d = math.max(0, dist - 150)

   -- decay from 3.2 to 1.7
   return 1.7 + math.max(0, (1.5 - 0.002 * (d ^ 1.25)))
end



and here is the error I keep getting,



[ERROR] gamemodes/terrortown/gamemode/cl_hud.lua:98: attempt to call method 'Ammo1' (a nil value)
  1. GetAmmo - gamemodes/terrortown/gamemode/cl_hud.lua:98
   2. InfoPaint - gamemodes/terrortown/gamemode/cl_hud.lua:242
    3. unknown - gamemodes/terrortown/gamemode/cl_hud.lua:342


Just asking. I dont know if this cause the problem but shouldn’t this be


SWEP.Primary.DefaultClip = (NUMBER)

??

Hope it help :slight_smile:

Oh shit spelling mistake 0-0 LOL let me fix it up and go test it haha