queria script de um npc que teleporta se o player tiver lvl 20 so lvl 20 nao maior nen manor!
agradeço (:
queria script de um npc que teleporta se o player tiver lvl 20 so lvl 20 nao maior nen manor!
agradeço (:
Vai em data/npc/scripts, duplica um arquivo nomeio para "teleport" sem as aspas e cole:
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local pos = {x=966, y=1029, z=7} local efectTel = 28 -- efeito do teleport 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, 'yes') and getPlayerLevel(cid) == 20) then doTeleportThing(cid, pos) doSendMagicEffect(pos, efectTel) return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Agora, data/npc, duplica um arquivo desses e nomei-a para "nome do npc", abra-o e cole:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="nome do npc" script="teleport.lua" walkinterval="2000" floorchange="0">
<health now="999999" max="999999"/>
<look type="300" corpse="2212"/>
<parameters>
<parameter key="message_greet" value="Você quer ser teleportado?."/>
</parameters>
</npc>
Em vermelho ta as partes que vc deve mudar!
Te ajudei. Então REP+
Meus Trabalhos:
O melhor pokebot!
@Jhon992
Não dá pra mudar a cor de um código.
Coloca quote ou tira as partes das cores, porque senão vai bugar
ex:
<look type="[color=#ff0000]300[/color]" corpse="2212"/>
tá assim /\
coloca assim:
<look type="300" corpse="2212"/>
Vlw pela dica, @JeDiAN + esses quotes são contra min, ficava dando que não era possivel pq a quantidade de quotes abertos era diferente das de fechado dae dechei assim msm. sahdua
Vlw aew.
Te ajudei. Então REP+
Meus Trabalhos:
O melhor pokebot!
Nuss manin Valew Pela Ajuda, Me Ajudou Muito, Vlw Aew Rep+
amigo teria como colocar para o npc fala uma mensagen pro player caso ele nao esteja lvl 20?
tipo assim
Player -- hi
Npc -- voce quer mesmo ser teleportado?
Player -- yes
Npc -- se o player nao tiver lvl 20 ele irar falar esta mensagen -- volte quando estiver lvl 20
se ele ja estiver lvl 20 ele sera teleportado. agradeço pela ajuda (: rep+
<?xml version="1.0"?> <npc name="NOME DO SEU NPC" script="data/npc/scripts/NOME DO SEU ARQUIVO.lua" walkinterval="5000" floorchange="0"> <health now="100" max="100"/> <look type="143" head="78" body="88" legs="0" feet="88" addons="3"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|. você quer mesmo ser teleportado? {yes}" /> </parameters> </npc>
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 pos = {x=966, y=1029, z=7} if msgcontains(msg, 'yes') and getPlayerLevel(cid) == 20 then doTeleportThing(cid, pos) doSendMagicEffect(pos, 28) else selfSay("desculpe,volte quando estiver lvl 20", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end if msg == "no" then selfSay("Then not", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Gente , e se tipo nao precisa de level pra ser teleportado por este npc , ou seja , qualqer um pode , como ficaria o script ?