Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Cara ainda bem que eu aprendi sobre arrays hj, porque se não, não ia dar para criar um script menos que este! auehaueh

 

os códigos estão no pastebin!

 

Xml: 

 

http://pastebin.com/k6vgYj1H

 

Código:

 

http://pastebin.com/X49X7w4q

 

Eu não testei... mas caso dê erro me informe aqui no chat!

wq3bBzt.png
Pokémon Dust Evolution
 
É aonde começa sua nova aventura!! 

 

Facebook

 
Verifique Atualizações

 

  • Respostas 8
  • Visualizações 853
  • Created
  • Última resposta

Top Posters In This Topic

Postado

O arquivo .xml é com você.

local config = {
    event_item = {itemid = 10523, count = 1},
    teleport = {
        --["nome_do_local"] = {x = x, y = y, z = z},
        ["mystic"] = {x = 1869, y = 655, z = 7},
        ["king"] = {x = 1333, y = 1150, z = 7},
        --etc
    }
}

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
    msg = msg:lower()
    if msgcontains(msg, "teleport") then
        local str = ""
        for place, _ in pairs(config.teleport) do
            if str == "" then
                str = place
            else
                str = str..", "..place
            end
        end
        selfSay("To teleport, you need "..config.event_item.count.."x "..getItemNameById(config.event_item.itemid)..". Then, you must tell me the place you wanna go. Options are: "..str..".")
        talkState[talkUser] = 1
    elseif talkState[talkUser] == 1 then
        local place = config.teleport[msg]
        if not place then
            selfSay("This place doesn't exist or I can't take you there.")
            talkState[talkUser] = 0
            return true
        elseif not doPlayerRemoveItem(cid, config.event_item.itemid, config.event_item.count) then
            selfSay("You do not have the necessary items.")
            talkState[talkUser] = 0
            return true
        end
        selfSay("Ok! Have a nice trip!")
        doTeleportThing(cid, place)
    end
    return true
end   
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())             

não respondo pms solicitando suporte em programação/scripting

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 519.7k

Informação Importante

Confirmação de Termo