i have a dude, what does it?
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(item.itemid == 11106 and itemEx.actionid == 8013) then
if(getPlayerStorageValue(cid, 1050) == 16) then
lever = toPosition.y - 31122
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}
}
tmp = {}
pos = {
{x = 33355, y = 31126, z = 7, stackpos = STACKPOS_GROUND},
{x = 33356, y = 31126, z = 7, stackpos = STACKPOS_GROUND},
{x = 33357, y = 31126, z = 7, stackpos = STACKPOS_GROUND},
{x = 33358, y = 31126, z = 7, stackpos = STACKPOS_GROUND}
}
for i = 1, 4 do
tmp[1] = getThingFromPos(pos
).itemid
end
for i = 1, 4 do
doTransformItem(getThingFromPos(pos).uid, tmp[leverChange[lever]])
doSendMagicEffect(pos, CONST_ME_POFF)
end
pass = 0
configuration = {
10850,
10853,
10856,
10855
}
for i = 1, 4 do
if(getThingFromPos(pos).itemid == configuration) then
pass = pass + 1
end
end
if(pass == 4) then
setPlayerStorageValue(cid, 1050, 17)
doCreatureSay(cid, "You found the right combination. You should report to Zalamon.", TALKTYPE_ORANGE_1)
end
doTransformItem(itemEx.uid, itemEx.itemid == 10044 and 10045 or 10044, 1)
end
end
return true
end
- - - Updated - - -
and this other
local pos = {
{x = 33253, y = 31081, z = 8},
{x = 33259, y = 31090, z = 8},
{x = 33266, y = 31085, z = 8},
{x = 33263, y = 31094, z = 8}
}
function doClearMissionArea(fromPos, toPos)
for x = fromPos.x, toPos.x do
for y = fromPos.y, toPos.y do
for z = fromPos.z, toPos.z do
if(getTopCreature({x = x, y = y, z = z}).uid > 0) then
if(isPlayer(getTopCreature({x = x, y = y, z = z}).uid)) then
doTeleportThing(getTopCreature({x = x, y = y, z = z}).uid, {x = 33353, y = 31410, z = 8})
doSendMagicEffect({x = 33353, y = 31410, z = 8}, CONST_ME_TELEPORT)
setPlayerStorageValue(getTopCreature({x = x, y = y, z = z}).uid, 1050, 20)
else
doRemoveCreature(getTopCreature({x = x, y = y, z = z}).uid)
end
end
end
end
end
return true
end
function onStepIn(cid, item, position, lastPosition)
start = false
if(getPlayerStorageValue(cid, 1050) == 19) then
if(item.actionid == 8014) then
for i = 1, 4 do
if(getTopCreature(pos).uid > 0) then
if(isPlayer(getTopCreature(pos).uid)) then
if(getGlobalStorageValue(8014) < 1) then
doCreatureSay(getTopCreature(pos).uid, "A clicking sound tatters the silence.", TALKTYPE_ORANGE_1)
start = true
end
end
end
end
if(start == true) then
doTransformItem(getTileItemById({x = 33265, y = 31116, z = 8}, 3653).uid), 3687)
addEvent(doTransformItem, 30 * 1000, getTileItemById({x = 33265, y = 31116, z = 8}, 3687).uid), 3653)
setGlobalStorageValue(8014, 1)
addEvent(setGlobalStorageValue, 8014, 0)
creature = ""
for k = 1, 4 do
for j = 1, 20 do
if(k < 3) then
creature = "eternal guardian"
else
creature = "lizard chosen"
end
summonPos = {x = math.random(33239, 33295), y = math.random(31100, 31132), z = 7}
addEvent(doSummonCreature, k * 30 * 1000, creature, summonPos)
addEvent(doSendMagicEffect, k * 30 * 1000, summonPos, CONST_ME_TELEPORT)
end
end
addEvent(doClearMissionArea, 5 * 30 * 1000, {x = 33239, y = 31100, z = 7}, {x = 33295, y = 31132, z = 7})
end
end
end
return true
end
- - - Updated - - -
the error on console is it :
[3/8/2013 2:16:9] [Error - LuaInterface::loadFile] ...s/children of the revolution quest/childrenOfTheRevolutionQuestClick.lua:42: unexpected symbol near ','
[3/8/2013 2:16:9] [Error - Event::checkScript] Cannot load script (data/movements/scripts/children of the revolution quest/childrenOfTheRevolutionQuestClick.lua)
[3/8/2013 2:16:10] ...s/children of the revolution quest/childrenOfTheRevolutionQuestClick.lua:42: unexpected symbol near ','