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

Children of Revolution bug

lucasholanda

New Member
Joined
Jun 16, 2014
Messages
8
Reaction score
0
Hello guys if someone can help me please, i have a bug on children of the revolution quests mission 4 levers
after using the oil on the levers all works fine but when i try to click on the levers for change the symbols won't work without distro errors if someone can help me or give me any script for fix it please! im using tfs 1.2:(

my script its:
local leverChange = {
[1] = {1, 3, 2, 4},
[2] = {2, 1, 3, 4},
[3] = {2, 3, 1, 4},
[4] = {3, 2, 4, 1},
[5] = {4, 2, 1, 3}
}

local position = {
[1] = {
Position(33349, 31123, 5),
Position(33349, 31124, 5),
Position(33349, 31125, 5),
Position(33349, 31126, 5),
Position(33349, 31127, 5)
},
[2] = {
Position(33352, 31126, 5),
Position(33353, 31126, 5),
Position(33354, 31126, 5),
Position(33355, 31126, 5)
}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if target.actionid ~= 8013 then
return false
end

if player:getStorageValue(Storage.ChildrenoftheRevolution.Questline) ~= 14 then
player:say("The lever does not budge.", TALKTYPE_MONSTER_SAY)
return true
end

local lever, tmp, ground = toPosition.y - 31122, {}
for i = 1, #position[1] do
ground = Tile(position[1]):getGround()
if ground then
tmp = ground.itemid
end
end

for i = 1, #position[2] do
ground = Tile(position[2]):getGround()
if ground then
ground:transform(tmp[leverChange[lever]])
ground:getPosition():sendMagicEffect(CONST_ME_POFF)
end
end

local groundIds, pass = {10856, 10853, 10855, 10850}, 0
for i = 1, #position[2] do
ground = Tile(position[2]):getGround()
if ground and ground.itemid == groundIds then
pass = pass + 1
end
end

if pass ~= 4 then
return true
end

player:setStorageValue(Storage.ChildrenoftheRevolution.Questline, 17)
player:setStorageValue(Storage.ChildrenoftheRevolution.Mission04, 5) --Questlog, Children of the Revolution "Mission 4: Zze Way of Zztonezz"
player:say("After a cracking noise a deep humming suddenly starts from somewhere below.", TALKTYPE_MONSTER_SAY)

target:transform(target.itemid == 10044 and 10045 or 10044)
return true
end
 
A nice way to debug scripts to find out where the problem lies is to add print() functions inside after an action is suppose to happen.

Limos showed me that trick a while ago and it's been very helpful when there is no error in the console.

Good Luck buddy. :)

For example:
Code:
local leverChange = {
    [1] = {1, 3, 2, 4},
    [2] = {2, 1, 3, 4},
    [3] = {2, 3, 1, 4},
    [4] = {3, 2, 4, 1},
    [5] = {4, 2, 1, 3}
}

local position = {
    [1] = {
        Position(33349, 31123, 5),
        Position(33349, 31124, 5),
        Position(33349, 31125, 5),
        Position(33349, 31126, 5),
        Position(33349, 31127, 5)
    },
    [2] = {
        Position(33352, 31126, 5),
        Position(33353, 31126, 5),
        Position(33354, 31126, 5),
        Position(33355, 31126, 5)
    }
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if target.actionid ~= 8013 then
        return false
    end
    print(1)

    if player:getStorageValue(Storage.ChildrenoftheRevolution.Questline) ~= 14 then
        player:say("The lever does not budge.", TALKTYPE_MONSTER_SAY)
        return true
    end
    print(2)

    local lever, tmp, ground = toPosition.y - 31122, {}
    for i = 1, #position[1] do
    ground = Tile(position[1]):getGround()
        if ground then
            tmp = ground.itemid
        end
    end
    print(3)

    for i = 1, #position[2] do
    ground = Tile(position[2]):getGround()
        if ground then
            ground:transform(tmp[leverChange[lever]])
            ground:getPosition():sendMagicEffect(CONST_ME_POFF)
        end
    end
    print(4)

    local groundIds, pass = {10856, 10853, 10855, 10850}, 0
    for i = 1, #position[2] do
        ground = Tile(position[2]):getGround()
        if ground and ground.itemid == groundIds then
            pass = pass + 1
        end
    end
    print(5)

    if pass ~= 4 then
        return true
    end
    print(6)

    player:setStorageValue(Storage.ChildrenoftheRevolution.Questline, 17)
    player:setStorageValue(Storage.ChildrenoftheRevolution.Mission04, 5) --Questlog, Children of the Revolution "Mission 4: Zze Way of Zztonezz"
    player:say("After a cracking noise a deep humming suddenly starts from somewhere below.", TALKTYPE_MONSTER_SAY)

    target:transform(target.itemid == 10044 and 10045 or 10044)
    return true
end
 
Hello, I have the same script and the same problem could help me fix it ?, gives no error console, only the levers do not work
 
try this

Code:
local leverChange = {
    [1] = {1, 3, 2, 4},
    [2] = {2, 1, 3, 4},
    [3] = {2, 3, 1, 4},
    [4] = {3, 2, 4, 1},
    [5] = {4, 2, 1, 3}
}

local position = {
    [1] = {
        Position(33355, 31126, 7),
        Position(33356, 31126, 7),
        Position(33357, 31126, 7),
        Position(33358, 31126, 7)
    },
    [2] = {
        Position(33352, 31126, 5),
        Position(33353, 31126, 5),
        Position(33354, 31126, 5),
        Position(33355, 31126, 5)
    }
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if target.actionid == 8013 then
        return false
    end

    if player:getStorageValue(Storage.ChildrenoftheRevolution.Questline) ~= 14 then
        player:say("The lever does not budge.", TALKTYPE_MONSTER_SAY)
        return true
    end

    local lever, tmp, ground = toPosition.y - 31122, {}
    for i = 1, #position[1] do
        ground = Tile(position[1][i]):getGround()
        if ground then
            tmp[i] = ground.itemid
        end
    end

    for i = 1, #position[2] do
        ground = Tile(position[2][i]):getGround()
        if ground then
            ground:transform(tmp[leverChange[lever][i]])
            ground:getPosition():sendMagicEffect(CONST_ME_POFF)
        end
    end

    local groundIds, pass = {10856, 10853, 10855, 10850}, 0
    for i = 1, #position[2] do
        ground = Tile(position[2][i]):getGround()
        if ground and ground.itemid == groundIds[i] then
            pass = pass + 1
        end
    end

    if pass ~= 4 then
        return true
    end

    player:setStorageValue(Storage.ChildrenoftheRevolution.Questline, 17)
    player:setStorageValue(Storage.ChildrenoftheRevolution.Mission04, 5) --Questlog, Children of the Revolution "Mission 4: Zze Way of Zztonezz"
    player:say("After a cracking noise a deep humming suddenly starts from somewhere below.", TALKTYPE_MONSTER_SAY)

    target:transform(target.itemid == 10044 and 10045 or 10044)
    return true
end
 
Last edited:
@Phoenix Black Thanks friend, works well, let me continue the next mission, but it gives me the following error in console ...

SZBjCW3.png

Sorry mi english :(
 
Back
Top