• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

TFS 1.5 / Globalevents - in function 'SendTextMessage'

Forkz

Active Member
Joined
Jun 29, 2020
Messages
223
Solutions
1
Reaction score
34
Hi otlanders,

Source: GitHub - nekiro/TFS-1.5-Downgrades at 7.72 (https://github.com/nekiro/TFS-1.5-Downgrades/tree/7.72)
Script
Lua:
local effects = {
    {position = Position(2534, 2536, 7), text = "Welcome!", effect = 10, say = false, color = math.random(1,255)}
}

function onThink(interval)
    for i = 1, #effects do
        local settings = effects[i]
        if settings then
            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
    end
  return true
end

Error
Code:
Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/custom/text_effect.lua:onThink
data/globalevents/scripts/custom/text_effect.lua:16: attempt to call field 'sendAnimatedText' (a nil value)
stack traceback:
    [C]: in function 'sendAnimatedText'
    data/globalevents/scripts/custom/text_effect.lua:16: in function <data/globalevents/scripts/custom/text_effect.lua:5>
[Error - GlobalEvents::think] Failed to execute event: TextEffect
 

dami1310

◄ Unidentified ►
Joined
Jan 27, 2013
Messages
697
Solutions
12
Reaction score
620
Location
Poland
There is no "sendAnimatedText" in this repo. You can copy the code from 8.6 one and it will work.
 
Last edited:

dami1310

◄ Unidentified ►
Joined
Jan 27, 2013
Messages
697
Solutions
12
Reaction score
620
Location
Poland
There is nothing to replace it. It was removed on purpose to fit 7.72.
Either add the code back into the source or give up on it.
 
Solution
Top