Ir para conteúdo

Posts Recomendados

Olá galera, hoje eu vou trazer um script simples, que é o sistema de turn do PxG. É igual a ele, e ainda tem DUAS maneiras de fazer seu poke virar. Bom adicione essas tags no talkactions.xml do seu server:

 

<talkaction words="tn" case-sensitive="no" hide="yes" event="script" value="turnsystem.lua"/>
<talkaction words="t1" case-sensitive="no" hide="yes" event="script" value="turnsystem.lua"/>
<talkaction words="tl" case-sensitive="no" hide="yes" event="script" value="turnsystem.lua"/>
<talkaction words="t2" case-sensitive="no" hide="yes" event="script" value="turnsystem.lua"/>
<talkaction words="ts" case-sensitive="no" hide="yes" event="script" value="turnsystem.lua"/>
<talkaction words="t3" case-sensitive="no" hide="yes" event="script" value="turnsystem.lua"/>
<talkaction words="to" case-sensitive="no" hide="yes" event="script" value="turnsystem.lua"/>
<talkaction words="t4" case-sensitive="no" hide="yes" event="script" value="turnsystem.lua"/>

 

depois Crie um arquivo.lua em data/talkactions/script Chamado turnsystem e Cole isso dentro dele!

 

local dirs = {

["tl"] = {dir = 1, dire = "leste"},

["t2"] = {dir = 1, dire = "leste"},

["tn"] = {dir = 0, dire = "norte"},

["t1"] = {dir = 0, dire = "norte"},

["ts"] = {dir = 2, dire = "sul"},

["t3"] = {dir = 2, dire = "sul"},

["to"] = {dir = 3, dire = "oeste"},

["t4"] = {dir = 3, dire = "oeste"},

}

function onSay(cid, words, param)

if param ~= "" then

return false

end

if #getCreatureSummons(cid) == 0 then

return false

end

local function doTurn(cid, dir)

if not isCreature(cid) then return true end

if #getCreatureSummons(cid) == 0 then

return true

end

if getCreatureSpeed(getCreatureSummons(cid)[1]) == 0 then

doChangeSpeed(getCreatureSummons(cid)[1], 1)

doCreatureSetLookDir(getCreatureSummons(cid)[1], dirs[words].dir)

doChangeSpeed(getCreatureSummons(cid)[1], -1)

else

doCreatureSetLookDir(getCreatureSummons(cid)[1], dirs[words].dir)

end

end

addEvent(doTurn, 200, cid, dir)

doCreatureSay(cid, ""..getCreatureName(getCreatureSummons(cid)[1])..", vire para o "..dirs[words].dire.."!", TALKTYPE_SAY)

return true

end

 

 

Bom, aqui vai a lista dos comandos:

 

tn ou t1 - virar para o norte (cima)

tl ou t2 - virar para o leste (direita)

ts ou t3 - virar para o sul (baixo)

to ou t4 - virar para o oeste (esquerda)

 

 

Só isso galera Se Estiver com Duvidas Responda ao Topico!

Creditos!: Aott

 

D2hcd.png

Editado por Gabrieltxu
Link para o comentário
https://xtibia.com/forum/topic/205988-talkaction-sistema-turn-do-pxg-t1-t2-t3-t4/
Compartilhar em outros sites

×
×
  • Criar Novo...