• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ TFS 1.3* downgrade protocol 8.6, how add animatext? words and numbers

Eduardo170

Well-Known Member
Joined
Jan 7, 2014
Messages
422
Solutions
3
Reaction score
66
Location
Caracas, Venezuela
I have TFS 1.3* downgrade protocol 8.6, its possible add animatext like words?. In tibia client 8.6 this work with TFS 0.4.
I understand that it only works with numbers, or something like that.
 
Last edited:
Solution
Change this:
Lua:
doSendAnimatedText("VIP", t, c)
doSendAnimatedText("STAFF", t, c)
For this:
Lua:
Game.sendAnimatedText("VIP", t, c)
Game.sendAnimatedText("STAFF", t, c)
what do you want to do, cause I cant actually understand, this engine has animated text integrated in it.
I have this scripT
Code:
local colors = {5,30,35,95,108,129,143,155,180,198,210,215} -- You can add more colors.
function onThink(interval)
    for _, player in ipairs(Game.getPlayers()) do
        if player:getGroup():getAccess() then
            if player:isInGhostMode() then
                return true
            else
                local c = math.random(#colors)
                doSendAnimatedText("STAFF", t, c)
            end
            return true
        end
        local t = player:getPosition()
        if player:isVip() then
            local c = math.random(#colors)
            doSendAnimatedText("VIP", t, c)
        end
    end
    return true
end
Code:
Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/vipF.lua:onThink
LuaScriptInterface::luaDebugPrint(). Deprecated function.
stack traceback:
        [C]: in function 'debugPrint'
        data/lib/compat/compat.lua:604: in function 'doSendAnimatedText'
        data/globalevents/scripts/vipF.lua:9: in function <data/globalevents/scripts/vipF.lua:2>


And how I add to this script?,
Code:
local effects = {
    {position = Position(999, 992, 7), text = 'Spawns', effect = CONST_ME_GIANTICE},
    {position = Position(1000, 992, 7), text = 'Quests', effect = CONST_ME_FIREAREA},
    {position = Position(1001, 992, 7), text = 'Trainings', effect = CONST_ME_GROUNDSHAKER},
    {position = Position(998, 992, 7), text = 'Market', effect = CONST_ME_CAKE},
    {position = Position(979, 993, 7), text = 'City', effect = CONST_ME_FIREWORK_YELLOW},
    {position = Position(978, 1003, 7), text = 'Events', effect = CONST_ME_CRAPS},
    --2 floor.
    {position = Position(997, 993, 6), text = 'VIP', effect = CONST_ME_GIFT_WRAPS},

    {position = Position(997, 993, 7), text = 'Depot', effect = CONST_ME_HOLYDAMAGE, effect2 = CONST_ME_CRAPS},


    {position = Position(1001, 1001, 7), text = 'Start Exp', effect = CONST_ME_TUTORIALSQUARE, effect2 = CONST_ME_TUTORIALARROW},
}

function onThink(creature, 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
             if settings.effect2 then
                settings.position:sendMagicEffect(settings.effect2)
            end
        end
    end
   return true
end
 
Change this:
Lua:
doSendAnimatedText("VIP", t, c)
doSendAnimatedText("STAFF", t, c)
For this:
Lua:
Game.sendAnimatedText("VIP", t, c)
Game.sendAnimatedText("STAFF", t, c)
Thank you. I did.
Code:
--[[
TEXTCOLOR_BLACK = 0,
    TEXTCOLOR_BLUE = 5,
    TEXTCOLOR_GREEN = 18,
    TEXTCOLOR_LIGHTGREEN = 66,
    TEXTCOLOR_DARKBROWN = 78,
    TEXTCOLOR_LIGHTBLUE = 89,
    TEXTCOLOR_MAYABLUE = 95,
    TEXTCOLOR_DARKRED = 108,
    TEXTCOLOR_DARKPURPLE = 112,
    TEXTCOLOR_BROWN = 120,
    TEXTCOLOR_GREY = 129,
    TEXTCOLOR_TEAL = 143,
    TEXTCOLOR_DARKPINK = 152,
    TEXTCOLOR_PURPLE = 154,
    TEXTCOLOR_DARKORANGE = 156,
    TEXTCOLOR_RED = 180,
    TEXTCOLOR_PINK = 190,
    TEXTCOLOR_ORANGE = 192,
    TEXTCOLOR_DARKYELLOW = 205,
    TEXTCOLOR_YELLOW = 210,
    TEXTCOLOR_WHITE = 215,
    TEXTCOLOR_NONE = 255,
]]
local effects = {
    {position = Position(999, 992, 7), text = 'Spawns', effect = CONST_ME_GIANTICE, textcolor = TEXTCOLOR_GREEN},
    {position = Position(1000, 992, 7), text = 'Quests', effect = CONST_ME_FIREAREA, textcolor = TEXTCOLOR_LIGHTGREEN},
    {position = Position(1001, 992, 7), text = 'Trainings', effect = CONST_ME_GROUNDSHAKER,textcolor = TEXTCOLOR_TEAL},
    {position = Position(998, 992, 7), text = 'Market', effect = CONST_ME_CAKE, textcolor = TEXTCOLOR_DARKPURPLE},
    {position = Position(979, 993, 7), text = 'City', effect = CONST_ME_FIREWORK_YELLOW, textcolor = 143},
    {position = Position(978, 1003, 7), text = 'Events', effect = CONST_ME_CRAPS, textcolor = 155},
    --2 floor.
    {position = Position(997, 993, 6), text = 'VIP', effect = CONST_ME_GIFT_WRAPS, textcolor = 155},

    {position = Position(997, 993, 7), text = 'Depot', effect = CONST_ME_HOLYDAMAGE, effect2 = CONST_ME_CRAPS, textcolor = 194},


    {position = Position(1001, 1001, 7), text = 'Start Exp', effect = CONST_ME_TUTORIALSQUARE, effect2 = CONST_ME_TUTORIALARROW, textcolor = 215},
}

function onThink(creature, 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
               Game.sendAnimatedText(settings.text, settings.position, settings.textcolor)
            end
            if settings.effect then
                settings.position:sendMagicEffect(settings.effect)
            end
             if settings.effect2 then
                settings.position:sendMagicEffect(settings.effect2)
            end
        end
    end
   return true
end
 
Lua:
local colors = {5,30,35,95,108,129,143,155,180,198,210,215} -- You can add more colors.
function onThink(interval)
    for _, player in ipairs(Game.getPlayers()) do
        if player:getGroup():getAccess() then
            if player:isInGhostMode() then
                return true
            else
                local c = math.random(#colors)
                --doSendAnimatedText("STAFF", t, c)
                Game.sendAnimatedText("VIP", t, c)
            end
            return true
        end
        local t = player:getPosition()
        if player:isVip() then
            local c = math.random(#colors)
           -- doSendAnimatedText("VIP", t, c)
           Game.sendAnimatedText("VIP", t, c)
        end
    end
    return true
end
Code:
<globalevent name="animatedtexts" interval="4" event="script" value="staffanimatedtext.lua"/>

Code:
function doSendAnimatedText(message, position, color) return Game.sendAnimatedText(message, position, color) end

Code:
local t = {
    ["War Zone"] = { {x = 32366, y = 32235, z = 7}, TEXTCOLOR_RED},
    --["Safe"] = { {x = 997, y = 997, z = 7}, TEXTCOLOR_BLUE}--32366, 32235, 7
}
function onThink(interval, lastExecution, thinkInterval)
    for text, v in pairs(t) do
        Game.sendAnimatedText(v[1], text, v[2])
        --doSendAnimatedText(v[1], text, v[2])
        --Game.sendAnimatedText("VIP", t, c)

    end
    return true
end

Code:
    <globalevent name="animatedtext" interval="4" event="script" value="animated_text.lua"/>
not working, the server has the commits
 
<globalevent name="animatedtexts" interval="4" event="script" value="staffanimatedtext.lua"/>

Pay close attention, this XML is only for TFS 0.4 or earlier versions. You must remove the "event" and "value" elements, keeping the rest normal. Of course, this will work for you.



TFS 0.4
XML:
<globalevent name="animatedtexts" interval="4" event="script" value="staffanimatedtext.lua"/>

TFS 1x
XML:
<globalevent name="animatedtexts" interval="4" script="staffanimatedtext.lua"/>

simple 🤨
 
Pay close attention, this XML is only for TFS 0.4 or earlier versions. You must remove the "event" and "value" elements, keeping the rest normal. Of course, this will work for you.



TFS 0.4
XML:
<globalevent name="animatedtexts" interval="4" event="script" value="staffanimatedtext.lua"/>

TFS 1x
XML:
<globalevent name="animatedtexts" interval="4" script="staffanimatedtext.lua"/>

simple 🤨
Lua:
local colors = {5,30,35,95,108,129,143,155,180,198,210,215} -- You can add more colors.
function onThink(interval)
    for _, player in ipairs(Game.getPlayers()) do
        if player:getGroup():getAccess() then
            if player:isInGhostMode() then
                return true
            else
                local c = math.random(#colors)
                --doSendAnimatedText("STAFF", t, c)
                Game.sendAnimatedText("VIP", t, c)
            end
            return true
        end
        local t = player:getPosition()
        if player:isVip() then
            local c = math.random(#colors)
           -- doSendAnimatedText("VIP", t, c)
           Game.sendAnimatedText("VIP", t, c)
        end
    end
    return true
end

Code:
    <globalevent name="animatedtexts" interval="4" script="staffanimatedtext.lua"/>

do't know why i get this if i have added the source code
Code:
[Error - GlobalEvents::think] Failed to execute event: animatedtexts

Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/staffanimatedtext.lua:onThink
attempt to index a nil value
stack traceback:
        [C]: in function 'sendAnimatedText'
        data/globalevents/scripts/staffanimatedtext.lua:19: in function <data/globalevents/scripts/staffanimatedtext.lua:3>
[Error - GlobalEvents::think] Failed to execute event: animatedtexts
 
Lua:
lualocal colors = {5,30,35,95,108,129,143,155,180,198,210,215} -- Você pode adicionar mais cores.function onThink(interval)    for _, player in ipairs(Game.getPlayers()) do        local position = player:getPosition()                if player:isVip() then            local color = colors[math.random(#colors)]            Game.sendAnimatedText("VIP", position, color)        elseif player:getGroup():getAccess() then            local color = colors[math.random(#colors)]            Game.sendAnimatedText("STAFF", position, color)        end    end    return trueend

Code:
    <globalevent name="animatedtexts" interval="4" script="staffanimatedtext.lua"/>

do't know why i get this if i have added the source code
Code:
[Error - GlobalEvents::think] Failed to execute event: animatedtexts

Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/staffanimatedtext.lua:onThink
attempt to index a nil value
stack traceback:
        [C]: in function 'sendAnimatedText'
        data/globalevents/scripts/staffanimatedtext.lua:19: in function <data/globalevents/scripts/staffanimatedtext.lua:3>
[Error - GlobalEvents::think] Failed to execute event: animatedtexts


Now I understand.. you want to display on top of the correct "vip" player?

Lua:
local colors = {5,30,35,95,108,129,143,155,180,198,210,215}

function onThink(interval)
    for _, player in ipairs(Game.getPlayers()) do
        local position = player:getPosition()
      
        if player:isVip() then
            local color = colors[math.random(#colors)]
            Game.sendAnimatedText("VIP", position, color)
        elseif player:getGroup():getAccess() then
            local color = colors[math.random(#colors)]
            Game.sendAnimatedText("STAFF", position, color)
        end
    end
    return true
end
Post automatically merged:



Revscripts


Lua:
local globalevent = GlobalEvent("staffvip")

local colors = {5, 30, 35, 95, 108, 129, 143, 155, 180, 198, 210, 215}

function globalevent.onThink(interval)
    for _, player in ipairs(Game.getPlayers()) do
        local position = player:getPosition()
        
        if player:isVip() then
            local color = colors[math.random(#colors)]
            Game.sendAnimatedText("VIP", position, color)
        elseif player:getGroup():getAccess() and not player:isInGhostMode() then
            local color = colors[math.random(#colors)]
            Game.sendAnimatedText("STAFF", position, color)
        end
    end
    return true
end

globalevent:interval(1000) -- Will run every 1000ms (1 second)
globalevent:register()
 
Last edited:
Now I understand.. you want to display on top of the correct "vip" player?

Lua:
local colors = {5,30,35,95,108,129,143,155,180,198,210,215}

function onThink(interval)
    for _, player in ipairs(Game.getPlayers()) do
        local position = player:getPosition()
   
        if player:isVip() then
            local color = colors[math.random(#colors)]
            Game.sendAnimatedText("VIP", position, color)
        elseif player:getGroup():getAccess() then
            local color = colors[math.random(#colors)]
            Game.sendAnimatedText("STAFF", position, color)
        end
    end
    return true
end
Post automatically merged:



Revscripts


Lua:
local globalevent = GlobalEvent("staffvip")

local colors = {5, 30, 35, 95, 108, 129, 143, 155, 180, 198, 210, 215}

function globalevent.onThink(interval)
    for _, player in ipairs(Game.getPlayers()) do
        local position = player:getPosition()
     
        if player:isVip() then
            local color = colors[math.random(#colors)]
            Game.sendAnimatedText("VIP", position, color)
        elseif player:getGroup():getAccess() and not player:isInGhostMode() then
            local color = colors[math.random(#colors)]
            Game.sendAnimatedText("STAFF", position, color)
        end
    end
    return true
end

globalevent:interval(1000) -- Will run every 1000ms (1 second)
globalevent:register()
works, can you amke one that display animated text in an specific position? for example in a teleport or a depot?
edit: is displaying vip on god/staff member but it works :D

something like this, with multiple colors
Lua:
local t = {
    ["War Zone"] = { {x = 32366, y = 32235, z = 7}, TEXTCOLOR_RED},
    --["Safe"] = { {x = 997, y = 997, z = 7}, TEXTCOLOR_BLUE}--32366, 32235, 7
}
function onThink(interval, lastExecution, thinkInterval)
    for text, v in pairs(t) do
        Game.sendAnimatedText(v[1], text, v[2])
        --doSendAnimatedText(v[1], text, v[2])
        --Game.sendAnimatedText("VIP", t, c)

    end
    return true
end
would be fun, please
 
Lua:
local globalevent = GlobalEvent("positionandtext")

local effects = {
    {position = Position(32366, 32235, 7), text = 'War Zone!', effect = CONST_ME_BATS, textcolor = 180},
   --{position = Position(32366, 32235, 7), text = 'Safe!', effect = CONST_ME_BATS, textcolor = 215},

}

function globalevent.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
                Game.sendAnimatedText(settings.text, settings.position, settings.textcolor)
            end
            if settings.effect then
                settings.position:sendMagicEffect(settings.effect)
            end
            if settings.effect2 then
                settings.position:sendMagicEffect(settings.effect2)
            end
        end
    end
    return true
end

globalevent:interval(1000)
globalevent:register()

TEXTCOLOR_BLACK = 0,
TEXTCOLOR_BLUE = 5,
TEXTCOLOR_GREEN = 18,
TEXTCOLOR_LIGHTGREEN = 66,
TEXTCOLOR_DARKBROWN = 78,
TEXTCOLOR_LIGHTBLUE = 89,
TEXTCOLOR_MAYABLUE = 95,
TEXTCOLOR_DARKRED = 108,
TEXTCOLOR_DARKPURPLE = 112,
TEXTCOLOR_BROWN = 120,
TEXTCOLOR_GREY = 129,
TEXTCOLOR_TEAL = 143,
TEXTCOLOR_DARKPINK = 152,
TEXTCOLOR_PURPLE = 154,
TEXTCOLOR_DARKORANGE = 156,
TEXTCOLOR_RED = 180,
TEXTCOLOR_PINK = 190,
TEXTCOLOR_ORANGE = 192,
TEXTCOLOR_DARKYELLOW = 205,
TEXTCOLOR_YELLOW = 210,
TEXTCOLOR_WHITE = 215,
TEXTCOLOR_NONE = 255,
 
Back
Top