Sex* Posted February 12, 2013 Share Posted February 12, 2013 My server is creating errors again. The errors are "attemt to compare two nil values". The errors are coming then two players are alive. Then only one player in the server, errors dont come. The function there its coming: function RaceMode:updateRanks() -- Make a table with the active players local sortinfo = {} for i,player in ipairs(getActivePlayers()) do sortinfo[i] = {} sortinfo[i].player = player sortinfo[i].checkpoint = getPlayerCurrentCheckpoint(player) sortinfo[i].cpdist = distanceFromPlayerToCheckpoint(player, sortinfo[i].checkpoint ) end -- Order by cp table.sort( sortinfo, function(a,b) return a.checkpoint > b.checkpoint or ( a.checkpoint == b.checkpoint and a.cpdist < b.cpdist ) end ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now