LUA:
getOutfit = function (points)
local ID = {[-5000] = {outfit = {lookType = 40}, msg = 'Devil!!'},
[-2000] = {outfit = {lookType = 60}, msg = 'Pig!!'},
[-1500] = {outfit = {lookType = 5}, msg = 'Orc!!'},
[1500] = {outfit = {lookType = 73}, msg = 'Hero!!'},
[2000] = {outfit = {lookType = 266}, msg = 'Legend!!'},
[5000] = {outfit = {lookType = 331}, msg = 'Queen!!'},
}
if points > -1 then
table.sort(ID, function(a, b) return a[1] > b[1] end)
for _, t in ipairs(ID) do if points >= t[1] then return t[1] end end
else
table.sort(ID, function(a, b) return a[1] < b[1] end)
for _, t in ipairs(ID) do if points <= t[1] then return t[1] end end
end
return ID[points]
end,
This function fixed by Colandus and me returns a table with values. The problem is that it only works fine for e.g. when player has 2000 points, but if he has 2001 until 4999 then it won't work, as it should do
from (<-5000)-[SIZE=+1]∞[/SIZE] to -5000
from -4999 to -2000
from -1999 to -1500
-----------------------
from 1500 to 1999
from 2000 to 4999
from 5000 to [SIZE=+1]∞[/SIZE](>5000)
any halp?