Postado Agosto 17, 2015 9 anos 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! Pokémon Dust Evolution É aonde começa sua nova aventura!! Facebook Verifique Atualizações
Postado Agosto 20, 2015 9 anos Como Assim?? Está dando erro ou algo assim? Pokémon Dust Evolution É aonde começa sua nova aventura!! Facebook Verifique Atualizações
Postado Agosto 20, 2015 9 anos 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.