Untitled
unknown
plain_text
2 years ago
943 B
7
Indexable
local itemID = 12612 -- El ID del ítem que, al ser usado, otorgará la cantidad de niveles deseada
local levelGain = 100 -- La cantidad de niveles que se otorgarán
local mensagem = "¡Niveles Gratis!" -- El mensaje que aparecerá al usar el ítem
function onUse(cid, item, frompos, item2, topos)
local playerpos = getPlayerPosition(cid)
if item.itemid == itemID then
for i = 1, levelGain do
doPlayerAddLevel(cid, 1)
end
doSendMagicEffect(playerpos, 30)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, mensagem)
if isItem(item.uid) then
doRemoveItem(item.uid)
else
doRemoveItem(item.uid, 1)
end
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Has ganado " .. levelGain .. " niveles.")
else
doPlayerSendCancel(cid, "Lo siento, este ítem no puede ser utilizado.")
end
return true
endEditor is loading...
Leave a Comment