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

Item Protection questions

krankthefunk

New Member
Joined
Jan 7, 2008
Messages
127
Reaction score
2
Well when I look in the function of TFS 0.3.4.2 there are 2 functions.
getItemProtection(uid) and doSetItemProtection(uid, value)

Anyone figured out how this work? I tried many ways before but it looks like it doesn't work so my question is

Is there a special way to use it?
or
The function is not working properly
 
It returns script protection. :)



From luascript.cpp:
Code:
int32_t LuaScriptInterface::luaGetItemProtection(lua_State* L)
{
	//getItemProtection(uid)
	ScriptEnviroment* env = getScriptEnv();

	Item* item = env->getItemByUID(popNumber(L));
	if(!item)
	{
		reportErrorFunc(getErrorDesc(LUA_ERROR_ITEM_NOT_FOUND));
		lua_pushboolean(L, false);
		return 1;
	}

	lua_pushboolean(L, item->isScriptProtected());
	return 1;
}
 
Back
Top