t = {};

local function MoveTableStuffUP(ply)
	for i = 1,32 do
		if i == 32 then continue; end
		t[ply][i] = t[ply][i+1];
	end
end

timer.Create("TrailRemoveLast",005, 0,function()
	for k,v in pairs(t) do
		MoveTableStuffUP(k);
	end
end)

	
hook.Add("Think","trails",function()
	for k,v in pairs(t) do
		if distanceVec(v[32],k:GetPos()) > 2 then
			v[32] = k:GetPos();
		end
	end
end)

local mat = Material( "cable/xbeam" );

hook.Add("PreDrawOpaqueRenderables", "DrawBox", function()
	for k,v in pairs(t) do
		if !k:Alive() then continue end
		render.SetMaterial( mat );
		render.StartBeam(32)
			for i = 32,1,-1 do 
				render.AddBeam(v[i],32*(i/32),CurTime(),Color( 255, 255, 255, 255 ));
			end
		render.EndBeam();
	end
end)

function InsertPlayer(ply)
	t[ply] = {}
	for i = 1,32 do
		t[ply][i] = ply:GetPos()
	end
end