Weapon Error.


[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



SWEP (traitor_health_station) is derived from non existant SWEP (base_entity) - Expect errors!


Help will give this error when he pulled a weapon.




AddCSLuaFile()



SWEP.HoldType = "normal"





if CLIENT then

   SWEP.PrintName = "health station"

   SWEP.Slot = 6



   SWEP.ViewModelFOV = 10



   SWEP.EquipMenuData = {

      type = "item_weapon",

      desc = "hstation_desc"

   };



   SWEP.Icon = "vgui/ttt/icon_health"

end



SWEP.Base = "weapon_tttbase"



SWEP.ViewModel          = "models/weapons/v_crowbar.mdl"

SWEP.WorldModel         = "models/props/cs_office/microwave.mdl"



SWEP.DrawCrosshair      = false

SWEP.Primary.ClipSize       = -1

SWEP.Primary.DefaultClip    = -1

SWEP.Primary.Automatic      = true

SWEP.Primary.Ammo       = "none"

SWEP.Primary.Delay = 1.0



SWEP.Secondary.ClipSize     = -1

SWEP.Secondary.DefaultClip  = -1

SWEP.Secondary.Automatic    = true

SWEP.Secondary.Ammo     = "none"

SWEP.Secondary.Delay = 1.0



-- This is special equipment





SWEP.Kind = WEAPON_EQUIP

SWEP.CanBuy = {ROLE_TRAITOR}

SWEP.LimitedStock = true

SWEP.WeaponID = AMMO_HEALTHSTATION



SWEP.AllowDrop = false



SWEP.NoSights = true



  1. Because your ammo type and clip size it pretty much none, it won’t register into Ammo1
  2. For some reason, weapon_tttbase’s base is set to base_entity