Estou com um problema.
meu ot é 8.6
e meu script da second promotion por item da bugada
ot/data/action/action.xml
<action itemid="9971" event="script" value="promoitem.lua"/>
e o script
ot/data/action/script/promoitem.lua
function onUse(cid, item, fromPosition, itemEx, toPosition)
local vocation = getPlayerVocation(cid)
local id = getPlayerGUID(cid)
if(item.itemid == 9971) then
if(isInArray({5,6,7,8,9,10,11,12}, getPlayerVocation(cid)) == TRUE) then
elseif vocation == 5 then
db.executeQuery("UPDATE `players` SET `vocation` = 9 WHERE `id` ='"..id.."';")
elseif vocation == 6 then
db.executeQuery("UPDATE `players` SET `vocation` = 10 WHERE `id` ='"..id.."';")
elseif vocation == 7 then
db.executeQuery("UPDATE `players` SET `vocation` = 11 WHERE `id` ='"..id.."';")
elseif vocation == 8 then
db.executeQuery("UPDATE `players` SET `vocation` = 12 WHERE `id` ='"..id.."';")
end
doSendMagicEffect(fromPosition, CCONST_ME_MAGIC_RED)
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid, 20, "You are a ".. getPlayerVocationName(cid) ..".")
return true
end
end
Por favor Ajudem-me!