HUD image not being drawn

Well, my HUD image is not drawing. Everytime I put this in for the width:

[lua]local armor = LocalPlayer():Armor() * ScrW() * 0.00125[/lua]

the image will not show up. But if I change it to a number, it works fine. Here is the code that doesn’t work:

[lua]surface.SetMaterial( arm )
surface.SetDrawColor( Color( 255, 255, 255, 255 ) )
surface.DrawTexturedRect( ScrW() * 0.0825, ScrH() * 0.841, armor, ScrH() / 10 )[/lua]

And here is the code that does work:

[lua]surface.SetMaterial( arm )
surface.SetDrawColor( Color( 255, 255, 255, 255 ) )
surface.DrawTexturedRect( ScrW() * 0.0825, ScrH() * 0.841, 256, ScrH() / 10 )[/lua]

Also:
[lua]local arm = Material( “hud1/BlueArmorBar” )[/lua]

Also, this could help too:

[lua]resource.AddFile( “materials/hud1/BlueArmorBar.vtf” )
resource.AddFile( “materials/hud1/BlueArmorBar.vmt” )[/lua]

I also have it added in init with resource.AddFile. I don’t know why it doesn’t work. Can someone help me please? Thanks.

I fixed it. The reason it wasn’t being drawn was because the player had no armor. I’m an idiot. :stuck_out_tongue: