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

Solved Transformback with ground tile.

Exoltes

Novia OTserv Developer
Joined
Jul 2, 2009
Messages
563
Reaction score
47
Location
Belgium
I'm working on a 8.54 Open Tibia Server using The Forgotten Server - Version 0.2.7 (Mystic Spirit).

I'm looking for a way to transform my ground tile back with a delay of 5 minutes.

Code:
local monsters = {
   {name = "bandit1", pos = {x = 827, y = 984, z = 5}},
   {name = "bandit2", pos = {x = 826, y = 986, z = 5}},
   {name = "bandit3", pos = {x = 829, y = 986, z = 5}},
   {name = "bandit4", pos = {x = 830, y = 983, z = 5}},
   {name = "bandit5", pos = {x = 830, y = 987, z = 5}}
}
local pos = {x = 829, y = 986, z = 5, stackpos = 253}

function onStepIn(cid, item, position, fromPosition)
local function doTransformBack(pos, itemid, transformid)
     return doTransformItem(getTileItemById(pos, transformid).uid, itemid)
end

    if isPlayer(cid) == TRUE then
                for m = 1, #monsters do
                doSummonCreature(monsters[m].name, monsters[m].pos)
            end
                doTransformItem(getTileItemById({x = 827, y = 988, z = 5}, 9067).uid, 4339)
                doTransformItem(getTileItemById({x = 828, y = 988, z = 5}, 9067).uid, 4339)
                doTransformItem(getTileItemById({x = 829, y = 988, z = 5}, 9067).uid, 4339)
                doTransformItem(getTileItemById({x = 830, y = 988, z = 5}, 9067).uid, 4339)
            addEvent(doTransformBack, 1*10*1000, {x = 827, y = 988, z = 5}, 4339, 9067)
        if getPlayerSex(cid) == 0 then
                    doCreatureSay(getThingfromPos(pos).uid, "Boys, get her!", TALKTYPE_ORANGE_1)
                else
                  doCreatureSay(getThingfromPos(pos).uid, "Boys, get him!", TALKTYPE_ORANGE_1)
                end
end
    return true
end

already tried a couple transformback's like in the script above but all keep giving errors comparable to the one below.
Code:
[12/09/2014 11:16:56] Lua Script Error: [MoveEvents Interface] 
[12/09/2014 11:16:56] in a timer event called from: 
[12/09/2014 11:16:56] data/movements/scripts/others/Bandit Camp.lua:onStepIn

[12/09/2014 11:16:56] luaDoTransformItem(). Item not found
 
Code:
addEvent(doTransformBack, 1*10*1000, {x = 827, y = 988, z = 5}, 4339, 9067)

In the line above 9067 is tranformed to 4339, now in the Lua made function that is added in addEvent, it tries to transform 9067 to 4339 aswell, so switch the ids.
Code:
addEvent(doTransformBack, 1*10*1000, {x = 827, y = 988, z = 5}, 9067, 4339)

Also add local Lua made functions (local function doTransformBack) above the main function (function onStepIn).
 

Similar threads

Back
Top