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

Step on quest

Bufo

-.-'
Joined
Jul 30, 2010
Messages
134
Reaction score
12
Location
P(R)OLAND
I have problem witch quest.
Player can step on quest and at some quests can take showpiece award
beztytuuiyj.png
 
Code:
	<!-- Walkback when walking on quest chest -->
	<movevent type="StepIn" itemid="1738" event="script" value="walkback.lua"/>
	<movevent type="StepIn" itemid="1740" event="script" value="walkback.lua"/>
	<movevent type="StepIn" fromid="1746" toid="1749" event="script" value="walkback.lua"/>
walkback.lua
Code:
local SPECIAL_QUESTS = {2001}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(not isPlayer(cid) or
		(isContainer(item.uid) and (not isInArray(SPECIAL_QUESTS, item.actionid) and item.uid > 65535) or
		getTileInfo(position).creatures <= 1)) then
			return true
	end

	if(lastPosition.x == 0) then -- player just logged in
		lastPosition = getTownTemplePosition(getPlayerTown(cid))
		doSendMagicEffect(lastPosition, CONST_ME_TELEPORT)
	end

	doTeleportThing(cid, lastPosition, true)
	return true
end
 
Try this:
Lua:
local SPECIAL_QUESTS = {2001}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(not isPlayer(cid)) then
		return true
	end

	if(isContainer(item.uid)) then
		if(not isInArray(SPECIAL_QUESTS, item.actionid) and item.uid > 65535) then
			return true
		end
	elseif(getTileInfo(position).creatures <= 1) then
		return true
	end
	
	if(fromPosition.x == 0) then 
		fromPosition = getTownTemplePosition(getPlayerTown(cid))
		doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
	end

	doTeleportThing(cid, fromPosition, true)
	return true
end
 
Loving me requires to rep me :D

Your script was bugged since
Lua:
getTileInfo(position).creatures <= 1))
was in the same condition as the others
 
Loving me requires to rep me :D

Your script was bugged since
Lua:
getTileInfo(position).creatures <= 1))
was in the same condition as the others

I know this topic is quite old .. but .. why does it exist? I mean .. why can only 1 creature be on a chest at a time?
 
Back
Top