• 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+ how to add this on itens?

bpm91

Intermediate OT User
Joined
May 23, 2019
Messages
942
Solutions
7
Reaction score
130
Location
Brazil
YouTube
caruniawikibr
1715204984755.png

Let's say I have an item, and it sits in one place sending messages on the player's screen. how can I do this? tfs 1.5
 
Open /data/globalevents

open globalevents.xml

paste

Lua:
<globalevent name="animate" interval="2000" script="animate.lua" />
Save and exit

open globalevents/scripts greate
animate.lua

and paste script

local TEXTCOLOR = {
BLACK = 0,
BLUE = 5,
GREEN = 18,
LIGHTGREEN = 66,
DARKBROWN = 78,
LIGHTBLUE = 89,
MAYABLUE = 95,
DARKRED = 108,
DARKPURPLE = 112,
BROWN = 120,
GREY = 129,
TEAL = 143,
DARKPINK = 152,
PURPLE = 154,
DARKORANGE = 156,
RED = 180,
PINK = 190,
ORANGE = 192,
DARKYELLOW = 205,
YELLOW = 210,
WHITE = 215,
NONE = 255,
}

local effects = {
{position = Position(153, 48, 7), text = 'Hunts', effects = {29,11}, textColor = TEXTCOLOR.YELLOW},
{position = Position(151, 48, 7), text = 'Quests', effects = {29,11}, textColor = TEXTCOLOR.YELLOW},
{position = Position(152, 48, 7), text = 'Trainers', effects = {29,11}, textColor = TEXTCOLOR.YELLOW},
{position = Position(160, 41, 7), text = 'Vip', effects = {29}, textColor = TEXTCOLOR.YELLOW},


}

function onThink(creature, interval)
for i = 1, #effects do
local settings = effects
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
for _, effect in ipairs(settings.effects) do
settings.position:sendMagicEffect(effect)
end
end
end
return true
end

 
Lua:
function onThink(interval)
    local effects = {

      {position = Position(998, 1213, 7), text = "Exsluiva", effect = 40, say = true, color = math.random(1,255)},
      {position = Position(998, 1213, 7), text = "Hunts", effect = 40, say = true, color = math.random(1,255)},
      {position = Position(998, 1213, 7), text = "++Hunts", effect = 40, say = true, color = math.random(1,255)},

}

    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
XML:
    <globalevent name="TextEffect" interval="3550" script="custom/textEffect.lua" />
 
(153, 48, 7), <<<<<<<<<<<Position where you want
effects = {29,11},<<<<<<With one effect
textColor = TEXTCOLOR.YELLOW}, <<<<<<<Color text
interval="2000" <<<<<<<<is every 2 second you can change 1000=1second 5000=5 seconds
You want like this something?
 
Back
Top