• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lever remove wall (need item) HELP

Liikuid

Spin Machine!
Joined
Jul 17, 2010
Messages
259
Reaction score
26
Location
Iquique, Chile
Ok i have a script and the fuction is the next...

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

local switchUniqueID = 21005 -- uniqueID of switch
local switchID = 1945
local switch2ID = 1946
local itemID = 2121
local itempos = {x=480, y=169, z=7, stackpos=1}
local wallpos = {x=477, y=167, z=7, stackpos=1}

local playername = getPlayerName(cid)
local getitem = getThingfromPos(itempos)
local wallchk = getThingfromPos(wallpos)

if item.uid == switchUniqueID and item.itemid == switchID and getitem.itemid == itemID and wallchk.itemid == 1058 then
doSendMagicEffect(itempos,10)
doSendMagicEffect(wallchk,10)
doRemoveItem(getitem.uid,1)
doRemoveItem(wallchk.uid,1)
doTransformItem(item.uid,item.itemid+1)
addEvent(onTimer7, 1000)
elseif item.uid == switchUniqueID and item.itemid == switch2ID then
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"You need to place the ring.")
end
return true
end


function onTimer7()

wallnewpos = {x=477, y=167, z=7}
doCreateItem(1058,1,wallnewpos)
end

I put the object and i try to move the lever and dont work and says this "you need to place the 2121 (Ring)" already place in the correct position but don't work!
bad english xD sry...
 
The ring should to be placed on a floor ?

local itempos = {x=480, y=169, z=7, stackpos=1}
change to
local itempos = {x=480, y=169, z=7, stackpos=255}
 
i replaced and dont work
06:28 You see a wedding ring.
ItemID: [2121].
Position: [X: 480] [Y: 169] [Z: 7].
are in the correct tile position and dont work and i add the correct uniqued in the lever and the actions.xml ! help
Edit:

I have 2 script more equal to that and work ! now the script 1 work correct and dont work now, i dont modified nothing! WHAT HAPPENS
 
Last edited:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local getitem = getTileItemById({x=480, y=169, z=7}, 2121).uid
	local wallchk = getTileItemById({x=477, y=167, z=7}, 1058).uid

	if item.itemid == 1945 and getitem > 0 and wallchk > 0 then
		doSendMagicEffect({x=480, y=169, z=7}, CONST_ME_TELEPORT)
		doSendMagicEffect({x=477, y=167, z=7}, CONST_ME_TELEPORT)
		doRemoveItem(getitem)
		doRemoveItem(wallchk)
		doTransformItem(item.uid, 1946)
		addEvent(doCreateItem, 1000, 1058, 1, {x=477, y=167, z=7})
	elseif item.itemid == 1946 then
		doTransformItem(item.uid, 1945)
	else
		doPlayerSendCancel(cid, 'You need to place the ring.')
	end
	return true
end
 
Last edited:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local getitem = getTileItemById({x=480, y=169, z=7}, 2121).uid
	local wallchk = getTileItemById({x=477, y=167, z=7}, 1058).uid

	if item.itemid == 1945 and getitem > 0 and wallchk.[SIZE="5"][FONT="Arial Black"][B][COLOR="DarkOrange"]itemid [/COLOR][/B][/FONT][/SIZE]> 0 then
		doSendMagicEffect({x=480, y=169, z=7}, CONST_ME_TELEPORT)
		doSendMagicEffect({x=477, y=167, z=7}, CONST_ME_TELEPORT)
		doRemoveItem(getitem)
		doRemoveItem(wallchk)
		doTransformItem(item.uid, 1946)
		addEvent(doCreateItem, 1000, 1058, 1, {x=477, y=167, z=7})
	elseif item.itemid == 1946 then
		doTransformItem(item.uid, 1945)
	else
		doPlayerSendCancel(cid, 'You need to place the ring.')
	end
	return true
end

Little fix :)

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local getitem = getTileItemById({x=996, y=998, z=7}, 2121).uid
	local wallchk = getTileItemById({x=1000, y=1003, z=7}, 1058).uid

	if item.itemid == 1945 and getitem > 0 and wallchk > 0 then
		doSendMagicEffect({x=996, y=998, z=7}, CONST_ME_TELEPORT)
		doSendMagicEffect({x=1000, y=1003, z=7}, CONST_ME_TELEPORT)
		doRemoveItem(getitem)
		doRemoveItem(wallchk)
		doTransformItem(item.uid, 1946)
		addEvent(doCreateItem, 1000, 1058, 1,{x=1000, y=1003, z=7} )
	elseif item.itemid == 1946 then
		doTransformItem(item.uid, 1945)
	else
		doPlayerSendCancel(cid, 'You need to place the ring.')
	end
	return true
end
 
ok i gonna try i edit and show the result. Thanks for now...
EDIT: YEEEEEEEEEEEEE IT WORK THX!!!!!!!!!!! THX THX THX XDDDD.
uff thx.
 
Last edited:
Back
Top