Try this...
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
local price = 80000000
if msgcontains(msg, 'hi') then
selfSay("You want to be promoted? Say 'promotion' or 'vip promotion'?", cid)
elseif msgcontains(msg, 'promotion') or msgcontains(msg, 'vip promotion') then
selfSay('You want to be promoted vip for 80000000 gold coins?', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if (getPlayerPromotionLevel(cid) < 2 and getPlayerLevel(cid)) >= 750 then
if getPlayerPromotionLevel(cid,1) == TRUE then
doPlayerRemoveMoney(cid, price)
setPlayerPromotionLevel(cid, 2)
selfSay('Congratulations! You were promoted vip! good bye!', cid)
else
selfSay('You don't have the member promotion, or you dont have 80000000 gold coins to be promoted vip, good bye...', cid)
end
else
selfSay("You are already promoted vip, or not have level 750 to be promoted vip, good bye...", cid)
end
talkState[talkUser] = 0
elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then
talkState[talkUser] = 0
selfSay('Good bye.', cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())






info
Grupo: Campones
Registrado: 04/01/09
Posts: 57
Reputação: +1
Gênero: Masculino
ow fico assim :
mais o npc n aparece denovo quando eu tento summona ele com o god e aparece essa mensagem no exe :