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

Door Problem

Magictibiaman

New Member
Joined
May 25, 2009
Messages
371
Reaction score
0
my goal is to open the door for 5 secs, then close the door
and make it that you can't try to open the door with the lever until the door is closed.

my problem is that is can't find the door when it is open

it keeps saying "luaDoTransformItem(). item not found"

it has no problem opening the door it just can't close it

help please

Code:
	if ((item.uid == 7031) and (doorwait == 1)) then
		
		door1 = getThingfromPos(doorpos1)
		doTransformItem(door1.uid,door1.itemid+1)
		doorwait = 0	
		door1 = getThingfromPos(doorpos1)
		addEvent(doTransformItem(5 * 1000,door1.uid,door1.itemid-1))

		
	end
 
item uids change between script callbacks, which means that you'll have to get it again

Code:
	if(item.uid == 7031 and doorwait == 1) then
		local door1 = getTileItemById(doorpos1, XxXx) -- replace XxXx with door itemid
		doTransformItem(door1.uid, door1.itemid + 1)
		doorwait = 0
		local function transform(pos, oldId, newId)
			local v = getTileItemById(pos, oldId).uid
			return v > 0 and doTransformItem(v, newId)
		end
		addEvent(transform, 5 * 1000, getThingPos(door1.uid), door1.itemid + 1, door1.itemid - 1)
	end
 
Back
Top