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

azzkaban

Monster Maker
Joined
Feb 23, 2010
Messages
1,101
Reaction score
194
Location
Iquique Chile
Hi! I need little script.

Example:

In pos: x=73, y=590, z=7 Item 407, but I click on lever and remove itemid 407 and create itemid 3219 and I click again lever, back itemid 407.

Can you help me?
 
Here you go Azzkaban:

Code:
local TILE_POS = {x = 73, y = 590, z = 7}
local RELOCATE_POS = {x = 73, y = 589, z = 7}
local ITEM1= 407
local ITEM2 = 3219

local function swapTile()
	local blockingItem = getTileItemById(TILE_POS, ITEM1)
	if blockingItem and blockingItem.itemid == ITEM1 then
		doRelocate(TILE_POS, RELOCATE_POS)
		doCreateItem(ITEM2, TILE_POS)
	else
		doCreateItem(ITEM1, TILE_POS)
	end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		doTransformItem(item.uid, 1946)
		
		swapTile()
	elseif item.itemid == 1946 then
		doTransformItem(item.uid, 1945)
		
		swapTile()
	end
	return TRUE
end

And this in the actions.xml:
Code:
<action actionid="12345" script="swap_tile_lever.lua"/>
 
Last edited:
Back
Top