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

Color items loot chat

Ciosny

Member
Joined
Aug 16, 2024
Messages
116
Solutions
1
Reaction score
15
Hi,
I want to ask how to make items in lootchat have colors, e.g. BOH's red, Fire sword blue

I mean adding the color of items but not attributes :)

I have 10.98 and TFS 1.4.2
 

Attachments

Last edited:
I changed textmessage.lua and const.lua as in github
where should I enter this?

local listOfValuesByItemId = {
["3031"] = 1000001,
}
 
This ID 3031 is a gold coin only in the latest TFS 13.x or Canary. You need to change 3031 to 2148 for your TFS 1.4.2. That's all.

Check the example of the gold coin ID in Canary.
XML:
    <item id="3031" article="a" name="gold coin">
        <attribute key="weight" value="10"/>
        <attribute key="worth" value="1" />
    </item>

Actually, I haven't tested it yet. If it works, please post a screenshot so I can see.
 
This is how I understand what ID is about. I was more concerned whether I should put it in a specific file to make it work in the game.

I made the changes to textmessage.lua and const.lua just like in github, but nothing changed. That's why I asked where I should place this command, because "1000001" is assigned here:

local listOfValuesByItemId = {
["34021"] = 1000001,
["36792"] = 100001,
["3043"] = 10001,
["3415"] = 1001,
["3003"] = 51
}

local function getColorForValue(value)
if value >= 1000000 then
return TextColors.yellow
 
you need the server to send this structure, to make it work
LUA:
Loot of a dragon: {3031|31 gold coins}, {11457|a dragon's tail}, {3275|a double axe}.

test in canary 13.40 and otc redemption

1724078253921.webp
 
you need the server to send this structure, to make it work
LUA:
Loot of a dragon: {3031|31 gold coins}, {11457|a dragon's tail}, {3275|a double axe}.

test in canary 13.40 and otc redemption

View attachment 86664
Hi ! :) I have a question. I also use TFS 142 and have otc8.

I made it so that the loot is displayed (it's all green, not white like yours). I made the same changes as the guy above (for the test):

local listOfValuesByItemId = {
["3953"] = 1000001,
["3668"] = 100001,
["3043"] = 10001,
["3035"] = 1001,
["2148"] = 51
}

local function getColorForValue(value)
if value >= 1000000 then
return TextColors.yellow


Still, everything is displayed in yellow.

I don't fully understand what you wrote:

"you need the server to send this structure, to make it work
LUA:
Loot of a dragon: {3031|31 gold coins}, {11457|a dragon's tail}, {3275|a double axe}."


How to check it? Or how to enter it so that it works on OTC8?

I will be grateful for your answer :)
 
Back
Top