• 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!

Lua Change the animated text effect and color

Allan Silva

Member
Joined
May 30, 2018
Messages
39
Solutions
1
Reaction score
7
Hi

I'm using TFS 1.3 with script rarity roll.
[TFS 1.X] Rarity Rolls & Custom Attributes Library (https://otland.net/threads/tfs-1-x-rarity-rolls-custom-attributes-library.268888/)

When you drop a loot automatic send animated text on loot, look the picture below.

1617156558715.png
When you have a loot of creature in screen and are using magics, sometimes is hard to see this mensage, so i whould like to change this.

Script where is send the animated below

Lua:
-- Apply rarity chance to corpse contents and apply animation
    if rollRarity(corpse) > 0 then -- If a rare item was rolled, play animation
            if rare_popup then
                local spectators = Game.getSpectators(corpse:getPosition(), false, true, 7, 7, 5, 5)
                for i = 1, #spectators do
                    spectators[i]:say(rare_text, TALKTYPE_MONSTER_SAY, false, spectators[i], corpse:getPosition())
                end
            end
        if rare_effect then
            corpse:getPosition():sendMagicEffect(rare_effect_id)
        end
    end

Lua:
rare_text = (tiers[tier].prefix:gsub("^%l", string.upper) .. "")

EDITED
I want change:
  1. change the message color
  2. show "rarity" for x times in y seconds.
  3. show in local channel a mensage "you dropped a "rarity" item"

EDITED:
2 - possible solution
This line have to be repeat for x time in y seconds
Lua:
for i = 1, #spectators do
    spectators[i]:say(rare_text, TALKTYPE_MONSTER_SAY, false, spectators[i], corpse:getPosition())
end


3 - possible solution
Lua:
local text = ("You have dropped a ".. rare_text.. " loot.")
player:sendTextMessage(MESSAGE_PARTY_MANAGEMENT, text)

1617135866379.png

but the message shown in the server log and I would like to put it on local chat. Anyone know what I can change in the script?
 
Last edited:
change the message color
did u try these ones?
Lua:
MESSAGE_STATUS_CONSOLE_BLUE
MESSAGE_STATUS_CONSOLE_RED
MESSAGE_STATUS_DEFAULT
MESSAGE_STATUS_WARNING
MESSAGE_EVENT_ADVANCE
MESSAGE_STATUS_SMALL
MESSAGE_INFO_DESCR
MESSAGE_DAMAGE_DEALT
MESSAGE_DAMAGE_RECEIVED
MESSAGE_HEALED
MESSAGE_EXPERIENCE
MESSAGE_DAMAGE_OTHERS
MESSAGE_HEALED_OTHERS
MESSAGE_EXPERIENCE_OTHERS
MESSAGE_EVENT_DEFAULT
MESSAGE_EVENT_ORANGE
MESSAGE_STATUS_CONSOLE_ORANGE
 
Back
Top