Postado Setembro 16, 2014 10 anos gostaria de um script simples acho quando atingir lvl 60 teleporta automaticamente templo! pq isso pq quando cria conta quando loga fiz pra nascer numas hunt de iniciante upar até lvl 60 QUEM poder ajuda ae pf
Postado Setembro 16, 2014 10 anos Não acha melhor colocar um NPC? Caso queira um NPC, me passe a posição que o jogar vai ser teleportado. Caso você queira por npc Função do npc: Teleportar o player para posição(configuravel), ele so vai teleportar se o player tiver lv 60 ou mais. Crie um arquivo chamado James.lua na pasta data/npc/scripts e cole isso 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 local cfg = { toPos = {x=32097, y=32297, z=7}, -- Posição que o jogador sera teleportado level = 60, -- Level necessário para ser teleportado price = 0 -- Dinheiro a ser cobrado para ser teleportado } 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, 'sim') then selfSay(' Ola , voce deseja mesmo sair deste lugar ?', cid) talkState[talkUser] = 1 elseif talkState[talkUser] == 1 then if msgcontains(msg, 'yes') then if getPlayerLevel(cid) >= cfg.level then if doPlayerRemoveMoney(cid, cfg.price) then doTeleportThing(cid, cfg.toPos) talkState[talkUser] = 0 else selfSay('You don\'t have enough money.', cid) end else selfSay('You need level having above '.. cfg.level ..'.', cid) end elseif msgcontains(msg, 'no') then selfSay('Skirt here!', cid) end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Crie um arquivo chamado NpcJames.xml na pasta data/npc e cole isso <?xml version="1.0" encoding="UTF-8"?> <npc name="James" script="data/npc/scripts/James.lua" walkinterval="25" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="128" head="114" body="12" legs="57" feet="114" addons="0" /> <parameters> <parameter key="message_greet" value="Ola, |PLAYERNAME|! voce deseja mesmo sair deste lugar ?"/> <parameter key="message_walkaway" value="Hey Hey, where you go ?"/> <parameter key="message_farewell" value="Bye bye!"/> </parameters> </npc> A Parte em vermelho e onde você configura a posição. Que no seu caso é o templo Editado Setembro 16, 2014 10 anos por arthurabreu (veja o histórico de edições) I helped you ? REP +. Att: Abreu
Postado Setembro 17, 2014 10 anos Autor olha man brigado por responder mais gostaria que fosse teleportado automaticamente sem npc seja sozinho possível fazer script ou é m foda alguém ajuda ae!!
Postado Setembro 18, 2014 10 anos O tópico foi movido para a área correta, preste mais atenção da próxima vez! Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680 Este tópico foi movido: De: "OTServ → Scripting → Sistemas e MODs" Para: "OTServ → Suporte OTServ → Suporte de Scripts" Ot Design: https://discord.gg/VgtVRNmCD7
Postado Setembro 18, 2014 10 anos Tentei fazer aqui, se funcionar... --script by HenriqueGB function onAdvance(cid, skill, oldLevel, newLevel) pos = {x=XXXX, y=YYYY, z=Z} -- Aqui você coloca a position do lugar if getPlayerLevel(cid) ~= 60 then return true end if getPlayerLevel(cid) == 60 then doTeleportThing(cid, pos) doSendMagicEffect(getCreaturePosition(cid),53) doSendAnimatedText(getCreaturePosition(cid), "Você foi teleportado", TEXTCOLOR_LIGHTGREEN) return true end end pelo menos no script live, não apontou erros... Obs: mecho a pouco tempo, grandes chances de estar não funcional.
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.