Trouble finding right ammo capacity code.

Hello, I am trying to set a max ammo capacity for my swep, I just need to confirm if this is the right code as it does not seem to work.

Example of code:


function SWEP:Initialize( )
	self.Owner:SetAmmo( 100, "Pistol" )

Anyway, thanks for helping!

There is no way to set a max capacity due to the maxcarry field being disabled in Garry’s Mod. You can get around this by checking the ammo count in a think hook

Alright, thanks!