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

Little OnStepin riddle im working on

Star Fox

New Member
Joined
May 15, 2010
Messages
17
Reaction score
0
This is the script im working on.

Code:
local tile1 = getThingFromPos({x=915, y=296, z=7, stackpos=1})
local tile2 = getThingFromPos({x=916, y=296, z=7, stackpos=1})
local tile3 = getThingFromPos({x=917, y=296, z=7, stackpos=1})
local tile4 = getThingFromPos({x=918, y=296, z=7, stackpos=1})

local item1 = (5616)
local item2 = (5953)

function onStepIn(cid, item, pos, fromPos)
	if item.uid == 8561 then
		if tile1.itemid == item1 then
			doTransformItem(getThingFromPos({x=915, y=296, z=7, stackpos=1}).uid, item2)
		elseif tile1.itemid == item2 then
			doTransformItem(getThingFromPos({x=915, y=296, z=7, stackpos=1}).uid, item1)
		end
	elseif item.uid == 8562 then
		if tile2.itemid == item1 then
			doTransformItem(getThingFromPos({x=916, y=296, z=7, stackpos=1}).uid, item2)
		elseif tile2.itemid == item2 then
			doTransformItem(getThingFromPos({x=916, y=296, z=7, stackpos=1}).uid, item1)
		return true
		end
	elseif item.uid == 8563 then
		if tile3.itemid == item1 then
			doTransformItem(getThingFromPos({x=917, y=296, z=7, stackpos=1}).uid, item2)
		elseif tile3.itemid == item2 then
			doTransformItem(getThingFromPos({x=917, y=296, z=7, stackpos=1}).uid, item1)
		return true
		end
	elseif item.uid == 8564 then
		if tile4.itemid == item1 then
			doTransformItem(getThingFromPos({x=918, y=296, z=7, stackpos=1}).uid, item2)
		elseif tile4.itemid == item2 then
			doTransformItem(getThingFromPos({x=918, y=296, z=7, stackpos=1}).uid, item1)
		return true
		end
	end
	return true
end

It works where you step on a tile and it transforms an item on a different tile to another item. The object is to get the correct order of items.

My problem is that when i do /reloadmovements it works, i can step on all the 4 sqm (that are suppose to transform the items) and it does, but if i step on them again it wont transform the item.

It doesnt matter which item it is, it will work no matter what after i do /reload movements.
 
Code:
function onStepIn(cid, item, pos, fromPos)
	local tile = getThingFromPos({x=item.uid - 7646, y=296, z=7, stackpos=1})
	if isInArray({5616, 5953}, tile.itemid) then
		doTransformItem(tile.uid, tile.itemid == 5616 and 5953 or 5616)
	end
end
 
Back
Top