Apaga as linhas:
if getPlayerPremiumDays(cid) > 0 then
E depois essa:
else
selfSay("Need be premium to buy this Outfit.", cid)
talkState[talkUser] = 0
return false
end
Por MaxxSilva, 06 de dez. de 2013 em Tópicos Sem Resposta
Apaga as linhas:
if getPlayerPremiumDays(cid) > 0 then
E depois essa:
else
selfSay("Need be premium to buy this Outfit.", cid)
talkState[talkUser] = 0
return false
end
[07/12/2013 01:50:42] [Error - LuaScriptInterface::loadFile] data/npc/scripts/clothes.lua:77: 'end' expected (to close 'if' at line 64) near 'else'
[07/12/2013 01:50:42] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/clothes.lua
[07/12/2013 01:50:42] data/npc/scripts/clothes.lua:77: 'end' expected (to close 'if' at line 64) near 'else'
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 v1.8 \/ peguem ele todo!
local outs = {
["jamaican"] = {181601},
["rapper"] = {181602},
["oriental"] = {181603},
["adventurer"] = {181605},
["bussines"] = {181606},
["atletic"] = {181607},
["punk"] = {181608},
["mercenary"] = {181610},
["hiker"] = {181611},
["assassin"] = {181654, 10}, --10 eh qnts diamonds vai pedir...
}
msg = string.lower(msg)
local diamond = 2145 --id dos diamonds
if (msgcontains(msg, 'outfit') or msgcontains(msg, 'outfits')) then
selfSay("I sell this outfits: {Jamaican, Rapper, Oriental, Adventurer, Bussines, Atletic, Punk, Mercenary, Hiker and Assassin}, which outfit do you want??", cid)
talkState[talkUser] = 2
elseif outs[msg] and talkState[talkUser] == 2 then
selfSay("Are you sure which want buy that outfit?", cid)
outfit = outs[tostring(msg)]
talkState[talkUser] = 3
elseif msgcontains(msg, 'yes') and talkState[talkUser] == 3 then
if getPlayerStorageValue(cid, outfit[1]) <= 0 then
if outfit[2] then
if doPlayerRemoveItem(cid, diamond, outfit[2]) then
setPlayerStorageValue(cid, outfit[1], 1)
else
selfSay("You need ".. outfit[2] .." diamonds to buy this outfit!", cid)
talkState[talkUser] = 0
return false
end
else
if getPlayerMoney(cid) >= 20000 then
doPlayerRemoveMoney(cid, 20000)
setPlayerStorageValue(cid, outfit[1], 1)
else
selfSay("You need 200dl to buy this outfit!", cid)
talkState[talkUser] = 0
return false
end
end
else
selfSay("You already have this outfit, so please, choose another outfit...", cid)
talkState[talkUser] = 0
return false
end
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
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
boaaa
REP+ pra ti
info
Grupo: Herói
Registrado: 12/06/12
Posts: 2.2k
Reputação: +739
Gênero: Masculino
Char no Tibia: Supreme Player

Tópico movido para a seção de dúvidas e pedidos resolvidos.
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

info
Grupo: Visconde
Registrado: 08/06/13
Posts: 274
Reputação: +13
Eu coloquei este npc de outfit http://www.xtibia.com/forum/topic/210035-script-npc-outfit/ do slicer funcionou 100% mas queria tirar uma coisa , tipo quando o player nao é vip ele nao da o outfit queria tirar isso alguem sabe qual parte eu tiro? Rep++