• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua A simple help

What version are you using exactly? I found this inside TFS 0.4 r3777 (8.6x). So it should work.

C++:
int32_t LuaInterface::luaDoPlayerAddSpentMana(lua_State* L)
{
    //doPlayerAddSpentMana(cid, amount[, useMultiplier = true])
    bool multiplier = true;
    if(lua_gettop(L) > 2)
        multiplier = popNumber(L);

    uint32_t amount = popNumber(L);
    ScriptEnviroment* env = getEnv();
    if(Player* player = env->getPlayerByUID(popNumber(L)))
    {
        player->addManaSpent(amount, multiplier);
        lua_pushboolean(L, true);
    }
    else
    {
        errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
        lua_pushboolean(L, false);
    }

    return 1;
}
 
Back
Top