erro
[02/02/2016 20:52:46] [Error - LuaScriptInterface::loadFile] data/npc/scripts/roupas.lua:45: 'then' expected near 'selfSay'
[02/02/2016 20:52:46] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/roupas.lua
[02/02/2016 20:52:46] data/npc/scripts/roupas.lua:45: 'then' expected near 'selfSay'
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
--alterado v2.8 \/ peguem ele todo!
local outs = {
["picachu"] = {66565},
}
quant = 300
item = 5911
msg = string.lower(msg)
if (msgcontains(msg, 'outfit') or msgcontains(msg, 'outfits')) then
selfSay("I sell this outfits: {NOME}??", cid)
talkState[talkUser] = 2
elseif outs[msg] and talkState[talkUser] == 2 then
selfSay("Are you sure which want trade item for that outfit?", cid)
outfit = outs[tostring(msg)]
talkState[talkUser] = 3
elseif msgcontains(msg, 'yes') and talkState[talkUser] == 3 then
if doPlayerRemoveItem(cid, item, quant)then
doPlayerRemoveItem(cid, item, quant)
setPlayerStorageValue(cid, outs[1], 1)
else
selfSay("You need "..quant.."x "..getItemNameById(item).." to get this outfit!", cid)
talkState[talkUser] = 0
return false
end
else
selfSay("You already have this outfit, so please, choose another outfit...", cid)
talkState[talkUser] = 0
return false
selfSay("So... Here is.", cid)
talkState[talkUser] = 0
return true
elseif msgcontains(msg, 'no') and talkState[talkUser] == 3 then
selfSay("So... Please choose another outfit...", cid)
talkState[talkUser] = 0
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())