Ir para conteúdo
  • 0

Usar Item e efeito de texto (pontinhos) saindo do personagem


gahell

Pergunta

Boa noite estou montando um servidor e me deparei com um problema ao adicionar um script.

o meu servidor é um OTX Mapa Global 11.49

 

O script é o seguinte:

 

ao usar um anel ( id 7708 ) vai sair um efeito de texto do personagem igual a imagem abaixo:

effect.png.d011161b086a7cf8393aa2d4c44b739a.png.d83205dbb1675c27e95982ffc25cfbfe.png

 

Fui em movements\scripts e criei o arquivo transcedenciaitem.lua e dentro dele coloquei:

local table = {
itemNeed = 7708, -- Mesmo id do itemid que você colocou na tag xml.
txt = {"´ .    ,", ".    ´ ,", "`  .  ,", ",    ` ."}, -- Texto que vai sair.
delay = 1000, -- Tempo que vai ficar saindo
cor = {26, 30, 31, 32}, -- Cor do texto que vai sair.
effect = 3 -- Efeito que vai sair(aura).
}

function doPlayerLoopEff(cid)
 if isPlayer(cid) and getPlayerSlotItem(cid, CONST_SLOT_RING).itemid == table.itemNeed then
  doSendMagicEffect(getThingPos(cid), table.effect)
  doSendAnimatedText(getThingPos(cid), table.txt[math.random(#table.txt)], table.cor[math.random(#table.cor)])
  addEvent(function() doPlayerLoopEff(cid) end, table.delay) -- 1000 é o delay que vai sair o efeito e o texto.
 end 
end


function onEquip(cid, item, slot)
 doPlayerLoopEff(cid)
 return true
end

 

depois fui no movements.xml e adicionei a linha: 

<movevent event="Equip" itemid="7708" slot="ring" script="transcedenciaitem.lua"/>

 salvei tudo e iniciei o server... Não deu nenhum erro...

mas, quando coloquei o ring no slot de anel do personagem, ficou só fazendo o efeito que no caso ali configurei o efeito 3 e no prompt apareceu esse erro:

 

ScreenShot_20190105231006.thumb.png.27398ffa5d95010e8ff0534caf7d0f48.png

 

estou a horas pesquisando e tudo que descobri e que nos servidores mais novos o comando doSendAnimatedText não é mais usado e mudou para um outro...

 

e eu nem quero o efeito 3 que ta ali no código só quero que fique saindo:

txt = {"´ .    ,", ".    ´ ,", "`  .  ,", ",    ` ."}, 

igual a imagem de exemplo ali do GOD.
 

Alguém me da esse Help Por favor!!

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0
  • Diretor

Tente dessa forma:

Spoiler

local table = {
itemNeed = 7708, -- Mesmo id do itemid que você colocou na tag xml.
txt = {"´ .    ,", ".    ´ ,", "`  .  ,", ",    ` ."}, -- Texto que vai sair.
delay = 1000, -- Tempo que vai ficar saindo
cor = {26, 30, 31, 32}, -- Cor do texto que vai sair.
effect = 3 -- Efeito que vai sair(aura).
}

function doPlayerLoopEff(cid)
 if isPlayer(cid) and getPlayerSlotItem(cid, CONST_SLOT_RING).itemid == table.itemNeed then
  doSendMagicEffect(getThingPos(cid), table.effect)
  doCreatureSay(getThingPos(cid), table.txt[math.random(#table.txt)], table.cor[math.random(#table.cor)])
  addEvent(function() doPlayerLoopEff(cid) end, table.delay) -- 1000 é o delay que vai sair o efeito e o texto.
 end 
end


function onEquip(cid, item, slot)
 doPlayerLoopEff(cid)
 return true
end

 

 

Ou assim:

Spoiler

local table = {
itemNeed = 7708, -- Mesmo id do itemid que você colocou na tag xml.
txt = {"´ .    ,", ".    ´ ,", "`  .  ,", ",    ` ."}, -- Texto que vai sair.
delay = 1000, -- Tempo que vai ficar saindo
cor = {26, 30, 31, 32}, -- Cor do texto que vai sair.
effect = 3 -- Efeito que vai sair(aura).
}

function doPlayerLoopEff(cid)
 if isPlayer(cid) and getPlayerSlotItem(cid, CONST_SLOT_RING).itemid == table.itemNeed then
  doSendMagicEffect(getThingPos(cid), table.effect)
  doPlayerSay(getThingPos(cid), table.txt[math.random(#table.txt)], table.cor[math.random(#table.cor)])
  addEvent(function() doPlayerLoopEff(cid) end, table.delay) -- 1000 é o delay que vai sair o efeito e o texto.
 end 
end


function onEquip(cid, item, slot)
 doPlayerLoopEff(cid)
 return true
end

 

 

Link para o comentário
Compartilhar em outros sites

  • 0
11 minutos atrás, Yan Liima disse:

Tente dessa forma:

  Mostrar conteúdo oculto


local table = {
itemNeed = 7708, -- Mesmo id do itemid que você colocou na tag xml.
txt = {"´ .    ,", ".    ´ ,", "`  .  ,", ",    ` ."}, -- Texto que vai sair.
delay = 1000, -- Tempo que vai ficar saindo
cor = {26, 30, 31, 32}, -- Cor do texto que vai sair.
effect = 3 -- Efeito que vai sair(aura).
}

function doPlayerLoopEff(cid)
 if isPlayer(cid) and getPlayerSlotItem(cid, CONST_SLOT_RING).itemid == table.itemNeed then
  doSendMagicEffect(getThingPos(cid), table.effect)
  doCreatureSay(getThingPos(cid), table.txt[math.random(#table.txt)], table.cor[math.random(#table.cor)])
  addEvent(function() doPlayerLoopEff(cid) end, table.delay) -- 1000 é o delay que vai sair o efeito e o texto.
 end 
end


function onEquip(cid, item, slot)
 doPlayerLoopEff(cid)
 return true
end

 

 

Ou assim:

  Mostrar conteúdo oculto


local table = {
itemNeed = 7708, -- Mesmo id do itemid que você colocou na tag xml.
txt = {"´ .    ,", ".    ´ ,", "`  .  ,", ",    ` ."}, -- Texto que vai sair.
delay = 1000, -- Tempo que vai ficar saindo
cor = {26, 30, 31, 32}, -- Cor do texto que vai sair.
effect = 3 -- Efeito que vai sair(aura).
}

function doPlayerLoopEff(cid)
 if isPlayer(cid) and getPlayerSlotItem(cid, CONST_SLOT_RING).itemid == table.itemNeed then
  doSendMagicEffect(getThingPos(cid), table.effect)
  doPlayerSay(getThingPos(cid), table.txt[math.random(#table.txt)], table.cor[math.random(#table.cor)])
  addEvent(function() doPlayerLoopEff(cid) end, table.delay) -- 1000 é o delay que vai sair o efeito e o texto.
 end 
end


function onEquip(cid, item, slot)
 doPlayerLoopEff(cid)
 return true
end

 

 

 

A primeira Opção eu coloquei e não apareceu mensagem de erro nenhuma no prompt, o efeito 3 saiu perfeito e constante, mais o efeito do texto:

txt = {"´ .    ,", ".    ´ ,", "`  .  ,", ",    ` ."}

Não saiu...

 

já a segunda opção eu coloquei e iniciou normalmente o server sem erro. Quando equipei o item o efeito 3 saiu apenas 1 vez e parou. No propt deu esse erro:

 

688391494_erro2.thumb.png.62c7a8351031075ad69f065e52582446.png

 

e o efeito texto que eu mais quero nao apareceu nada novamente rs' 

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...