Ir para conteúdo

Featured Replies

Postado

Gente o erro é assim qnd eu  escrevo pra comprar pois e assim (hi) (spells) e o nome da spells mas quando eu falo e como eu tentasse soltar a magia  como  eu deixei so pros palyer adquirir a magia ocm o npc ñao ta dando  a script ta aqui:

 

 

 

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local moeda = 2157
local t = {
["exevo mas dead"] = {price = 5000000,vocations = {1,2},level = 1000},
["exevo song pally"] = {price = 5000000,vocations = {3},level = 8},
["exevo gran mas ice"] = {price =5000000,vocations = {1,2},level = 15},
["exori mas gran"] = {price =5000000,vocations = {4},level = 12},
["exevo gran trap"] = {price =5000000,vocations = {1,2,3,4},level = 12}
}
if (msgcontains(msg, 'SPELLS') or msgcontains(msg, 'spells'))then
local str = ""
str = str .. "Eu vendo estas Magias: "
for name, pos in pairs(t) do
str = str.." {"..name.."} = "..pos.price.." Moedas /"
end
str = str .. "."
npcHandler:say(str, cid)
elseif t[msg] then
if not getPlayerLearnedInstantSpell(cid, msg) then
if getPlayerLevel(cid) >= t[msg].level then
if isInArray(t[msg].vocations, getPlayerVocation(cid)) then
if doPlayerRemoveItem(cid,moeda,t[msg].price) then
doPlayerLearnInstantSpell(cid, msg)
npcHandler:say("Você aprendeu uma nova magia chamada ".. msg .."!", cid)
else
npcHandler:say("você não tem "..t[msg].price.." ".. getItemNameById(moeda), cid)
end
else
npcHandler:say("você não tem a vocação para comprar está spell.", cid)
end
else
npcHandler:say("você precisa ter level "..t[msg].level.." ou mais para comprar essa magia.", cid)
end
else
npcHandler:say("você já aprendeu essa magia.", cid)
end
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo