Hey guys... I've been trying to solve this for HOURS. I keep getting this error.
Hook 'hud' Failed: [lua\includes\modules\draw.lua:200] attempt to index local 'color' (a number value)
Here is the function that is getting the error.
[code]
function hud()
local health = LocalPlayer():Health(math.Clamp( 0, 99999))
local armor = LocalPlayer():Armor()
local money = LocalPlayer():GetNWInt("Money")
local job = LocalPlayer():GetNWString("job")
local salary = LocalPlayer():GetNWInt("salary")
draw.RoundedBox(4, 4, 100, 200, 30, Color(0,0,0,150))
draw.RoundedBox(health, 4, 8, 18, 190, 25, Color(205,0,0,230))
end
hook.Add("HUDPaint", "hud", hud)
[/code]
It started getting the error when I made the second rounded box. (The health one.)
I really need help with this. I've tried fixing it myself for about 3 hours then I went to about 5 other people. :V
Firstly, it would be appreciated if you could use [B][noparse][lua] [/lua][/noparse][/B] tags next time, it makes the code much easier for us to read. Your problem is that you've used too many arguments for the [b][url=http://wiki.garrysmod.com/?title=Draw.RoundedBox]draw.RoundedBox[/url][/b] function. There should be [B]6[/B], you're using [B]7[/B].
Sorry, you need to Log In to post a reply to this thread.