tested on TFS 0.4 latest rev. onBuy function not working =( Trade window button (ok) not working =) And no any error in server. Any idea?
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
if not getPlayerLearnedInstantSpell(cid, shopWindow[item].Words) then
if getPlayerLevel(cid) >= shopWindow[item].Level then
if isInArray(shopWindow[item].Vocs, getPlayerVocation(cid)) then
doPlayerRemoveMoney(cid, shopWindow[item].Price)
doPlayerLearnInstantSpell(cid, shopWindow[item].Words)
npcHandler:say("você aprendeu uma nova magia chamada "..shopWindow[item].Words, cid)
else
npcHandler:say("você não tem a vocação para comprar está spell.", cid)
end
else
npcHandler:say("você precisa ter level "..shopWindow[item].Level.." ou mais para comprar essa magia.", cid)
end
else
npcHandler:say("você já aprendeu essa magia.", cid)
end
return true
end