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

[Action] Lever that removes multiple items

Status
Not open for further replies.

tiddpd

PHP Scripter
Joined
Apr 16, 2008
Messages
331
Reaction score
0
When lever is pulled this script will remove items on the stauepos, and when pulled again it will recreate them.

Save as whatever.lua

Code:
function onUse(cid, item, frompos, item2, topos)
	
	local statuePos = {x = 314, y = 97, z = 8, stackpos=1} //edit these positions to the positons of your items.
	local statuePos2 = {x = 314, y = 98, z = 8, stackpos=1}
	local statuePos3 = {x = 313, y = 97, z = 8, stackpos=1}	
	local statuePos4 = {x = 313, y = 98, z = 8, stackpos=1}
	local statuePos5 = {x = 315, y = 97, z = 8, stackpos=1}

	local statue = getThingfromPos(statuePos)
	local statue2 = getThingfromPos(statuePos2)
	local statue3 = getThingfromPos(statuePos3)
	local statue4 = getThingfromPos(statuePos4)
	local statue5 = getThingfromPos(statuePos5)


	
	if item.itemid == 1945 then
		doRemoveItem(statue.uid,1)
		doRemoveItem(statue2.uid,1)
		doRemoveItem(statue3.uid,1)
		doRemoveItem(statue4.uid,1)
		doRemoveItem(statue5.uid,1)
		doTransformItem(item.uid,1946)
		doPlayerSendTextMessage(cid,22,"your items have dispapeared") // what comes up on screen when items disapear
	elseif item.itemid == 1946 then
		doCreateItem(6289,1,statuePos)
		doCreateItem(6289,1,statuePos2)
		doCreateItem(6289,1,statuePos3)
		doCreateItem(6289,1,statuePos4)
		doCreateItem(6289,1,statuePos5)
		doTransformItem(item.uid,1945) 
		doPlayerSendTextMessage(cid,22,"your items have re apeared") // what comes on screen when items reapear
	end
end

Then save this is actions.xml
Code:
<action uniqueid="1234" script="whatever.lua"/>
 
Status
Not open for further replies.
Back
Top