I want to make a Rank System like "Top 30 player kill"
I just want to know:
1) How to make script that can load ALL data (notepad) in a folder
2) How to sort player kill from highest to lowest
Thx before
Sorry if i had a bad english
plrnumber = io.open('sys/lua/ranksys/howmuch.txt','r') pl_number=plrnumber:read() plrnumber:close() function initArray(m) 	local initArray = {} 	for i = 1, m do 		initArray[i] = 0 	end 	return initArray end pl_count = game('sv_maxplayers') pl_ratio = initArray(pl_count) pl_rank = initArray(pl_count) pl_frags = initArray(pl_count) pl_deaths = initArray(pl_count) pl_score = initArray(pl_count) addhook("join","clear") function clear(id) 	if player(id,"usgn") > 0 then 		plr_rank = io.open('sys/lua/ranksys/'..player(id,"usgn")..'.txt','r') 		if (plr_data ~= nil) then 			for line in io.lines('sys/lua/ranksys/'..player(id,"usgn")..'.txt','r') do 				local parses = totable(line) 				if (tonumber(parses[1]) > 0) then 					pl_rank[id] = tonumber(parses[1]) 					pl_score[id] = tonumber(parses[2]) 					pl_frags[id] = tonumber(parses[3]) 					pl_deaths[id] = tonumber(parses[4]) 					pl_ratio[id] = tonumber(parses[5]) 				end 			end 		else 			adduser(id) 			pl_crank = io.open('sys/lua/ranksys/'..player(id,"usgn")..'.txt','w') 			pl_crank:write('0 \n') -- rank 			pl_crank:write('0 \n') -- score 			pl_crank:write('0 \n') -- frags 			pl_crank:write('0 \n') -- deaths 			pl_crank:write('0 \n') -- ratio	 			pl_crank:close() 		end 	end			 end addhook("kill","add_kill") function add_kill(id) 	pl_frags[id] = pl_frags[id] + 1 	pl_updaterank(id) end addhook("die","add_die") function add_die(victim) 	pl_deaths[id] = pl_deaths[id] + 1 	pl_updaterank(id) end function adduser(id) 	pl_number = pl_number + 1 	playernumber = io.open('sys/lua/ranksys/howmuch.txt','w+') 	playernumber:write(''..pl_number..'') -- rank 	playernumber:close() end function pl_updaterank(id) 	pl_ratio[id]=pl_frags[id] / pl_deaths[id] end gamemode = game('sv_gamemode') addhook("say","pl_sayrank") function pl_sayrank(id,txt) 	if txt == rank then 		if player(id,"usgn")>0 then 			if player(id,"team")==1 and gamemode == 2 or gamemode == 3 or gamemode == 4 then 				msg('©000000255'..player(id,"name")..': ©255230010'..txt) 				msg('Rank '..pl_rank[id]..' of '..pl_number) 			elseif player(id,"team")==2 and gamemode == 2 or gamemode == 3 or gamemode == 4 then 				msg('©255000000'..player(id,"name")..': ©255230010'..txt) 				msg('Rank '..pl_rank[id]..' of '..pl_number) 			elseif player(id,"team")==0 and gamemode == 2 or gamemode == 3 or gamemode == 4 then 				msg(player(id,"name")..': '..txt) 				msg('Rank '..pl_rank[id]..' of '..pl_number) 			elseif player(id,"team")==1 or player(id,"team")==2 and gamemode == 0 or gamemode == 1 then 				msg('©000255000'..player(id,"name")..': ©255230010'..txt) 				msg('Rank '..pl_rank[id]..' of '..pl_number) 			end 		else 			msg2('©255000000Your not registered! Make an account at unrealsoftware.de') 			msg(player(id,"name")..' is not registered!') 		end 		return "1" 	end end