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

Solved Wat this error?

Vrotz

Member
Joined
Apr 7, 2011
Messages
1,071
Reaction score
7
Location
Brazil
Hello Regards-OtLanders.


I've this problem and i didnt know because thats wrong!

Code:
[Error - MoveEvents Interface]
data/movements/scripts/walkback.lua:onStepIn
Description:
data/movements/scripts/walkback.lua:8: attempt to call global 'isContainer' (a nil value)
stack traceback:
        data/movements/scripts/walkback.lua:8: in function <data/movements/scripts/walkback.lua:3>

Here this script:
Code:
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
 
You have to change your lib because yours are to old that's why. Or just change whole 050-function.lua.
It will not work, because this function is in the source code.

Here is a function, you must still the register.
PHP:
int32_t LuaScriptInterface::luaIsContainer(lua_State* L)
{
        //isContainer(uid)
        ScriptEnviroment* env = getEnv();
        lua_pushboolean(L, env->getContainerByUID(popNumber(L)) ? true : false);
        return 1;
}
 
Back
Top