Ammunition + clips

Been trying to make a custom ammo to the hud i am creating but just cant seem to find the correct variable, so needing help to figure this new, do be aware i am new and still learning lua :slight_smile:


 function hidehud(name)
	for k, v in pairs({"CHudHealth", "CHudBattery"}) do
		if name == v then return false end
	end
end
hook.Add("HUDShouldDraw", "HideOurHud:D", hidehud)

hook.Add("HUDPaint" , "DrawMyHud" , function()

	local health = LocalPlayer() :Health()
	local armor = LocalPlayer() :Armor()
	local name = LocalPlayer() :Name()
	
	draw.RoundedBox(0,8,ScrH() - 40,300+4, 30 + 4,Color(255,255,255))
	draw.RoundedBox(0,10,ScrH() - 38,health * 3,30,Color(255,120,120))
	draw.SimpleText(health.."%","HudHP",8 + 150 , ScrH() - 23,Color(0,0,0),1,1)

	draw.RoundedBox(0,8,ScrH() - 80,300+4, 30 + 4,Color(255,255,255))
	draw.RoundedBox(0,10,ScrH() - 78,armor * 3,30,Color(120,120,255))
	draw.SimpleText(armor.."%","HudAP",8 + 150 , ScrH() - 63,Color(0,0,0),1,1)
	
	draw.SimpleText(name,"HudNAME",8 + 150 , ScrH() - 93,Color(0,0,0),1,1)
	
	draw.RoundedBox(0,8,ScrH() - 80,300+4, 30 + 4,Color(255,255,255))
	draw.RoundedBox(0,10,ScrH() - 78,armor * 3,30,Color(120,120,255))
	draw.SimpleText(armor.."%","HudAP",8 + 150 , ScrH() - 63,Color(0,0,0),1,1)
	
end)

If you mean the correct hud element for ammo it’s


CHudAmmo

Player:GetActiveWeapon

Weapon:Clip1

Player:GetAmmoCount

Weapon:GetPrimaryAmmoType