• 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 Poi oil lever how to add transform back after xxx seconds

Pokurwieniec

New Member
Joined
Feb 1, 2016
Messages
43
Reaction score
1
I want to make oil lever on poi which after xxx seconds will return to 1945 and bridge transform to water Somebody knows? ;D
 
You'll need to post your tfs and scripts so we have something to work with. But for your general question, Yes it's possible, and yes we know how. :p
 
it's 0.4 r3884
Code:
local t = {
    [8933] = {
        {x = 32800, y = 32336, z = 11}, -- Where players will be teleported if standing on the bridge.
        {x = 32801, y = 32336, z = 11, stackpos = 0}, -- The position of the bridge tile that must change.
        {x = 32800, y = 32339, z = 11, stackpos = 1} -- The position of the lever (where the oil goes).
    }
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local v = t[item.uid]
    if v then
        local water, bridge = getTileItemById(v[2], 493).uid, getTileItemById(v[2], 5770).uid
        if water > 0 then
            local oil = getThingFromPos(v[3])
            if oil.itemid == 2016 and oil.type == 11 then
                doRemoveItem(water)
                doCreateItem(5770, 1, v[2])
                doSendMagicEffect({x=32800, y=32339, z=11},CONST_ME_MAGIC_RED)
                addEvent(doTransformBack, 1*10*1000, {x = 32800, y = 32339, z = 11}, 1946, 1945)
            else
                return doCreatureSay(cid, "The lever is creeking and rusty.", TALKTYPE_MONSTER, nil, nil, v[3])
            end
        else
            if bridge > 0 then
                doCreateItem(493, 1, v[2])
                local k = getThingFromPos(v[2]).uid
                if k ~= 0 then
                    doRelocate(v[2], v[1])
                end
            end
        end
    end
    return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
 
Back
Top