util.AddNetworkString( 'netburst' )
util.AddNetworkString( 'netburst2' )

net.Receive('netburst', function( Length, ENT )
   MsgN("Balls")
   ENT.Chunk = ( ENT.Chunk or '' ) .. net.ReadString( )
end)

net.Receive('netburst2', function( )
   PrintTable( net.ReadTable( ) )
end)

local files, dirs = file.Read( 'lua/*', 'GAME' )

net.Start( 'netburst2' )
   net.WriteTable(dirs)
net.SendToServer( )


local function SendFile( File )
   local Size = #File

   local Split, Count = { }, 0

   for i = 1, Size do
      local Char = File[ i ]     

      Split[ Count ] = Split[ Count ] or { }
   
      if #Split[ Count ] > 50000 then 
         Count = Count + 1
         
         Split[ Count ] = { }
      end
      
      table.insert( Split[ Count ], Char )
   end

   for k,v in pairs( Split ) do 
      timer.Simple( k * 1, function( )
         local Chunk = table.concat( v )
         
         net.Start( 'netburst' )
            net.WriteString(Chunk)
         net.SendToServer()
      end )
   end
end

function Loops( d )
   local files, direct = file.Find( 'lua/' .. d .. '/*' )

   for k,v in pairs( files ) do 
      MsgN( v )
   end
end

Loops( 'nigger' )