Ir para conteúdo

Featured Replies

Postado

Estou tentando adaptar o script de subir texto animados do chão pra versa TSF 1.3 - revscript.

mas estou tendo um problema em oque colocar nessa parte do script:

local positions = {
        { x = 32365, y = 32236, z = 7 },

}
local textoEvent = GlobalEvent("textoEvent") 
 
function textoEvent.onThink(interval)
	for i = 1, #positions do
		Position(positions[i]):doSendAnimatedText ...????? --------- ESSA LINHA  *******              
	end
	return true
end

textoEvent:interval(50)
textoEvent:register()
 

 

Não sei se estou no caminho certo, então se alguem que manja ai puder me dar um help, agradeço!

 

Postado
Em 09/04/2021 em 22:16, miguelprojac disse:

Estou tentando adaptar o script de subir texto animados do chão pra versa TSF 1.3 - revscript.

mas estou tendo um problema em oque colocar nessa parte do script:



local positions = {
        { x = 32365, y = 32236, z = 7 },

}
local textoEvent = GlobalEvent("textoEvent") 
 
function textoEvent.onThink(interval)
	for i = 1, #positions do
		Position(positions[i]):doSendAnimatedText ...????? --------- ESSA LINHA  *******              
	end
	return true
end

textoEvent:interval(50)
textoEvent:register()
 

 

Não sei se estou no caminho certo, então se alguem que manja ai puder me dar um help, agradeço!

 

Está no caminho certo  porém na tfs1.3 não possui doSendAnimatedText, você vai precisar usar parecido a isso aqui:
 

function onThink(interval)

    local effects = {

        --[[

            Exemplos:

            {position = Position(986, 1216, 7), effect = 29}, **Somente Effect**

            {position = Position(1622, 1458, 7), text = "[Teste]", effect = 40, say = true, color = math.random(1,255)}, **say ativo é fala estilo monstro**

            {position = Position(1622, 1458, 7), text = "[1SET]", say = false, color = math.random(1,255)}, **say desativado, é levado color em consideração**

        ]]

}

 

    for i = 1, #effects do

        local settings = effects[i]

        local spectators = Game.getSpectators(settings.position, false, true, 7, 7, 5, 5)

        if #spectators > 0 then

            if settings.text then

                for i = 1, #spectators do

                    if settings.say then

                        spectators[i]:say(settings.text, TALKTYPE_MONSTER_SAY, false, spectators[i], settings.position)

                    else

                        Game.sendAnimatedText(settings.text, settings.position, settings.color)

                    end

                end

            end

            if settings.effect then

                settings.position:sendMagicEffect(settings.effect)

            end

        end

    end

   return true

end

Editado por Marvok (veja o histórico de edições)

Contatos:

Discord: Marvok#9855

 

Postado
  • Autor

@Marvok Muito obrigado mano.. consegui adaptar :)

 

Ficou assim:

 

local effects = {
    {position = Position(32365, 32236, 7), text = 'Trainers'}

  }

local textoEvent = GlobalEvent("textoEvent")

function textoEvent.onThink(interval)
    for i = 1, #effects do
        local settings = effects[i]
        local spectators = Game.getSpectators(settings.position, false, true, 7, 7, 5, 5)
        if #spectators > 0 then
            if settings.text then
                for i = 1, #spectators do
                    spectators[i]:say(settings.text, TALKTYPE_MONSTER_SAY, false, spectators[i], settings.position)
                end
            end
            if settings.effect then
                settings.position:sendMagicEffect(settings.effect)
            end
        end
    end
   return true
end

textoEvent:interval(3500)
textoEvent:register()

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo