• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[TFS 1.4.2] Monster Level TITLE

Solution
In modules/gamelib/creature.lua use OnAppear callback if you dont have it just add this, i think it should work, not tested.

LUA:
function Creature:onAppear()
    if self:isMonster() then
        local name = self:getName()
        local level = 0
        local baseName = name
        local match = string.match(name, "%[(%d+)%]")
        if match then
            level = tonumber(match)
            baseName = string.gsub(name, " %[%d+%]%s*", "")
        end
        self:setName(baseName)
        if level > 0 then
            self:setTitle("Lv. " .. level, "verdana-11px-rounded", "#FFFF00")
        end
    end
end
In modules/gamelib/creature.lua use OnAppear callback if you dont have it just add this, i think it should work, not tested.

LUA:
function Creature:onAppear()
    if self:isMonster() then
        local name = self:getName()
        local level = 0
        local baseName = name
        local match = string.match(name, "%[(%d+)%]")
        if match then
            level = tonumber(match)
            baseName = string.gsub(name, " %[%d+%]%s*", "")
        end
        self:setName(baseName)
        if level > 0 then
            self:setTitle("Lv. " .. level, "verdana-11px-rounded", "#FFFF00")
        end
    end
end
 
Last edited:
Solution
In modules/gamelib/creature.lua use OnAppear callback if you dont have it just add this, i think it should work, not tested.

LUA:
function Creature:onAppear()
    if self:isMonster() then
        local name = self:getName()
        local level = 0
        local baseName = name
        local match = string.match(name, "%[(%d+)%]")
        if match then
            level = tonumber(match)
            baseName = string.gsub(name, " %[%d+%]%s*", "")
        end
        self:setName(baseName)
        if level > 0 then
            self:setTitle("Lv. " .. level, "verdana-11px-rounded", "#FFFF00")
        end
    end
end
Thanks, it works fine 🔥
 
Back
Top