local items =
{ --[numeração] = {id = ID DO ITEM, count = QUANTIDADE DO ITEM}
[1]={id=2159, count=1}, --
[2]={id=2695, count=1}, --
[3]={id=2090, count=1}, --
[4]={id=6570, count=1}, --
[5]={id=6571, count=1}, --
[6]={id=7632, count=1}, --
[7]={id=7633, count=1}, --
[8]={id=2153, count=1}, --
[9]={id="level", count=1}, --
}
function doPlayerAddLevel(cid, amount, round)
local newExp = 0
local currentLevel = getPlayerLevel(cid)
if amount > 0 then
newExp = getExperienceForLevel(currentLevel + amount) - (round and getPlayerExperience(cid) or getExperienceForLevel(currentLevel))
else
newExp = -((round and getPlayerExperience(cid) or getExperienceForLevel(currentLevel)) - getExperienceForLevel(currentLevel + amount))
end
return doPlayerAddExp(cid, newExp)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local a = math.random(1, #items)
if type(items[a].id) == "string" then
doPlayerAddLevel(cid, items[a].count)
else
doPlayerAddItem(cid, items[a].id, items[a].count)
end
doSendAnimatedText(getPlayerPosition(cid), "Box!", TEXTCOLOR_GREEN)
doPlayerSendTextMessage(cid, 27, "Você abriu a box e ganhou "..items[a].count.."x "..(tonumber(items[a].id) and getItemNameById(items[a].id) or "level"..(items[a].count > 1 and "s" or ""))..".")
doRemoveItem(item.uid, 1)
return true
end
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.