Tire o end da linha 58 do seu código, tem um end antes da hora hehe.
6
1.2k
07 de agosto de 2012 às 08:05
info
Grupo: Artesão
Registrado: 10/11/11
Posts: 118
Reputação: +2

07 de agosto de 2012 às 12:06
como fico?XD
07 de agosto de 2012 às 13:40
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())
info
Grupo: Artesão
Registrado: 10/11/11
Posts: 118
Reputação: +2

07 de agosto de 2012 às 19:33
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
info
Grupo: Conde
Registrado: 04/08/12
Posts: 762
Reputação: +80

07 de agosto de 2012 às 19:36
O script que deve estar errado.





info
Grupo: Artesão
Registrado: 10/11/11
Posts: 118
Reputação: +2
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
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())