• 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.2

Itutorial

Legendary OT User
Joined
Dec 23, 2014
Messages
2,461
Solutions
68
Reaction score
1,123
When I set a custom description in my onLook() will it show even if I am using Otclient? When I set a custom description (or tell add something in) it doesn't show it.
 
Last edited:
Is it possible to edit a monsters description.

For example making its description say the players name.
I don't see why not, just look at the player onlook
Code:
elseif thing:isCreature() then
            local str = "%s\nHealth: %d / %d"
            if thing:getMaxMana() > 0 then
                str = string.format("%s, Mana: %d / %d", str, thing:getMana(), thing:getMaxMana())
            end
            description = string.format(str, description, thing:getHealth(), thing:getMaxHealth()) .. "."
        end
 
Yes, that creates a default description but I want to edit that description with a new one that isn't just a one time check. Plus that isn't used on players only staff.
 
Pretty much I want it so:

A player catchs a monster from the water
The monsters description is set to show that the player is the one who caught it
so instead of:

"You see a dragon."

it would be

"You see a dragon. It was caught by playername."
 
Yes, that creates a default description but I want to edit that description with a new one that isn't just a one time check. Plus that isn't used on players only staff.
You are a programmer correct?
Pretty much I want it so:

A player catchs a monster from the water
The monsters description is set to show that the player is the one who caught it
so instead of:

"You see a dragon."

it would be

"You see a dragon. It was caught by playername."
I gave you a hint of where to start... just because it is only seen by staff or players with x group level doesn't mean you can't write a function/method to do what you want it to do.
 
Does this not work for OTclient? It seems no matter what I put in the description doesn't change.
 
This is just an example, I have not tested this.
Code:
function Player:onLook(thing, position, distance)
    local x = ''
    if Monster(thing:getId()) then
        -- uncertain if it returns userdata or a name..
        local s = thing:getMaster()
        if s and s:getName() ~= thing:getName() then
            x = 'it belongs to [' .. s:getName() .. ']'
        end
    end
    local description = "You see " .. thing:getDescription(distance)
    if self:getGroup():getAccess() then

-- rest of the code


    self:sendTextMessage(MESSAGE_INFO_DESCR, description..x)
end

Still think it's not worth learning how to code?
 
Last edited:
I have no problem getting the code in, also its not a summon or anything. It just doesn't show when I look at the monster. Nothing does. I have tried all types of things which I know work but it just doesn't accept it. It could be because im using otclient rather then the regular tibia client.
 
I have no problem getting the code in, also its not a summon or anything. It just doesn't show when I look at the monster. Nothing does. I have tried all types of things which I know work but it just doesn't accept it. It could be because im using otclient rather then the regular tibia client.
Unfortunately you do have problems writing code, which is ok, I don't know everything when it comes to writing code, but at least I own up to it (unless you piss me off hehe then I just tell you to @#$% off)
 
I have never said I know everything about coding. I swear something is wrong with you. Its obvious you cant answer my question so please stop commenting here now.
 
I have never said I know everything about coding. I swear something is wrong with you. Its obvious you cant answer my question so please stop commenting here now.
I did answer your question, and I even gave you an example, you are just lazy and somewhat incompetent.
 
As I said. I have already put in even basic stuff and it doesn't show...Adding one more line into any of the spots and making it put anything doesn't change the text. It won't even error out. Which led me to believe it was editing the wrong file. But I quadruple checked that and still the same outcome. So please, tell me how you know whats going on again?
 
P2G1Lvr.png

:)
 
Back
Top