Adding Ammo to my custom hud

I can not seem to get ammo to work on my custom hud.

Here is my code to add ammo:

Here is where I define the function “ammo”:

When I try this I get the error:

What am I doing wrong? Any help is greatly appreciated!

Edit: my whole code is located at: http://pastebin.com/KdvFJQUC#

Add “local client = LocalPlayer()” outside of your function.

Okay I’ll try it. Thanks.

Edit: Worked great. Thank you again. Another question though, when I use the physgun it is -1 ammo. I was wondering if there was a way to not draw the ammo box at all or just say ‘0’ ammo if the physgun is in use.

Check if the ammo is -1 and if it is draw 0.

Isn’t it draw false?

false == 0 == nil

false == 0?

false == tobool( 0 )

as seen in: https://dl.dropboxusercontent.com/u/26074909/tutoring/networking/networking_booleans.lua