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

Windows Walkback.lua

Cornex

Web Developer
Staff member
Global Moderator
Joined
Jun 15, 2008
Messages
3,444
Solutions
5
Reaction score
1,166
Location
Sweden
Hello! When im etc going on a chest i got console error :

PHP:
[30/12/2012 10:3:29] [Error - MoveEvents Interface] 
[30/12/2012 10:3:29] data/movements/scripts/walkback.lua:onStepIn
[30/12/2012 10:3:29] Description: 
[30/12/2012 10:3:29] data/movements/scripts/walkback.lua:5: attempt to call global 'isContainer' (a nil value)
[30/12/2012 10:3:29] stack traceback:
[30/12/2012 10:3:29] 	data/movements/scripts/walkback.lua:5: in function <data/movements/scripts/walkback.lua:3>

This is the script:

PHP:
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


Any clue someone? repp ofc
 
Looking through the sources, it seems isContainer is not supported in 0.3, yet it shows it's available according to LUAFUNCTIONS.
 
Tested your script to be sure, didn't gave me errors but it also didn't do anything.
This one works fine on 0.3 and 0.4, so try it like 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 -- player just logged in
		fromPosition = getTownTemplePosition(getPlayerTown(cid))
		doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
	end

	doTeleportThing(cid, fromPosition, true)
	return true
end

Else, which server are you using?
 
Back
Top