Receiving error when using T indicator

I was looking around facepunch and found a code that shows indicates deathstation for other T’s so they don’t accidentally use it.
But it doesn’t seem to work. I am not experienced at all with coding and so I have no clue what this error means. Other than that line isn’t working.

Where i found the code: http://forum.facepunch.com/showthread.php?t=1242938


[ERROR] gamemodes/terrortown/gamemode/deathstation.lua:5: attempt to index global 'v' (a nil value)
  1. fn - gamemodes/terrortown/gamemode/deathstation.lua:5
   2. unknown - addons/ulib/lua/ulib/shared/hook.lua:105


function DrawDeathStationMarker()
	local Texture = surface.GetTextureID("vgui/ttt/flashon")
	local width, height = surface.GetTextureSize(Texture)
	local screenpos = v:OBBCenter():ToScreen()
	
	if !LocalPlayer():IsTraitor() then
		return
	end
	
	for k, v in pairs (ents.GetAll()) do
		if IsValid(v) and v:GetClass() == "ttt_death_station" then
			surface.SetDrawColor(255, 255, 255, 255)
			surface.SetTexture(Texture)
			surface.DrawTexturedRect(screenpos.x - (width / 2), screenpos.y  - (height / 2), width, height)
		end
	end
end
hook.Add("HUDPaint", "DeathStation", DrawDeathStationMarker)

Does that error mean v isn’t defined within that folder location?
for example there is no local v = blah blah

move it into the if statement inside the for loop (not sure if that’ll work since ttt/flashon isn’t a texture to my knowledge)

[editline]21st May 2015[/editline]

it being [lua]local screenpos = v:OBBCenter():ToScreen()[/lua]

Sorry, but i don’t really understand what you mean by that

v is only defined inside the for loop you are doing. It looks like you intended for it to be inside the for loop in any case.

[lua]
function DrawDeathStationMarker()
local Texture = surface.GetTextureID(“vgui/ttt/flashon”)
local width, height = surface.GetTextureSize(Texture)

if !LocalPlayer():IsTraitor() then
	return
end

for k, v in pairs (ents.GetAll()) do
	if IsValid(v) and v:GetClass() == "ttt_death_station" then
		local screenpos = v:OBBCenter():ToScreen()
		surface.SetDrawColor(255, 255, 255, 255)
		surface.SetTexture(Texture)
		surface.DrawTexturedRect(screenpos.x - (width / 2), screenpos.y  - (height / 2), width, height)
	end
end

end
hook.Add(“HUDPaint”, “DeathStation”, DrawDeathStationMarker)
[/lua]