TimeForPug wrote:
IM going off other programming languages.
It looks like an indent is needed.
Yeah, you're right. You need to ensure your methods/statements are indented when they're declared within a function. Same goes for if selectors and so on.
For example:
hook.add("HUDPaint", "DrawMyHud", function()
local health = LocalPlayer():Health()
-- local ammo = LocalPlayer(): needs adjusted
local armour = LocalPlayer():Armor()
draw.RoundedBox(0,8,8,300+4,30+4) -- background for health bar
draw.SimpleText("HEALTH: " + health, "hudText",10 + 150,10 + 15,Color(255,255,255),1,1)
draw.RoundedBox(0,10,10,health * 3,30,Color(255,120,120)) -- health bar
end)
When it's not indented it falls out of scope and will not execute with the function. I'm not sure if this code actually works, it was just something I blasted out quickly without thinking too hard.