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

Trap door

Status
Not open for further replies.

BugaS

Donżuan
Joined
Mar 12, 2009
Messages
1,219
Reaction score
9
Location
NYC
Mam taki problem, że mam otwarty trap door na mapie (id 461).
I po kilku minutach trapy sie zamykają(id 462) i nie da sie zejsc na dol.

Zmieniłem w items.xml na :

<item id="461" article="a" name="closed trapdoor"/>
<attribute key="floorchange" value="down"/>
<item id="462" article="an" name="open trapdoor">
<attribute key="floorchange" value="down"/>
<attribute key="decayTo" value="461"/>
<attribute key="duration" value="120"/>
</item>

Nic to nie dalo.

A oto decay.lua z movements:

LUA:
function onStepIn(cid, item, position, fromPosition)
	doTransformItem(item.uid, item.itemid + 1)
	doDecayItem(item.uid)
	return true
end
 
<attribute key="decayTo" value="461"/>
<attribute key="duration" value="120"/>

nie dziwie sie, usun to w pizdu
 
closingdoors.lua

LUA:
function onStepOut(cid, item, position, fromPosition)
	local newPosition = {x = position.x, y = position.y, z = position.z}
	if(isInArray(verticalOpenDoors, item.itemid)) then
		newPosition.x = newPosition.x + 1
	else
		newPosition.y = newPosition.y + 1
	end

	doRelocate(position, newPosition)
	local tmpPos = {x = position.x, y = position.y, z = position.z, stackpos = -1}
	local tileCount = getTileThingByPos(tmpPos)

	local i = 1
	local tmpItem = {uid = 1}
	while(tmpItem.uid ~= 0 and i < tileCount) do
		tmpPos.stackpos = i
		tmpItem = getTileThingByPos(tmpPos)
		if(tmpItem.uid ~= item.uid and tmpItem.uid ~= 0 and isMoveable(tmpItem.uid)) then
			doRemoveItem(tmpItem.uid)
		else
			i = i + 1
		end
	end

	doTransformItem(item.uid, item.itemid - 1)
	return true
end
 
Status
Not open for further replies.
Back
Top