HUD help

Im trying to add this in my server:

[lua] function killcounter()
draw.WordBox( 8, ScrW() - 920, ScrH() - 98, "KillCount Blue Team: "… team.GetScore(1)“ScoreboardText”,Color(200,0,0,0),Color(255,255,255,255))
end
hook.Add(“HUDPaint”,“KillCounter”,killcounter)[/lua]

when I add it to init.lua it doesnt seem to load(no hud, no error) when I add it to shared or client I get errors ( attempt to call number value )
I’m not sure I think huds are serverside?


draw.WordBox( 8, ScrW() - 920, ScrH() - 98, "KillCount Blue Team: ".. team.GetScore(1),"ScoreboardText",Color(200,0,0,0),Color(255,255,255,255))

You forgot a comma after team.GetScore

[editline]2nd September 2015[/editline]

Also, HUD doesn’t work serverside.
The server is a server. Not the player’s screen.

Thanks! I fixed this, now it doesnt work at all. (cl_init.lua) no errors I just dont see anything.

[editline]2nd September 2015[/editline]

It says now Scoreboard Text isn’t a valid font. How do I get this font, or could u name me a valid font?


[ERROR] lua/includes/modules/draw.lua:243: 'ScoreboardText' isn't a valid font

  1. SetFont - [C]:-1
   2. WordBox - lua/includes/modules/draw.lua:243
    3. fn - gamemodes/deathmatch/gamemode/cl_init.lua:4
     4. unknown - addons/ulib/lua/ulib/shared/hook.lua:179

After using surface.Createfont It still doesnt shop up, no errors… just not showing I have got AddCSLuaFile in the init.lua. I tried with more Draw.Text nothing seems to load/work…

Are you sure you’re using surface.createfont properly and have it clientside only?



surface.CreateFont( "ScoreboardText", {
	font = "Arial", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
	size = 13,
	weight = 500,
	blursize = 0,
	scanlines = 0,
	antialias = true,
	underline = false,
	italic = false,
	strikeout = false,
	symbol = false,
	rotary = false,
	shadow = false,
	additive = false,
	outline = false,
} )


Yes.

[lua]include(“shared.lua”)

surface.CreateFont( “ScoreboardText”, {
font = “Arial”, – Use the font-name which is shown to you by your operating system Font Viewer, not the file name
size = 13,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true,
underline = false,
italic = false,
strikeout = false,
symbol = false,
rotary = false,
shadow = false,
additive = false,
outline = false,
} )

function killcounter()
draw.WordBox( 8, ScrW() - 920, ScrH() - 98, "KillCount Blue Team: "… team.GetScore(1), “ScoreboardText”, Color(200,0,0,0), Color(255,255,255,255))
end
hook.Add(“HUDPaint”,“KillCounter”,killcounter)[/lua]

my cl_init.lua

[editline]2nd September 2015[/editline]

fixed! hook goes after end! my bad!