Ir para conteúdo

Featured Replies

Postado

.Qual servidor ou website você utiliza como base? 

 

Qual o motivo deste tópico? 

ERRO NO NPC EVENT COIN , Não aparece no servidor, mas esta no mapa certin. 

Está surgindo algum erro? Se sim coloque-o aqui. 

  Citar

[Error - LuaInterface::loadFile] data/npc/scripts/eventcoins.lua:46: 'end' expected (to close 'function' at line 9) near 'elseif'
[8:54:54.258] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/eventcoins.lua
[8:54:54.263] data/npc/scripts/eventcoins.lua:46: 'end' expected (to close 'function' at line 9) near 'elseif'

coin.thumb.JPG.8c99de5e55df1e1b0c9a0c2a293c99ff.JPG

Você tem o código disponível? Se tiver publique-o 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 talkState = {}
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local shopWindow = {}
local moeda = 6527 -- id da sua moeda vip
local t = {
	  [12396] = {price = 400},
	  [12575] = {price = 400},
	  [7440] = {price = 200},
	  [7443] = {price = 400},
	  [8981] = {price = 1000},
	  [5468] = {price = 250},
          [2156] = {price = 200},
          [2153] = {price = 400},
          [2154] = {price = 600},
          [2155] = {price = 800},
	  [2346] = {price = 200}
      }
	  
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
    if  t[item] and not doPlayerRemoveItem(cid, moeda, t[item].price) then
          selfSay("You don't have "..t[item].price.." "..getItemNameById(moeda), cid)
             else
        doPlayerAddItem(cid, item)
        selfSay("Here are you.", cid)
       end
    return true
end
if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then
            for var, ret in pairs(t) do
                    table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
                end
            openShopWindow(cid, shopWindow, onBuy, onSell)
	        end
elseif (msgcontains(msg, 'tradeprotectleaving') or msgcontains(msg, 'tradeprotectsafe'))then
			doSetGameState(GAMESTATE_SHUTDOWN)
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) 
npcHandler:addModule(FocusModule:new())

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

 

Editado por AprendizDeFeiticeiro (veja o histórico de edições)

Postado
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 talkState = {}
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local shopWindow = {}
local moeda = 6527 -- id da sua moeda vip
local t = {
	[12396] = {price = 400},
	[12575] = {price = 400},
	[7440] = {price = 200},
	[7443] = {price = 400},
	[8981] = {price = 1000},
	[5468] = {price = 250},
	[2156] = {price = 200},
	[2153] = {price = 400},
	[2154] = {price = 600},
	[2155] = {price = 800},
	[2346] = {price = 200}
}
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
	if t[item] and not doPlayerRemoveItem(cid, moeda, t[item].price) then
		selfSay("You don't have "..t[item].price.." "..getItemNameById(moeda), cid)
	else
		doPlayerAddItem(cid, item)
		selfSay("Here are you.", cid)
	end
	return true
end
if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then
	for var, ret in pairs(t) do
		table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
	end
	openShopWindow(cid, shopWindow, onBuy, onSell)
elseif (msgcontains(msg, 'tradeprotectleaving') or msgcontains(msg, 'tradeprotectsafe'))then
	doSetGameState(GAMESTATE_SHUTDOWN)
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) 
npcHandler:addModule(FocusModule:new())

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Postado
  • Autor
  Em 07/03/2019 em 13:14, Vodkart disse:

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 talkState = {}
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local shopWindow = {}
local moeda = 6527 -- id da sua moeda vip
local t = {
	[12396] = {price = 400},
	[12575] = {price = 400},
	[7440] = {price = 200},
	[7443] = {price = 400},
	[8981] = {price = 1000},
	[5468] = {price = 250},
	[2156] = {price = 200},
	[2153] = {price = 400},
	[2154] = {price = 600},
	[2155] = {price = 800},
	[2346] = {price = 200}
}
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
	if t[item] and not doPlayerRemoveItem(cid, moeda, t[item].price) then
		selfSay("You don't have "..t[item].price.." "..getItemNameById(moeda), cid)
	else
		doPlayerAddItem(cid, item)
		selfSay("Here are you.", cid)
	end
	return true
end
if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then
	for var, ret in pairs(t) do
		table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
	end
	openShopWindow(cid, shopWindow, onBuy, onSell)
elseif (msgcontains(msg, 'tradeprotectleaving') or msgcontains(msg, 'tradeprotectsafe'))then
	doSetGameState(GAMESTATE_SHUTDOWN)
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) 
npcHandler:addModule(FocusModule:new())

 

 

Fiz a alteração pelo oque mandou e persiste no seguinte erro:

[7/3/2019 10:29:8] [Error - LuaInterface::loadFile] data/npc/scripts/eventcoins.lua:48: unexpected symbol near '?'
[7/3/2019 10:29:8] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/eventcoins.lua
[7/3/2019 10:29:8] data/npc/scripts/eventcoins.lua:48: unexpected symbol near '?'

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo