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

Lua Need script when move item start decay

gubbo123

New Member
Joined
Aug 15, 2017
Messages
151
Solutions
1
Reaction score
3
Hello friends, Im using tfs 1.2

I'm looking for a script that when I move a specific one from a list, it starts to decay, an item that is on the floor of the map

Can someone help me?

Thanks in advance
 
Not sure if it will work, but give it a try.
If any errors occur, please let us know:
Lua:
local config = {
    actionId = 1234,
    itemId = 2377, -- two handed sword
    transformTo = 2393, -- giant sword
    time = 30 * 1000, -- decay time
}


local moveItem = MoveEvent()
function moveItem.onStepIn(creature, item, position, fromPosition)
    if item:getId() == config.itemId then
        addEvent(
            function()
                item:transform(config.transformTo)
            end,
            config.time
        )
    end

    return true
end

moveItem:type("stepin")
moveItem:aid(config.actionId)
moveItem:register()
 
Not sure if it will work, but give it a try.
If any errors occur, please let us know:
Lua:
local config = {
    actionId = 1234,
    itemId = 2377, -- two handed sword
    transformTo = 2393, -- giant sword
    time = 30 * 1000, -- decay time
}


local moveItem = MoveEvent()
function moveItem.onStepIn(creature, item, position, fromPosition)
    if item:getId() == config.itemId then
        addEvent(
            function()
                item:transform(config.transformTo)
            end,
            config.time
        )
    end

    return true
end

moveItem:type("stepin")
moveItem:aid(config.actionId)
moveItem:register()
It will work only if player will step in into that item.
 
Back
Top