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

Can someone help me whit Poi Lever.....

111a111

Banned User
Joined
Jan 29, 2008
Messages
78
Reaction score
0
Hello can someone help me whit the script for the 15 lever's in poi
my don't work. here is my script........




function onUse(cid, item, frompos, item2, topos)

wallpos = {x=458, y=1386, z=11, stackpos=1}
wall = getThingfromPos(wallpos)

leverpos1 = {x=481, y=1387, z=11, stackpos=1}
lever1 = getThingfromPos(leverpos1)
leverpos2 = {x=498, y=1381, z=13, stackpos=1}
lever2 = getThingfromPos(leverpos2)
leverpos3 = {x=450, y=1405, z=13, stackpos=1}
lever3 = getThingfromPos(leverpos3)
leverpos4 = {x=496, y=1402, z=14, stackpos=1}
lever4 = getThingfromPos(leverpos4)
leverpos5 = {x=494, y=1383, z=11, stackpos=1}
lever5 = getThingfromPos(leverpos5)
leverpos6 = {x=453, y=1371, z=11, stackpos=1}
lever6 = getThingfromPos(leverpos6)
leverpos7 = {x=494, y=1408, z=12, stackpos=1}
lever7 = getThingfromPos(leverpos7)

if item.itemid == 1946 and wall.itemid == 0 and lever1.itemid == 1946 and lever2.itemid == 1946 and lever3.itemid == 1946 and lever4.itemid == 1946 and lever5.itemid == 1946 and lever6.itemid == 1946 and lever7.itemid == 1946 then
doCreateItem(1304,1,wallpos)
doTransformItem(item.uid,1945)
elseif item.itemid == 1945 and wall.itemid == 1304 and lever1.itemid == 1946 and lever2.itemid == 1946 and lever3.itemid == 1946 and lever4.itemid == 1946 and lever5.itemid == 1946 and lever6.itemid == 1946 and lever7.itemid == 1946 then
doRemoveItem(wall.uid,1)
doTransformItem(item.uid,1946)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return 1
end
 
Last edited:
It's just don't work the lever can't use like i miss 1 of the 15 lever and i looking for the last lever in like 40min and no more lever and not work ;(((
 
Considering I only see 1 change from your if statement and your elseif statement, there might be an issue there. That would be the item.itemid == 1945. Try and change the other leverids to 1945 as well and see if that doesnt fix your issue.
 
First of all put it between code tags: (lua in this case)
Lua:
function onUse(cid, item, frompos, item2, topos)

wallpos = {x=458, y=1386, z=11, stackpos=1}
wall = getThingfromPos(wallpos)

leverpos1 = {x=481, y=1387, z=11, stackpos=1}
lever1 = getThingfromPos(leverpos1)
leverpos2 = {x=498, y=1381, z=13, stackpos=1}
lever2 = getThingfromPos(leverpos2)
leverpos3 = {x=450, y=1405, z=13, stackpos=1}
lever3 = getThingfromPos(leverpos3)
leverpos4 = {x=496, y=1402, z=14, stackpos=1}
lever4 = getThingfromPos(leverpos4)
leverpos5 = {x=494, y=1383, z=11, stackpos=1}
lever5 = getThingfromPos(leverpos5)
leverpos6 = {x=453, y=1371, z=11, stackpos=1}
lever6 = getThingfromPos(leverpos6)
leverpos7 = {x=494, y=1408, z=12, stackpos=1}
lever7 = getThingfromPos(leverpos7)

if item.itemid == 1946 and wall.itemid == 0 and lever1.itemid == 1946 and lever2.itemid == 1946 and lever3.itemid == 1946 and lever4.itemid == 1946 and lever5.itemid == 1946 and lever6.itemid == 1946 and lever7.itemid == 1946 then
doCreateItem(1304,1,wallpos)
doTransformItem(item.uid,1945)
elseif item.itemid == 1945 and wall.itemid == 1304 and lever1.itemid == 1946 and lever2.itemid == 1946 and lever3.itemid == 1946 and lever4.itemid == 1946 and lever5.itemid == 1946 and lever6.itemid == 1946 and lever7.itemid == 1946 then
doRemoveItem(wall.uid,1)
doTransformItem(item.uid,1946)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return true
end

Also i've changed the "return 1" to "return true" which might fix it.
 
Code:
local levers = {
	{x=481, y=1387, z=11},
	{x=498, y=1381, z=13},
	{x=450, y=1405, z=13},
	{x=496, y=1402, z=14},
	{x=494, y=1383, z=11},
	{x=453, y=1371, z=11},
	{x=494, y=1408, z=12}
}
local stonePos = {x=458, y=1386, z=11}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local k = true
	for _, v in ipairs(levers) do
		local k = getTileItemById(v, 1946).uid > 0
		if not k then
			break
		end
	end
	if k then
		return item.itemid == 1945 and doRemoveItem(getTileItemById(stonePos, 1304).uid) or doCreateItem(1304, 1, stonePos), doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
	end
	return doPlayerSendCancel(cid, "Sorry, not possible.")
end
 
Back
Top