1.1 exp per second
2.have ranking
as well as server [CTR] Roleplay and [PM] Roleplay
I asked for his help ya
addhook("join","_join") --Loads user data from rankfolder addhook("kill","_kill") --Adds 1 to the users table, and if the rank is different after adding 1 it will message indicating the new rank addhook("leave","_leave") --Saves user data to rankfolder addhook("team","_team") --Indicates rank rankfolder="sys/lua/ranks/" --Where kills are saved tRanks={ --EDIT ["TR Patents of EUA"]=0, ["TR Captain"]=10, ["TR Major"]=310, ["TR Corporal"]=320, ["TR Guerriler"]=330, --["Name of Rank"]=Number of Kills-- } ctRanks={ --ranks ["CT Patents of EUA"]=0, ["CT Captain"]=10, ["CT Major"]=310, ["CT Corporal"]=320, ["CT Guerriler"]=330, --["Name of Rank"]=Number of Kills-- } teams={ "TR", --Terrorist "CT", --Counter-Terrorist } users={} --users[id] is the number of kills function _join(id) --Loads user data from rankfolder if player(id,"usgn")~=0 then --Only if you have a usgn users[id]=tonumber(loaddata(rankfolder..player(id,"usgn")..".txt")) or 0 --If you don't have data, place your kill start to 0 end end function _kill(killer,victim) --Adds 1 to the users table, and if the rank is different after adding 1 it will message indicating the new rank if player(killer,"usgn")~=0 then --Only if you have a usgn users[killer]=users[killer]+1 --add 1 kill if torank(users[killer]-1,player(killer,"team"))~=torank(users[killer],player(killer,"team")) then --if you rank is different msg(string.char(169).."255255255"..player(killer,"name").." is now rank: "..torank(users[killer],player(killer,"team")).."!") --show the message end end end function _leave(id) --Saves user data to rankfolder if player(id,"usgn")~=0 then --Only if you have a usgn savedata(rankfolder..player(id,"usgn")..".txt",users[id]) --save function end end function _team(id,team) --Indicates rank if player(id,"usgn")~=0 then --Only if you have a usgn if torank(users[id],team) then --If the rank is not nil or false msg(string.char(169).."255255255Player ("..player(id,"name")..") ("..torank(users[id],team)..") JOINS ("..teams[team]..")") --show the rank end end end function savedata(path,data) --simple save function file=io.open(path,"w") --open the path file:write(data) --write data file:close() --close path end function loaddata(path) --simple load function file=io.open(path,"r") --read path if not file then return false end --if path does not exist return false local data=file:read("*all") --set data as the read data file:close() --close path return data --return the loaded file data end function torank(kills,team) --turn the number of kills to the rank if team==1 then ranks=tRanks else ranks=ctRanks end local final=false --if a rank is not found, false is returned local kill=-1 --the rank is accumulative, so the best rank is returned for rankname,rank in pairs(ranks) do --loop through all the ranks if kills>=rank and rank>kill then --if you have more kills than the rank, and the rank is better than your current rank kill=rank --set your current rank final=rankname --set your final rank end end return final --return it end