A talkaction.
function onSay(cid, words, param, channel)
local coin = 9971 --gold ingot
local exp = 100000000 --quanta exp ganha
local quant = 10 --quantos gold ingot precisa para ganhar a exp
if getPlayerItemCount(cid, coin) >= quant and doPlayerRemoveItem(cid, coin, quant) then
doSendMagicEffect(getCreaturePosition(cid), 14)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voca acaba de ganhar exp!")
doPlayerAddExp(cid, exp)
else
doSendMagicEffect(getCreaturePosition(cid), 2)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce precisa de " .. quant .. " " .. getItemNameById(coin) .. " para ganhar a expericiencia!")
end
return true
end