Hi, I'm new to Lua. Anyway, I'm trying to make a simple script that shows/hides the default Gmod HUD using a ConVar.
So far, I have this:
[code]hhshow = CreateClientConVar("hh_show", "1", true)
function hh(name)
res = hhshow:GetBool()
for k,v in pairs({"CHudHealth", "CHudBattery", "CHudAmmo", "CHudSecondaryAmmo"}) do
if name == v then
return res
end
end
return true
end
hook.Add("HUDShouldDraw", "hide hud script", hh)
[/code]
There's a problem with this script. The default HUD stays visible no matter what the ConVar (hh_show) is set to.
Can you please help me? Thank you.
Sorry, you need to Log In to post a reply to this thread.