Ir para conteúdo
  • 0

Npc Repair Soft Y Firewalker


Bennyhappy

Pergunta

Eu fiz isso, para adicionar,

doSendMagicEffect(getPlayerPosition(cid), 12) para reparar soft boots

e

doSendMagicEffect(getPlayerPosition(cid), 13) para reparar Firewalker boots

 

mas eu tenho esse problema

 

[Error - LuaScriptInterface::loadFile] data/npc/scripts/softst.lua:59: '<eof>' expected near 'end'
[Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/softst.lua
data/npc/scripts/softst.lua:59: '<eof>' expected near 'end'

 

este é o script

 

 

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

if(msgcontains(msg, 'soft') or msgcontains(msg, 'soft boots')) then
selfSay('¿Quieres reparar tus soft boots por 20000 gold coins?', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if(getPlayerItemCount(cid, 10021) >= 1) then
if(doPlayerRemoveMoney(cid, 20000) == TRUE) then
doPlayerRemoveItem(cid, 10021, 1)
doPlayerAddItem(cid, 2640)
doSendMagicEffect(getPlayerPosition(cid), 12)
selfSay('Aqui tienes.', cid)
else
selfSay('¡No mames wey!, ¡no te alcanza el dinero!, ¡¡regresate a cazar mounstruos para juntar, jodido!!.', cid)
end
else
selfSay('Disculpa, no tienes Worn sofs Boots.', cid)
end
talkState[talkUser] = 0
elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then
talkState[talkUser] = 0
selfSay('Ok pues.', cid)
end

if(msgcontains(msg, 'firewalker') or msgcontains(msg, 'firewalker boots')) then
selfSay('¿Quieres reparar tus firewalker boots por 20000 gold coins?', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if(getPlayerItemCount(cid, 10022) >= 1) then
if(doPlayerRemoveMoney(cid, 20000) == TRUE) then
doPlayerRemoveItem(cid, 10022, 1)
doPlayerAddItem(cid, 9933)
doSendMagicEffect(getPlayerPosition(cid), 13)
selfSay('Aqui tienes.', cid)
else
selfSay('¡No mames wey!, ¡no te alcanza el dinero!, ¡¡regresate a cazar mounstruos para juntar, jodido!!.', cid)
end
else
selfSay('¿¡Seras pendejo!?, ¿donde estan tus Worn of Firewalker Boots?. Si las olvidaste vete y cuando las tengas ven conmigo.', cid)
end
talkState[talkUser] = 0
elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then
talkState[talkUser] = 0
selfSay('Ok pues.', cid)
end
end
    return TRUE   
    end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts Recomendados

  • 0
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

if(msgcontains(msg, 'soft') or msgcontains(msg, 'soft boots')) then
selfSay('¿Quieres reparar tus soft boots por 20000 gold coins?', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if(getPlayerItemCount(cid, 10021) >= 1) then
if(doPlayerRemoveMoney(cid, 20000) == TRUE) then
doPlayerRemoveItem(cid, 10021, 1)
doPlayerAddItem(cid, 2640)
doSendMagicEffect(getPlayerPosition(cid), 12)
selfSay('Aqui tienes.', cid)
else
selfSay('¡No mames wey!, ¡no te alcanza el dinero!, ¡¡regresate a cazar mounstruos para juntar, jodido!!.', cid)
end
else
selfSay('Disculpa, no tienes Worn sofs Boots.', cid)
end
talkState[talkUser] = 0
elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then
talkState[talkUser] = 0
selfSay('Ok pues.', cid)
end

if(msgcontains(msg, 'firewalker') or msgcontains(msg, 'firewalker boots')) then
selfSay('¿Quieres reparar tus firewalker boots por 20000 gold coins?', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if(getPlayerItemCount(cid, 10022) >= 1) then
if(doPlayerRemoveMoney(cid, 20000) == TRUE) then
doPlayerRemoveItem(cid, 10022, 1)
doPlayerAddItem(cid, 9933)
doSendMagicEffect(getPlayerPosition(cid), 13)
selfSay('Aqui tienes.', cid)
else
selfSay('¡No mames wey!, ¡no te alcanza el dinero!, ¡¡regresate a cazar mounstruos para juntar, jodido!!.', cid)
end
else
selfSay('¿¡Seras pendejo!?, ¿donde estan tus Worn of Firewalker Boots?. Si las olvidaste vete y cuando las tengas ven conmigo.', cid)
end
talkState[talkUser] = 0
elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then
talkState[talkUser] = 0
selfSay('Ok pues.', cid)
end
 return TRUE  
 end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Link para o comentário
Compartilhar em outros sites

  • 0

fico ste error

 

 

17:31 God Elite [124]: firewalker
17:31 Boots Repair: ¿Quieres reparar tus firewalker boots por 20000 gold coins?
17:31 God Elite [124]: yes
17:31 Boots Repair: Disculpa, no tienes Worn sofs Boots.

 

 

com soft boots funsiona bem

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...