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

Evil Hero's best answers

  1. Evil Hero

    TFS 1.X+ New slot not saving items (TFS 1.2)

    You miss the part at iologindata.cpp in bool IOLoginData::loadPlayer(Player* player, DBResult_ptr result) if (pid >= 1 && pid <= 10) { to: if (pid >= 1 && pid <= 11) { and in bool IOLoginData::savePlayer(Player* player) for (int32_t slotId = 1; slotId <= 10; ++slotId) { to: for (int32_t slotId =...
  2. Evil Hero

    TFS 1.X+ getDirection() of target - TFS1.3

    function onThink(interval, lastExecution, thinkInterval) for _, player in ipairs(Game.getPlayers()) do local target = player:getTarget() if target then if target:isPlayer() or target:isMonster() then local dirTarget = target:getDirection()...
  3. Evil Hero

    For-loop index jump

    You don't need all that loops, just go and index table values by strings, then you can skip most of it anyway local spells = { ["antidote"] = {...} -- and so on } if spells[msg:lower()] then -- found the spell end I'm on phone, else I would provide the full example
  4. Evil Hero

    TFS 1.X+ TFS 1.3 CTRL + ARROW for staff members ( NOT seeking onTurn event solutions! )

    Well I don't understand why you do not want to have it in lua. However here's what you asked for. void Game::playerTurn(uint32_t playerId, Direction dir) { Player* player = getPlayerByID(playerId); if (!player) { return; } if (player->getGroup()->access) { if...
  5. Evil Hero

    Mobs only drop one of each item

    You don't need to recompile your server, just change the following: local itemCount = 0 local randvalue = getLootRandom() if randvalue < item.chance then if ItemType(item.itemId):isStackable() then itemCount = randvalue % item.maxCount + 1 else...
  6. Evil Hero

    spawn monster

    local monsters = { ["Monday"] = "ferumbras", ["Tuesday"] = "bazir" } function onStartup() if monsters[os.date("%A")] then print(">> Boss: ".. monsters[os.date("%A")]) Game.createMonster(monsters[os.date("%A")], Position(32215, 32048, 13), true, true) else...
  7. Evil Hero

    Premium Account Client&Accmaker

    config.lua freePremium = false
  8. Evil Hero

    I can't seem to compile TFS 1.3?

    https://github.com/otland/forgottenserver/pull/2606
  9. Evil Hero

    TFS 0.X Detect on play fanfare if player is x,y,z position

    You cannot compare position tables, you have to invoke a function like: function comparePosition(p1, p2) return pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z and true or false end depending on tfs version it might have comparePosition(p1, p2) already.
  10. Evil Hero

    TFS 0.X Teleport to trainer

    https://otland.net/threads/infinity-training-room-0-3-6-0-4.179468/#post-1759936 It contains pretty much everything which you need.
  11. Evil Hero

    TFS 1.X+ Tfs 1.3 downgraded by Nekiro to 8.6 (Cannot open include file: 'boost/asio)

    tfs 1.3 doesn't support tfs-sdk anymore, it has been deprecated. You have to follow this tutorial otland/forgottenserver (https://github.com/otland/forgottenserver/wiki/Compiling-on-Windows-%28vcpkg%29) to compile on windows.
  12. Evil Hero

    [Help] Position on storage

    function Player.savePosition(self, storage) self:setStorageValue(storage, self:getPosition().x) self:setStorageValue(storage+1, self:getPosition().y) self:setStorageValue(storage+2, self:getPosition().z) end function Player.loadPosition(self, storage) return...
  13. Evil Hero

    TFS 1.X+ [Warning - Actions::registerLuaEvent] Duplicate registered item with id: X in range from id: Y, to id: Z

    Revscriptsys is a drag and drop self registering system for scripts, you just have to remove the spellbook.lua file out of that directory and it wont be registered twice or loaded again. Edit: if you want more informations about revscriptsys Revscriptsys · Issue #2555 · otland/forgottenserver...
  14. Evil Hero

    TFS 1.X+ OnEquip Lua Function

    You have no return value set for it, you either have tu return false (not be able to equip) or return true (able to equip it) in order for it to work correctly. function onEquip(player, item, slot) print(item:getDescription()) return true end
  15. Evil Hero

    TFS 1.X+ Code not adding item to the selected container

    You need to push on the item.uid of the container and at the end inside moveTo you just push Container(container[i].uid) which should now result in the right container
  16. Evil Hero

    Solved Adding text into a book quest

    local book = player:addItem(1955, 1) book:setAttribute("text", "Day 1: Wow! I finally get to leave the village and explore the world! I am so excited to get started on my adventures! Day 2: I ventured down into a cave, wow, some neat cave drawings! I have never seen anything like this in my...
  17. Evil Hero

    TFS 1.X+ [TFS 1.3] onHealthChange problems

    You could also do local mType = MonsterType("rat") mType:registerEvent("eventName") This would fire for all monsters of that type. or you take a look at https://github.com/otland/forgottenserver/pull/2798 where you have the necessary function to make something like this now: local...
  18. Evil Hero

    Lua [TFS 1.x] How to get player in onAddItem event?

    You can use Player:onItemMoved(item, count, fromPosition, toPosition, fromCylinder, toCylinder) or Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, toCylinder) from Events.
  19. Evil Hero

    trying revscript doesnt work?

    Well you are missing to asign the onStatsChange to the creatureevent method creatureevent.onStatsChange = function(...) that's the step you're missing
  20. Evil Hero

    TFS 1.X+ onSpawn for one monster

    The spawning for lua monsters works exactly the same as for xml monsters, what he meant was, that you just have to edit the monsters.xml file for your rme and include the name of the monster there. That way you can place it normaly in rme and it'll be spawned just correct in your server.
Top