Ir para conteúdo

Bodak Reborn

Membro
  • Registro em

  • Última visita

Tudo que Bodak Reborn postou

  1. Explique melhor. É de tempo em tempo? Quanto? É um tile? É ao passar pelo tile? Adiciona quanto de stamina?
  2. Lembre-se de fazer as novas configurações no config. local config = { newPos = {x = 1049, y = 1558, z = 7}, -- posição para onde os jogadores irão. tpPos = {x = 1050, y = 1558, z = 7}, -- posição onde será criado o teleporte. exhaust = 5, -- tempo em segundos para poder usar a skill novamente. Recomendo ser maior que o backTime. backTime = 4, -- tempo em segundos para voltar para de onde usou a skill. target = getCreatureTarget(cid), storage = 115820, } function doMarkPos(cid, posx, posy, posz) setPlayerStorageValue(cid, 19000, posx) setPlayerStorageValue(cid, 19001, posy) setPlayerStorageValue(cid, 19002, posz) end function getMarkPos(cid) return {x=getPlayerStorageValue(cid, 19000), y=getPlayerStorageValue(cid, 19001), z=getPlayerStorageValue(cid, 19002)} end function tpBack() doTeleportThing (cid, getMarkPos(cid)) doTeleportThing (target, getMarkPos(cid)) end local pos = getCreaturePosition(cid) if getMarkPos(cid).x > 0 then doMarkPos(cid, pos.x, pos.y, pos.z) end function onCastSpell(cid, var) if getPlayerStorageValue(cid, config.storage) < os.time() then if isPlayer(target) then return true end -- Teste para ver se some o bug caso tente usar a skill sem target, se der erro no código, remova essa linha. if getMarkPos(cid).x > 0 then doTeleportThing(cid, config.newPos) doTeleportThing(target, config.newPos) setPlayerStorageValue(cid, config.storage, config.exhaust + os.time()) addEvent(tpBack, config.backTime * 1000) end else doPlayerSendCancel(cid, "You are exhausted") end return true end
  3. Achei o erro. O TP criado não é removido, logo, pega a primeira posição que você usou e te teleporta pra lá (a primeira vez que você usou a skill). O que eu posso fazer é, ao passar x segundos, os jogadores voltarão para onde estavam.
  4. E não tá funcionando? O que acontece quando entra no tp?
  5. Você testou? Está funcionando? Se não tiver, tente esse:
  6. O getCreatureTarget é porque você não deu target, já faço algo pra prevenir esse erro Testa assim e me diz quais números aparecem no console e se dá algum erro ao tentar entrar no teleport
  7. Remova o movements. O script que eu passei, bote no mesmo lugar dos testes que eu pedi para você fazer.
  8. Só para confirmar, você está SEM o script de movements, SEM o XML e com esse script: function doMarkPos(cid, posx, posy, posz) setPlayerStorageValue(cid, 19000, posx) setPlayerStorageValue(cid, 19001, posy) setPlayerStorageValue(cid, 19002, posz) end function getMarkPos(cid) return {x=getPlayerStorageValue(cid, 19000), y=getPlayerStorageValue(cid, 19001), z=getPlayerStorageValue(cid, 19002)} end local config = { newPos = {x = 1019, y = 1555, z = 7}, -- posição para onde os jogadores irão. tpPos = {x = 1050, y = 1560, z = 7}, -- posição onde será criado o teleporte. exhaust = 0.8, target = getCreatureTarget(cid), storage = 115820, } function onCastSpell(cid, var) local pos = getCreaturePosition(cid) if getMarkPos(cid).x < 1 then doMarkPos(cid, pos.x, pos.y, pos.z) end if getPlayerStorageValue(cid, config.exhaust) < os.time() then if getMarkPos(cid).x > 0 then doCreateTeleport(1387, getMarkPos(cid), config.tpPos) doTeleportThing(cid, config.newPos) setPlayerStorageValue(cid, config.storage, config.exhaust + os.time()) end else doPlayerSendCancel(cid, "You are exhausted") end return true end Certo? Só para testar, use esse script e me diga o que aparece no console:
  9. O_O Tenta usar a skill longe de onde você tá e me diz se apareceu no mesmo lugar
  10. Eles aparecem muito longe do local?
  11. Isso com o movements ou sem?
  12. Troque doTeleportThing (cid, getMarkPos) por doTeleportThing (cid, getMarkPos) Se não funcionar, remova a tag do movements e teste. Se funcionar, me avise para eu recolocar as funções no comentário.
  13. Esse erro ocorre quando você usa a skill ou quando entra no teleport?
  14. Imaginei... Acho que só da para fazer no creaturescripts, por comando eu não faço ideia. Qualquer coisa, eu te aviso.
  15. Você deu target no player?
  16. Lol, eu botei "exaust", não "exhaust". E no config coloquei "exahaust". Arrumei o código.
  17. Pronto. Testa de novo.
  18. Tinha esquecido do (cid), corrigi.
  19. Funcionou?
  20. Np. =) function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end if param == "on" then setPlayerStorageValue(cid, 46549875, -1) doPlayerSendTextMessage(cid, 27, 'Você habilitou seu PVP.') end if param == "off" then setPlayerStorageValue(cid, 46549875, 1) doPlayerSendTextMessage(cid, 27, 'Você desabilitou seu PVP.') end function onCombat (cid, target) if getPlayerStoragevalue(cid, 46549875) == 1 then if isPlayer(target) then doPlayerSendCancel(cid, "Não é permitido atacar outros jogadores.") return false end else doPlayerSendCancel(cid, "Permitido atacar outros jogadores.") end return true end return true end
  21. Ops, corrigi de novo, falta de atenção. Espero que funcione agora.
  22. !pvp nome do player talkactions/scripts nome_arquivo.lua function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end local pid = getPlayerByNameWildcard(param) if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.") return true end if getPlayerStorageValue(pid, 46549875) >= 1 then setPlayerStorageValue(pid, 46549875, -1) doPlayerSendTextMessage(cid, 27, 'Você habilitou o PVP para o player '..param..'.') else setPlayerStorageValue(pid, 46549875, 1) doPlayerSendTextMessage(cid, 27, 'Você desabilitou o PVP para o player '..param..'.') end function onCombat (cid, target) if getPlayerStoragevalue(pid, 46549875) == 1 then if isPlayer(target) then doPlayerSendCancel(cid, "Não permitido atacar outros players.") return false end else doPlayerSendCancel(cid, "Permitido atacar outros players.") end return true end return true end talkactions.xml <talkaction log="yes" words="!pvp" access="4" event="script" value="nome_arquivo.lua"/>
  23. Não, é no script. Tenta de novo lá.

Informação Importante

Confirmação de Termo