• Physgun Ammo "0" Showing up
    6 replies, posted
Hey, so I have my custom hud, but when I use my physgun it shows "0" ammo on it. I want it to show nothing, same as keys, and all of the ammo-less weapons. I tried to code my own thing but for a reason it doesnt work. Any help would be appreciated! if (client:GetActiveWeapon():Clip1() != -1) and (client:GetActiveWeapon():GetAmmoCount() != 0) then     draw.SimpleText(client:GetActiveWeapon():Clip1() .."/" .. client:GetAmmoCount(client:GetActiveWeapon():GetPrimaryAmmoType()), "DermaDefaultBold", 1812, 1020, Color(255,255,255),0,0)     else
Phys, Grav, and Tool guns don't use ammo.
https://files.facepunch.com/forum/upload/168380/7fa23f00-427c-4391-a7d9-0cdf6ca7c0ac/image.png
--hook.Add("HUDPaint", "Testing", function() local client, wep = LocalPlayer(), LocalPlayer():GetActiveWeapon() local weps = { "weapon_physcannon", "weapon_physgun" } if IsValid(wep) and !table.HasValue(weps, wep:GetClass()) then if (wep:Clip1() != -1) and (client:GetAmmoCount(wep:GetPrimaryAmmoType()) != 0) then draw.SimpleText(wep:Clip1() .."/" .. client:GetAmmoCount(wep:GetPrimaryAmmoType()), "DermaDefaultBold", 1812, 1020, Color(255,255,255),0,0) else draw.SimpleText(client:GetAmmoCount(wep:GetPrimaryAmmoType()), "DermaDefaultBold",1812, 1020, Color(255,255,255),0,0) end end --end)
https://files.facepunch.com/forum/upload/168380/271e6e62-416f-4d4d-acab-eba321e408cd/image.png Put it like that. It doesnt show anything, not the ammo and not the weapon name
local client, wep = LocalPlayer(), LocalPlayer():GetActiveWeapon() local weps = { "weapon_physcannon", "weapon_physgun" } if IsValid(wep) and !table.HasValue(weps, wep:GetClass()) then if (wep:Clip1() != -1) and (client:GetAmmoCount(wep:GetPrimaryAmmoType()) != 0) then draw.SimpleText(wep:Clip1() .."/" .. client:GetAmmoCount(wep:GetPrimaryAmmoType()), "DermaDefaultBold", 1812, 1020, Color(255,255,255),0,0) else draw.SimpleText(client:GetAmmoCount(wep:GetPrimaryAmmoType()), "DermaDefaultBold",1812, 1020, Color(255,255,255),0,0) end end
Thank you so much!!! Appreciate your help very much man!
Sorry, you need to Log In to post a reply to this thread.