[ERROR] gamemodes/spratmode/gamemode/testhud.lua:28: '<eof>' expected near 'end'
1. unknown - gamemodes/spratmode/gamemode/testhud.lua:0
[CODE]function HUD()
local client = LocalPlayer()
if !client:Alive() then
return
end
draw.RoundedBox(0, 0, ScrH() - 100, 250, 100, Color(50, 50, 50, 230))
draw.SimpleText("Health: "..client:Health(), "DermaDefaultBold", 10, ScrH() - 90, Color(255, 255, 255, 255), 0, 0)
draw.SimpleText("Armor: "..client:Armor(), "DermaDefaultBold", 10, ScrH() - 65, Color(255, 255, 255, 255), 0, 0)
draw.RoundedBox(0, 255, ScrH() - 70, 125, 70, Color(30, 30, 30, 230))
if (client:GetActiveWeapon() :GetPrintName() != nil) then
draw.SimpleText (client:GetActiveWeapon() :GetPrintName(), "DermaDefaultBold", 260, ScrH() - 60, Color(255, 255, 255, 255), 0, 0)
end
end
if (client:GetActiveWeapon():Clip1() != -1) then
draw.SimpleText("Ammo: " .. client:GetActiveWeapon():Clip1() .. "/" .. client:GetAmmoCount (client:GetActiveWeapon():GetPrimaryAmmoType()), "DermaDefaultBold", 260, ScrH() - 40, Color(255, 255, 255, 255), 0, 0)
else
draw.SimpleText("Ammo: " .. client:GetAmmoCount(client:GetActiveWeapon():GetPrimaryAmmoType()), "DermaDefaultBold", 260, ScrH() - 40, Color(255, 255, 255, 255), 0, 0)
end
if (client:GetAmmoCount(client:GetActiveWeapon():GetSecondaryAmmoType()) > 0) then
draw.SimpleText("Secondary: " .. client:GetAmmoCount(client:GetActiveWeapon():GetSecondaryAmmoType()), "DermaDefaultBold", 260, ScrH() - 25, Color(255, 255, 255, 255), 0, 0)
end
end
hook.Add("HUDPaint", "TestHud", HUD)
function HideHud(name)
for k, v in pairs({"CHudHealth", "CHudBattery", "CHudAmmo", "CHudSecondaryAmmo"}) do
if name == v then
return false
end
end
end
hook.Add ("HUDShouldDraw", "HideDefaultHud", HideHud)[/CODE]
Help me fix this. Im new to glua. Thanks.
This "end" looks like it's not supposed to be there:
[img]http://i.imgur.com/tr3WW7l.png[/img]
Also using notepad++ you can spot such errors really easily by paying attention to these line-things:
[img]http://i.imgur.com/aZOV7tc.png[/img]
Thanks. You are a very helpful person.
Sorry, you need to Log In to post a reply to this thread.