• 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.X+ Use iron hammer on 2 item on different stackpos

Allynn

Well-Known Member
Joined
Mar 18, 2024
Messages
232
Reaction score
62
Location
Pol and
YouTube
RookgaardAdventure
Hey, long time spend on this.. Is possible to make this working ?
Too newbie, to read source code.
Crafting system, put one item on anvil, put next item on anvil, and hit them with the hammer, to connect them.
Two different id.
Thanks for reading.

LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local tile = Tile(Position)
    local AnvilPos = {x = 32112, y = 32202, z = 7, stackpos="1"}
    local AxePos = {x = 32112, y = 32202, z = 7, stackpos="2"}
 
    local tileAnvilPos = Tile{x = 32112, y = 32202, z = 7, stackpos="1"}
    local tileAxePos = Tile{x = 32112, y = 32202, z = 7, stackpos="2"}
    local getpos1 = getThingfromPos(AxePos)
    local getpos2 = getThingfromPos(AnvilPos)
    -- 26679 id Another axe, added to the game
            if (getpos1.itemid == 26679) and (getpos2.itemid == 2555) then
                    local anvilPos = tileAnvilPos:getItemById(2555)
                    local axePos = tileAxePos:getItemById(26679)
                            position:sendMagicEffect(CONST_ME_POFF)
                            player:addItem(2386, 1)
            end
    end
    return true
end
 
Back
Top