Error with hud

I keep getting this error:



Hook 'MDSHUD' Failed: TEST\gamemode\cl_init.lua:27: attempt to concatenate global 'class' (a nil value)


What I’m trying to do is:
[lua]
local client = LocalPlayer( )
if !client:Alive( ) then return end
if( client:GetActiveWeapon( ) == NULL or client:GetActiveWeapon( ) == “Camera” ) then return end

if client:Team() == 1 then
class = “Marine”
elseif client:Team() == 2 then
class = “Medic”
elseif client:Team() == 3 then
class = “Support”
elseif client:Team() == 4 then
class = “Recon”
elseif client:Team() == 5 then
class = “Engineer”
elseif client:Team() == 6 then
class = “Heavy Gunner”
end

draw.SimpleText("Class: "…class, “default”, 15, 57, Color(255,255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
[/lua]
Does anyone have any idea about this?

‘class’ is not initialized. This means that you are trying to concatenate a string with a nil value. Set class to “” at the beginning to make sure that ‘class’ is not nil (in case your if statements do not set ‘class’ for you).

Thanks! That fixed it.

Glad I could help. Enjoy.

I will.