Postado Abril 17, 2015 10 anos Estou precisando de uma ajuda, Estou querendo um script de um npc que leva um player para uma quest (esse player so pode usar 1 vez e ter lvl 4000) exemplo:hi,quest,yes up
Postado Abril 17, 2015 10 anos Em "Data/npc/scripts" copie e cole um arquivo.LUA, renomeie para tpz.lua, apague tudo e cole isso: local t = { level = 8, -- Level necessário. pos = {x = 160, y = 54, z = 7}, -- Local para teleportar storage = 53222 -- Só mexa se necessário. } 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 msg = msg:lower(); local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'quest') then if getPlayerLevel(cid) >= t.level then if getPlayerStorageValue(cid, t.storage) <= 0 then talkState[talkUser] = 2 selfSay('Tem certeza disso?', cid) else return selfSay('Você já fez esta quest.', cid) end else return selfSay('Você precisa de level '..t.level..' para fazer esta quest.', cid) end elseif msgcontains(msg, 'yes') then if talkState[talkUser] == 2 then doTeleportThing(cid, t.pos) setPlayerStorageValue(cid, t.storage, 1) return selfSay('Boa sorte.', cid) end elseif msgcontains(msg, 'no') then if talkState[talkUser] == 2 then talkState[talkUser] = 0 return selfSay('Ok...', cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Vá em "Data/npc" copie e cole um arquivo.XML, renomeie para teleporter.xml, apague tudo e cole isso: <?xml version="1.0" encoding="UTF-8"?> <npc name="Teleporter" script="data/npc/scripts/tpz.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="138" head="57" body="59" legs="40" feet="76" addons="0"/> <parameters> <parameter key="message_greet" value="Olá |PLAYERNAME|. Deseja fazer a {quest}?"/> </parameters> </npc> ➥ Regras | Seções OTServ | Seções BOT
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.