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

Level Doors HELP!

DeeJay

New Member
Joined
Oct 23, 2008
Messages
47
Reaction score
0
Location
Poland
I have set actionid for example 1080 on doors and when I try to pass the doors nothing happens, it has actionid for sure...
Dunno what is the problem..
TFS 0.3.6pl1
 
Last edited:
What with other doors? Probably you have something wrong with doors.lua

Check doors.lua and ids in actions.xml

Code:
<!-- Doors -->
	<action fromid="1209" toid="1214" event="script" value="other/doors.lua"/>
	<action fromid="1219" toid="1262" event="script" value="other/doors.lua"/>
	<action fromid="1539" toid="1542" event="script" value="other/doors.lua"/>
	<action fromid="2086" toid="2092" event="script" value="other/doors.lua"/>
	<action fromid="3535" toid="3552" event="script" value="other/doors.lua"/>
	<action fromid="4913" toid="4918" event="script" value="other/doors.lua"/>
	<action fromid="5082" toid="5085" event="script" value="other/doors.lua"/>
	<action fromid="5098" toid="5145" event="script" value="other/doors.lua"/>
	<action fromid="5278" toid="5295" event="script" value="other/doors.lua"/>
	<action fromid="5515" toid="5518" event="script" value="other/doors.lua"/>
	<action fromid="5732" toid="5737" event="script" value="other/doors.lua"/>
	<action fromid="5745" toid="5749" event="script" value="other/doors.lua"/>
	<action fromid="6192" toid="6209" event="script" value="other/doors.lua"/>
	<action fromid="6249" toid="6266" event="script" value="other/doors.lua"/>
	<action fromid="6795" toid="6802" event="script" value="other/doors.lua"/>
	<action fromid="6891" toid="6908" event="script" value="other/doors.lua"/>
	<action fromid="7033" toid="7050" event="script" value="other/doors.lua"/>
	<action fromid="7054" toid="7057" event="script" value="other/doors.lua"/>
	<action fromid="8541" toid="8558" event="script" value="other/doors.lua"/>
	<action fromid="9165" toid="9184" event="script" value="other/doors.lua"/>
	<action fromid="9267" toid="9284" event="script" value="other/doors.lua"/>
	<action itemid="10032" event="script" value="other/doors.lua"/>
	<action itemid="10091" event="script" value="other/doors.lua"/>
	<action fromid="10268" toid="10285" event="script" value="other/doors.lua"/>
	<action fromid="10468" toid="10486" event="script" value="other/doors.lua"/>
	<action fromid="10774" toid="10776" event="script" value="other/doors.lua"/>
	<action fromid="10779" toid="10785" event="script" value="other/doors.lua"/>
	<action fromid="10788" toid="10791" event="script" value="other/doors.lua"/>

and doors.lua for your tfs

Code:
local function checkStackpos(item, position)
	position.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
	local thing = getThingfromPos(position)
	position.stackpos = STACKPOS_TOP_FIELD
	local field = getThingfromPos(position)
	if(item.uid ~= thing.uid and thing.itemid >= 100 or field.itemid ~= 0) then
		return FALSE
	end
	return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getItemLevelDoor(item.itemid) > 0) then
		if(item.actionid > 0 and getPlayerLevel(cid) >= (item.actionid - getItemLevelDoor(item.itemid))) then
			doTransformItem(item.uid, item.itemid + 1)
			doTeleportThing(cid, toPosition, TRUE)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
		end
		return TRUE
	end
	if(isInArray(specialDoors, item.itemid) == TRUE) then
		if(item.actionid ~= 0 and getPlayerStorageValue(cid, item.actionid) ~= -1) then
			doTransformItem(item.uid, item.itemid + 1)
			doTeleportThing(cid, toPosition, TRUE)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
		end
		return TRUE
	end
	if(isInArray(keys, item.itemid) == TRUE) then
		if(itemEx.actionid > 0) then
			if(item.actionid == itemEx.actionid) then
				if doors[itemEx.itemid] ~= nil then
					doTransformItem(itemEx.uid, doors[itemEx.itemid])
					return TRUE
				end
			end
			doPlayerSendCancel(cid, "The key does not match.")
			return TRUE
		end
		return FALSE
	end
	if(isInArray(horizontalOpenDoors, item.itemid) == TRUE and checkStackpos(item, fromPosition) == TRUE) then
		local newPosition = toPosition
		newPosition.y = newPosition.y + 1
		local doorPosition = fromPosition
		doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
		local doorCreature = getThingfromPos(doorPosition)
		if(doorCreature.itemid ~= 0) then
			if(getTilePzInfo(doorPosition) == TRUE and getTilePzInfo(newPosition) == FALSE and doorCreature.uid ~= cid) then
				doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
			else
				doTeleportThing(doorCreature.uid, newPosition, TRUE)
				if(isInArray(closingDoors, item.itemid) ~= TRUE) then
					doTransformItem(item.uid, item.itemid - 1)
				end
			end
			return TRUE
		end
		doTransformItem(item.uid, item.itemid - 1)
		return TRUE
	end
	if(isInArray(verticalOpenDoors, item.itemid) == TRUE and checkStackpos(item, fromPosition) == TRUE) then
		local newPosition = toPosition
		newPosition.x = newPosition.x + 1
		local doorPosition = fromPosition
		doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
		local doorCreature = getThingfromPos(doorPosition)
		if(doorCreature.itemid ~= 0) then
			if(getTilePzInfo(doorPosition) == TRUE and getTilePzInfo(newPosition) == FALSE and doorCreature.uid ~= cid) then
				doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
			else
				doTeleportThing(doorCreature.uid, newPosition, TRUE)
				if(isInArray(closingDoors, item.itemid) ~= TRUE) then
					doTransformItem(item.uid, item.itemid - 1)
				end
			end
			return TRUE
		end
		doTransformItem(item.uid, item.itemid - 1)
		return TRUE
	end
	if(doors[item.itemid] ~= nil and checkStackpos(item, fromPosition) == TRUE) then
		if(item.actionid == 0) then
			doTransformItem(item.uid, doors[item.itemid])
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
		end
		return TRUE
	end
	return FALSE
end
 
i can open and close other doors but all with lvl required nah...
its really weird, maybe i have to add something in actions, because I didnt see anything with action id 1000~ and door lua script..
 
Back
Top