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

Double info text.

element90

Active Member
Joined
Mar 24, 2009
Messages
114
Reaction score
34
Any ideas why i'm getting double OnLook text on pretty much everything?


00:36 You see yourself. You are a knight.yourself. You are a knight.

00:37 You see a rare longsword +5 (Atk:27, Def:24).
It weighs 42.00 oz.a rare longsword +5 (Atk:27, Def:24).
It weighs 42.00 oz.
 
Solution
No worries. Actually, it is not possible to figure out function "stat_onLook" means with that script, it has to be somewhere else like global.lua (data/global.lua or data/lib/global.lua) or compat.lua (data/lib/compat/compat.lua)

Meanwhile just test with this,
-- Players cannot throw items on teleports if set to true local blockTeleportTr - Pastebin.com

Simply replaced at line 57 your:
Lua:
local description = "You see " .. thing:getDescription(distance)
description = stat_onLook(thing, description)
with
Lua:
local description = "You see "
Code:
function Player:onLook(thing, position, distance)
   local description = "You see " .. thing:getDescription(distance)
   description = stat_onLook(thing, description)




Not sure if this is the correct way to show you the code but here it is..
 
Which TFS version are you using?

The code you pasted above is not completed, simply compare your file with the following one: forgottenserver/player.lua at master · otland/forgottenserver · GitHub


Honestly not 100% sure about what TFS it is.
It's very newly compiled and doesnt even say what version more then TFS 1.x - for 10.0/11.3 clients.

Everything else works fine tho.

You should only have 1 onLook method associated with player, show us the definition of stat_onLook

This?

Code:
function Player:onLook(thing, position, distance)
   local description = "You see " .. thing:getDescription(distance)
   description = stat_onLook(thing, description)

    if thing:isItem() then
        if thing.actionid == 5640 then
            description = description .. 'a honeyflower patch.'
        elseif thing.actionid == 5641 then
            description = description .. 'a banana palm.'
        else
            description = description .. thing:getDescription(distance)
        end
        local itemType = thing:getType()
        if (itemType and itemType:getImbuingSlots() > 0) then
            local imbuingSlots = "Imbuements: ("
            for i = 1, itemType:getImbuingSlots() do
                local specialAttr = thing:getSpecialAttribute(i)
                local time = 0
                if (thing:getSpecialAttribute(i+3)) then
                    time = getTime(thing:getSpecialAttribute(i+3))
                end
              
                if (specialAttr) then
                    if (i ~= itemType:getImbuingSlots()) then
                        imbuingSlots = imbuingSlots.. "" ..specialAttr.." " ..time..", "
                    else
                        imbuingSlots = imbuingSlots.. "" ..specialAttr.." " ..time..")."
                    end
                else
                    if (i ~= itemType:getImbuingSlots()) then
                        imbuingSlots = imbuingSlots.. "Empty Slot, "
                    else
                        imbuingSlots = imbuingSlots.. "Empty Slot)."
                    end
 
Last edited by a moderator:
No worries. Actually, it is not possible to figure out function "stat_onLook" means with that script, it has to be somewhere else like global.lua (data/global.lua or data/lib/global.lua) or compat.lua (data/lib/compat/compat.lua)

Meanwhile just test with this,
-- Players cannot throw items on teleports if set to true local blockTeleportTr - Pastebin.com

Simply replaced at line 57 your:
Lua:
local description = "You see " .. thing:getDescription(distance)
description = stat_onLook(thing, description)
with
Lua:
local description = "You see "
 
Solution
No worries. Actually, it is not possible to figure out function "stat_onLook" means with that script, it has to be somewhere else like global.lua (data/global.lua or data/lib/global.lua) or compat.lua (data/lib/compat/compat.lua)

Meanwhile just test with this,
-- Players cannot throw items on teleports if set to true local blockTeleportTr - Pastebin.com

Simply replaced at line 57 your:
Lua:
local description = "You see " .. thing:getDescription(distance)
description = stat_onLook(thing, description)
with
Lua:
local description = "You see "


Problem seems solved! Thanks a bunch!
 
Back
Top