Deathrun Error + HUD Problem

Hello(again xd sry)!

I have now moved my HUD into my Server!

Everything works rly fine but there are 2 Points that make Problems:

  1. The Standart HUD ist activated
    http://prntscr.com/dusjnv

  2. I get this Error when the round starts:

[ERROR] gamemodes/deathrun/gamemode/sh_definerounds.lua:130: attempt to index a nil value

  1. OnEnter - gamemodes/deathrun/gamemode/sh_definerounds.lua:130
  2. func - gamemodes/deathrun/gamemode/roundsystem/cl_round.lua:12
    3. unknown - lua/includes/extensions/net.lua:32

I´m using Deathrun Neue.

Pls Help! xD

[editline]12th January 2017[/editline]

Ok antoher Problem, too :frowning: im bad…

When I am Dead the HUD is only Showing my HP VL …
So there is 0% and 0 … How can I make it that when I am spectating someone see his specs?
Thanks

[editline]12th January 2017[/editline]

bump


local hide = {
CHudHealth = true,
CHudBattery = true,
}

hook.Add( "HUDShouldDraw", "HideHUD", function( name )
if ( hide[ name ] ) then return false end

The thing is, would this work for Deathrun Neue?

The Gamemode from Arizard

This is a very common question, take the time to Google it as there is hundreds of results. From the first result;



hook.Add("HUDShouldDraw", "RemoveHealth", function(n)
	if n == "CHudHealth" then
		return false
	end
end)


At that code to your HUD file, or another clientside file.

I imagine this is because you have removed this line: https://github.com/Arizard/deathrun/blob/4fe94c6f5762181861c3a9d10b398a9afc846ca0/gamemode/cl_hud.lua#L13

I don’t think we can answer this without seeing your HUD code I’m afraid. If I had to guess, it’s likely that you’re doing some if statement with this

Player:Alive


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

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

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


local Avatar = vgui.Create( "AvatarImage", Panel )
Avatar:SetSize( 60, 60 )
Avatar:SetPos( 15, 625 )
hook.Add("InitPostEntity","HUD:CreateAvatar",function()
	Avatar:SetPlayer( LocalPlayer(), 64 )
end)

hook.Add("HUDPaint", "HUDBYSTYL", function()

   	local velocity = LocalPlayer():GetVelocity():Length()
	local health = LocalPlayer():Health()
	local armor = LocalPlayer():Armor()
	local name = LocalPlayer():Nick()
	local mathe = math.floor(velocity)
	local hp = math.min(health, 100)
	local vl = math.min(velocity, 1499)

    draw.RoundedBox( 25, 8, ScrH() - 150, 300 + 4, 800 + 4, Color(40,40,40) )
	draw.RoundedBox( 0, 10, ScrH() - 148,  150, 750, Color(40,40,40) )

	draw.RoundedBox( 0, 10, ScrH() - 24, hp * 1.356, 17, Color(255,120,120) )
	draw.SimpleText(health.."%","HUDFont",63 + 15, 737 + 15, Color(255,255,255),1,1)


	draw.RoundedBox( 0, 10, ScrH() - 52, vl * 0.1345, 19, Color(0,238,118) )
	draw.SimpleText(mathe.. "","HUDFont",63 + 15, 710 + 15, Color(255,255,255),1,1)

	draw.SimpleText("Name:" ..name ,"HUDFont2",80 + 15, 615 + 15, Color(255,255,255))

	draw.RoundedBox( 0, 160, ScrH() - 24,30 + 4, 13 + 4, Color(255,120,120) )
	draw.SimpleText("HP" ,"HUDFont3",150 + 15, 732 + 15, Color(255,255,255))

	draw.RoundedBox( 0, 160, ScrH() - 52,30 + 4, 15 + 4, Color(0,238,118) )
	draw.SimpleText("VL" ,"HUDFont3",150 + 15, 703 + 15, Color(255,255,255))

end)

Thats my Code