Acho que vc pode tirar o os.time , pois o proprio script da vip vai retirar a storage quando a vip acabar , o npc soh precisara chegar se o player possui ela.
E acho que seria ">= 1 then".
tenta usar assim:
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) >= 1 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())




info
Grupo: Campones
Registrado: 14/08/06
Posts: 9
Reputação: 0
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!
Editado Julho 21 por big_headi