Olá!
Estou com problemas para fazer viagens para cidades VIP, ou seja, o npc somente poderá transportar personagens VIP.
Fiz um NPC novo com os seguintes códigos:
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, 'vip city') then
if getPlayerStorageValue(cid, 55555) - os.time() >= 0 then
doTeleportThing(cid, {x=31932,y=31931,z=6})
else
selfSay('Você não possui VIP. Adquira agora.', cid)
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
O NPC fala que o player não possui VIP, mesmo possuindo.
Vale a pena usa-lo ou aproveitar os npc's que ja estao nos barcos?
Obrigado!







