What went wrong here?


	function FUNC_SURVBOOK( ply, id, client )

	if client then return "Read" end
	ply:RemoveFromInventory( id )
	ply:EmitSound( table.Random{ "physics/cardboard/cardboard_box_break3.wav"}, 100, math.random( 90, 110 ) )
	ply:Notice( "You can now see loot spawns on your radar.", GAMEMODE.Colors.Green ) 
	if ( NextRadarThink or 0 ) < CurTime() then
	
	NextRadarThink = CurTime() + 1.5
	RadarEntTable = table.Add( RadarEntTable, ents.FindByClass( "info_lootspawn" ) )
	end
	local aimvec = ply:GetAimVector()
	for k,v in pairs( RadarEntTable ) do
	if v:GetClass() == "info_lootspawn" then
				
	color = Color( 255, 20, 147 )
		end end
		for k,v in pairs( team.GetPlayers( TEAM_ARMY ) ) do
		local loot = ents.FindByClass( "info_lootspawn" )

	v:SetDTEntity( 0, loot )
	
	umsg.Start( "StaticTarget", loot )
	
	if ent == NULL then
	
		umsg.Vector( Vector(0,0,0) )
		
	else
	
		umsg.Vector( v:GetPos() )
	
	end
	
	umsg.End()
	end end


Basically what’s suppose to happen is on use the radar will detect any info_lootspawn’s around the map, and show a pink dot on the radar accordingly.

No error code comes up, it’s usable but the lootspawn’s aren’t detected. Odd though, because this is the same style code used to detect other things such as point_stash

Need a little help.