Xaiman
New Member
- Joined
- Feb 27, 2010
- Messages
- 94
- Reaction score
- 0
Im using zyntax's lever riddle script yet i can get the switchs to reset and for the teleporter to go away.
Otlanders arent to helpfull :>
Code:
local config = {
switches = {
[1] = {pos = {x=239, y=78, z=1, stackpos=1}},
[2] = {pos = {x=240, y=78, z=1, stackpos=1}},
[3] = {pos = {x=241, y=78, z=1, stackpos=1}},
[4] = {pos = {x=242, y=78, z=1, stackpos=1}}
},
correct = {
[1] = {id = 1946},
[2] = {id = 1945},
[3] = {id = 1945},
[4] = {id = 1946}
},
teleporter = 1387,
telepos = {x=244, y=79, z=1, stackpos=1},
teleto = {x=252, y=86, z=3},
check = {
[1] = false,
[2] = false,
[3] = false,
[4] = false
},
}
local resettime = 30000
local function reset(item)
for k, v in pairs(config.switches) do
if getThingFromPos(config.switches[k].pos).itemid == 1946 then
doTransformItem(item.uid, 1945)
end
end
end
function onStepIn(cid, item, pos, fromPos)
if isPlayer(cid) == TRUE then
for i = 1, #config.switches do
if getThingFromPos(config.switches[i].pos).itemid == config.correct[i].id then
config.check[i] = true
else
config.check[i] = false
end
end
if (config.check[1] and config.check[2] and config.check[3] and config.check[4]) == true then
setItemAttr(doCreateTeleport(config.teleporter, config.teleto, config.telepos), "aid", 9001)
doPlayerSay(cid, 'Congratulations '..getPlayerName(cid)..'!\nYou solved the lever riddle!', 19)
addEvent(reset, resettime, item)
else
doPlayerSay(cid, 'Fail.', 19)
end
end
return true
end
Last edited by a moderator: