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

Search results

  1. Ninja

    serialize/unserialize solution

    I don't think this is the appropriate "forum" for these type of questions. You are more likely to receive a proper answer over at GitHub where the actual development of TFS takes place. ;)
  2. Ninja

    Lua bank npc not working (tfs 3.0)

    The NpcHandler method 'isFocused' should be available by default. Have you modified your NPC system or just removed some methods from npchandler.lua by any chance? I don't know whether this will work properly or not, seeing as your NPC system might have been modified. Anyway, you can try...
  3. Ninja

    Solved TFS 1.2 item stacking problem

    It's quite simple. When you're using the function 'createItem' you're always setting an additional attribute (text), and thus makes the item(s) unstackable.
  4. Ninja

    Solved getPlayerFlagValue error

    Try with something like this: -- lib/core/player.lua function Player.hasFlag(self, flag) if not flag or type(flag) ~= 'number' then return false end return self:getGroup():getFlags() & flag ~= 0 end -- broadcast.lua if not player:hasFlag(PlayerFlag_CanBroadcast) then...
  5. Ninja

    update script to tfs 1.2

    The error message indicates that the method 'getMonster' does not exist. Add this piece of code to your Lua core library: function Creature.getMonster(self) return self:isMonster() and self or nil end
  6. Ninja

    Solved Global Storage + TFS 1.2

    It's only logical as it returns a string and not an integer. If you only intend to store integers, you might as well change the data type for the field 'value' to INT, and replace getString with getNumber. Or simply cast it to a numeric value with tonumber.
  7. Ninja

    Rl tibia update: exp boost, rightclick gold change and no-loss bag in sms shop.

    "Please note: For the first one or two weeks, XP Boosts will only be buyable on the preview game worlds Aurora and Aurera so that we can make sure that they technically work as intended." Source: Upcoming New Store Products
  8. Ninja

    Solved Global Storage + TFS 1.2

    function getGlobalStorageValueDB(key) local resultId = db.storeQuery("SELECT `value` FROM `global_storage` WHERE `key` = " .. key) if resultId ~= false then local val = result.getString(resultId, "value") result.free(resultId) return val end return -1 end...
  9. Ninja

    Auto regeneration

    local regenCondition = Condition(CONDITION_REGENERATION, CONDITIONID_DEFAULT) regenCondition:setTicks(-1) regenCondition:setParameter(CONDITION_PARAM_HEALTHTICKS, 2000) regenCondition:setParameter(CONDITION_PARAM_MANATICKS, 2000) function onLogin(player)...
  10. Ninja

    Solved [TFS 1.2] Spell Learner Problem.

    It will never get past the first conditional expression isInArray(k, player:getVocation()) because when you use 'player:getVocation()' you are actually accessing a Vocation userdata object. You need to use the Vocation method ':getId()' to return the vocation ID. So basically what you should...
  11. Ninja

    Auto regeneration

    I don't know why custom servers would remove all conditions from a player, but okay. I had to look this up, but you do have the option to remove persistent conditions when using doRemoveConditions by utilizing the second parameter onlyPersistent (boolean). A condition is persistent if the...
  12. Ninja

    Auto regeneration

    They do use CONDITION_REGENERATION, but they are also using sub ID 1 so they wouldn't affect this condition.
  13. Ninja

    [Gesior ACC]How much vocation online TFS 1.2 PROBLEM

    The database schema for TFS 1.x is somewhat different compared to 0.3/0.4 where TFS 1.x does not have an 'online' column. If you want to check if a player is online, you'll have to include another table ('players_online') in your query as well, and check if player.id is equal to...
  14. Ninja

    Auto regeneration

    Sorry, but both of your suggestions are terrible. OP is better of using a condition (where ticks is set to -1, and disappears when the player logs out) that is added each time a player logins. local regenCondition = Condition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)...
  15. Ninja

    Lua [1.1] Item:getAttribute(ITEM_ATTRIBUTE_ATTACK) returns 0

    It's working as expected, an item does not have any attributes by default. You can check if an item has an attribute by using the metamethod Item.hasAttribute. function foo(player) local damage = 0 local weapon = player:getSlotItem(CONST_SLOT_LEFT) if weapon then damage =...
  16. Ninja

    Amulet of Life for tfs 1.2

    Player.getSlotItem will return a nil value if the player is not wearing an amulet. function onPrepareDeath(creature) local player = creature:getPlayer() if not player then return true end local amuletItem = player:getSlotItem(CONST_SLOT_NECKLACE) if not amuletItem or...
  17. Ninja

    Second time deleted my thread....

    Both of your threads were deleted because they didn't contain a single working image. Make sure that you upload working image(s) on your third attempt, and take advantage of the 'Preview' button! Please post complains in the right section (Feedback) next time. :)
  18. Ninja

    NPC [TFS 1.1 & 1.2] Bank NPC (Auto Speaking + Working with Market)

    http://lua-users.org/wiki/FormattingNumbers
  19. Ninja

    Solved Solved

    Replace Game::combatChangeMana with this: Seems like you missed some things (e.g changing mana). :p
  20. Ninja

    Your favorite TFS for 8.6

    There is, however it's basically a fork of my 8.6 branch with additional changes. So it doesn't really matter which one you choose. :p
Back
Top