Unlimited Ammo

How do i make my SWEP have unlimited ammo?



SWEP.Primary.Recoil			= 0
SWEP.Primary.Damage			= 3
SWEP.Primary.NumShots		= 1
SWEP.Primary.Cone			= 0.02
SWEP.Primary.Delay			= 0.05

SWEP.Primary.ClipSize		= -1
SWEP.Primary.DefaultClip	= -1
SWEP.Primary.Automatic		= true
SWEP.Primary.Ammo			= "none"

SWEP.Secondary.Recoil			= 0
SWEP.Secondary.Damage			= 3
SWEP.Secondary.NumShots		= 1
SWEP.Secondary.Cone			= 0.02
SWEP.Secondary.Delay			= 0.05

SWEP.Secondary.ClipSize		= -1
SWEP.Secondary.DefaultClip	= 1
SWEP.Secondary.Automatic	= true
SWEP.Secondary.Ammo			= "none"


That should be able to do it. If it’s not working, try checking the **[SWEP.CanPrimaryAttack

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=SWEP.CanPrimaryAttack)** in your base SWEP (or in that SWEP) to see if it only allows the weapon to fire if its ammo is >0 (because its maximum is -1 and therefore will never be greater than 0.) If that’s the case, simply pasting this code into your SWEP should work:

[lua]function SWEP:CanPrimaryAttack()
return true
end[/lua]