5lave Ots
Active Member
goodnight i'm trying to make a script that animate the top player on my srever (rebirth)
so i need to know how i can get the max value of player rebirths from a table,
or any other idea so that the highest Reb player got an effect above him
function: getPlayerRebirth(cid)
tibia 860. tfs 0.4
rep++
i tried to make this script but it doesnt work
so i need to know how i can get the max value of player rebirths from a table,
or any other idea so that the highest Reb player got an effect above him
function: getPlayerRebirth(cid)
tibia 860. tfs 0.4
rep++
i tried to make this script but it doesnt work
LUA:
-- getPlayerGUID()
local List = {}
function onThink(intraval)
for _, online in ipairs(getOnlinePlayers()) do
local name = getPlayerByName(online)
if getPlayerRebirth(name) >= 0 then
table.insert(List, getPlayerRebirth(name))--contain 'number' reb val of every player
-- table.insert(List, name)--cid
end
-- table.find(List,table.maxn(List)) --can i use this?
for _, List2 in ipairs(List) do
local cid = getPlayerByName(numberToVariant(math.max(List2)))
local cid2 = getPlayerByName(top1)
doSendMagicEffect(getCreaturePosition(cid), 67)
end
end
return true
end
Last edited by a moderator: