Ir para conteúdo

Featured Replies

Postado

OLA GALERA DO TK....

 

TIPOW PRECISO DE UM NPC QUE SO TELEPORTE O PLAYER SE ELE TIVER TICKET ID: 1954

TENTEI FAZER AQUI MAIS NÃO DEU CERTO...

 

 

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 vip = isVip(cid)
 
local cfg = {
    arte = {x = 1010, y = 1198, z = 6},      
    egeu = {x = 1441, y = 1059, z = 6},      
    horp = {x = 1054, y = 428, z = 6},      
    styg = {x = 595, y = 1620, z = 6},      
    niss = {x = 532, y = 757, z = 6},      
    vale = {x = 398, y = 990, z = 6},      
    kypr = {x = 1383, y = 527, z = 6},      
    id_item = 1954,
}
       
    if msgcontains(msg, 'viajem') or msgcontains(msg, 'viajar') then
        selfSay("Então, para viajar diga {yes}! Para isso, você deve possuir Ticket!", cid)
        talkState[talkUser] = 1
        return true
    elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
        if isVip(cid) == TRUE then
            selfSay("Certo. Para onde você deseja ir? Para {artemisias} {Egeu} {Horpus} {Styge} {Nissea} {valentia} ou {Kypros}", cid)
            talkState[talkUser] = 2
            return true
        else
            selfSay("Você não possui ticket volte ao Athan e compre!", cid)
            talkState[talkUser] = 0
            return true
        end
    elseif msgcontains(msg, 'no') and talkState[talkUser] == 1 then
        selfSay("Tudo bem então...", cid)
        talkState[talkUser] = 2
        return true
    elseif msgcontains(msg, 'artemisias') and talkState[talkUser] == 2 then
        selfSay("Boa viagem!", cid)
        doTeleportThing(cid, cfg.arte)
        talkState[talkUser] = 0
        return true
    elseif msgcontains(msg, 'Egeu') and talkState[talkUser] == 2 then
        selfSay("Boa viagem!", cid)
        doTeleportThing(cid, cfg.egeu)
        talkState[talkUser] = 0
        return true
    elseif msgcontains(msg, 'Horpus') and talkState[talkUser] == 2 then
        selfSay("Boa viagem!", cid)
        doTeleportThing(cid, cfg.horp)
        talkState[talkUser] = 0
        return true
    elseif msgcontains(msg, 'Styge') and talkState[talkUser] == 2 then
        selfSay("Boa viagem!", cid)
        doTeleportThing(cid, cfg.styg)
        talkState[talkUser] = 0
        return true
    elseif msgcontains(msg, 'Nissea') and talkState[talkUser] == 2 then
        selfSay("Boa viagem!", cid)
        doTeleportThing(cid, cfg.niss)
        talkState[talkUser] = 0
        return true
    elseif msgcontains(msg, 'Valentia') and talkState[talkUser] == 2 then
        selfSay("Boa viagem!", cid)
        doTeleportThing(cid, cfg.vale)
        talkState[talkUser] = 0
        return true
    elseif msgcontains(msg, 'Kypros') and talkState[talkUser] == 2 then
        selfSay("Boa viagem!", cid)
        doTeleportThing(cid, cfg.kypr)
        talkState[talkUser] = 0
        return true
    end          
    return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 520.1k

Informação Importante

Confirmação de Termo