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

Login LUA Error.. :/ "attempt to call global 'isInArray' (a nil value)"

LIINDI

New Member
Joined
Mar 14, 2018
Messages
78
Solutions
1
Reaction score
3
Hey guys! So the last couple of days i've tried to start my own 10.98 RL server with hardly any sucess at all.. Until now.

In this case i can start the server and my friends can log onto the acc page and everything works fine until they are gonna try to log into the character in tibia..

The character loading freezes and this error pops up in my console:


Liindi has logged in.

Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/others/login.lua:onLogin
data/creaturescripts/scripts/others/login.lua:122: attempt to call global 'isInArray' (a nil value)
stack traceback:
[C]: in function 'isInArray'
data/creaturescripts/scripts/others/login.lua:122: in function <data/creaturescripts/scripts/others/login.lua:73>

Liindi has logged out.


Does anyone know how to fix this? :(

Regards
LINDI
 
Solution
Yeah your right it's kinda shady. I didn't compile it i just added the data packs included etc.

Cool thanks i haven't seen that one before. So with that one everything is included? You dont have to compile etc?
Is it RL map or do i have to add that myself? :)
is RL MAP,
you need to compile more everything you need to know will find in the README of the page that I sent above.
However it is in Portuguese, if it is not your usual language you will have to translate.
More works very well and is constantly updated and updated.
local events = {
'ElementalSpheresOverlords',
'BigfootBurdenVersperoth',
'Razzagorn',
'Shatterer',
'Zamulosh',
'The Hunger',
'The Rage',
'Eradicator',
'Eradicator1',
'Rupture',
'World Devourer',
'Tarbaz',
'Shulgrax',
'Ragiaz',
'Plagirath',
'Mazoran',
'Destabilized',
'BigfootBurdenWiggler',
'SvargrondArenaKill',
'NewFrontierShardOfCorruption',
'NewFrontierTirecz',
'ServiceOfYalaharDiseasedTrio',
'ServiceOfYalaharAzerus',
'ServiceOfYalaharQuaraLeaders',
'InquisitionBosses',
'InquisitionUngreez',
'KillingInTheNameOfKills',
'KillingInTheNameOfKillss',
'KillingInTheNameOfKillsss',
'MastersVoiceServants',
'SecretServiceBlackKnight',
'ThievesGuildNomad',
'WotELizardMagistratus',
'WotELizardNoble',
'WotEKeeper',
'WotEBosses',
'WotEZalamon',
'WarzoneThree',
'PlayerDeath',
'AdvanceSave',
'bossesWarzone',
'AdvanceRookgaard',
'PythiusTheRotten',
'DropLoot',
'Yielothax',
'BossParticipation',
'Energized Raging Mage',
'Raging Mage',
'modalMD1',
'VibrantEgg',
'DeathCounter',
'KillCounter',
'bless1'

}

local function onMovementRemoveProtection(cid, oldPosition, time)
local player = Player(cid)
if not player then
return true
end

local playerPosition = player:getPosition()
if (playerPosition.x ~= oldPosition.x or playerPosition.y ~= oldPosition.y or playerPosition.z ~= oldPosition.z) or player:getTarget() then
player:setStorageValue(Storage.combatProtectionStorage, 0)
return true
end

addEvent(onMovementRemoveProtection, 1000, cid, oldPosition, time - 1)
end

function onLogin(player)
local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
if player:getLastLoginSaved() <= 0 then
loginStr = loginStr .. ' Please choose your outfit.'
player:sendTutorial(1)
else
if loginStr ~= '' then
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
end

loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))
end

player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)

local playerId = player:getId()

-- Stamina
nextUseStaminaTime[playerId] = 1

-- STAMINA DEVIDO A QUEDAS START

--local stamina_full = 42 * 60 -- config. 42 = horas
-- if player:getStamina() >= stamina_full then
-- player:sendCancelMessage("Your stamina is already full.")
-- elseif player:getPremiumDays() < 1 then
-- player:sendCancelMessage("You must have a premium account.")
-- else
-- player:setStamina(stamina_full)
-- player:sendTextMessage(MESSAGE_INFO_DESCR, "Your stamina has been refilled.")
-- end

-- STAMINA DEVIDO A QUEDAS END

-- Promotion
--[[ local vocation = player:getVocation()
local promotion = vocation:getPromotion()
if player:isPremium() then
local value = player:getStorageValue(Storage.Promotion)
if not promotion and value ~= 1 then
player:setStorageValue(Storage.Promotion, 1)
elseif value == 1 then
player:setVocation(promotion)
end
elseif not promotion then
player:setVocation(vocation:getDemotion())
end--]]

-- ABRIR CHANNELS
if(not isInArray({1,2,3,5,6,7,8}, player:getVocation():getId()) or player:getLevel() < 6) then
-- player:openChannel(7) -- help channel
player:openChannel(3) -- world chat
player:openChannel(6) -- advertsing rook main
else
-- player:openChannel(7) -- help channel
player:openChannel(3) -- world chat
player:openChannel(5) -- advertsing main
end

--
-- Rewards
local rewards = #player:getRewardList()
if(rewards > 0) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))
end

-- Update player id
local stats = player:inBossFight()
if stats then
stats.playerId = player:getId()
end

-- fury gates

if Game.getStorageValue(GlobalStorage.FuryGates, (9710)) == 1 then -- for venore
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Venore Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9711)) == 2 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Abdendriel Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9712)) == 3 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Thais Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9713)) == 4 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Carlin Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9714)) == 5 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Edron Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9716)) == 6 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Kazordoon Today.')
end


player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, '[TIBIA COINS] For purchases above 20 BRL receive Double Coins.')
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[Bugs Fixed] !')
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[BONUS EXP] Command for check !exp.')
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[GUILD LEADER COMMAND] Will change all outfits from members !outfit.')

-- Events
for i = 1, #events do
player:registerEvent(events)
end

if player:getStorageValue(Storage.combatProtectionStorage) <= os.time() then
player:setStorageValue(Storage.combatProtectionStorage, os.time() + 10)
onMovementRemoveProtection(playerId, player:getPosition(), 10)
end
return true
end
 
Replace this code and test.

LUA:
local events = {
'ElementalSpheresOverlords',
'BigfootBurdenVersperoth',
'Razzagorn',
'Shatterer',
'Zamulosh',
'The Hunger',
'The Rage',
'Eradicator',
'Eradicator1',
'Rupture',
'World Devourer',
'Tarbaz',
'Shulgrax',
'Ragiaz',
'Plagirath',
'Mazoran',
'Destabilized',
'BigfootBurdenWiggler',
'SvargrondArenaKill',
'NewFrontierShardOfCorruption',
'NewFrontierTirecz',
'ServiceOfYalaharDiseasedTrio',
'ServiceOfYalaharAzerus',
'ServiceOfYalaharQuaraLeaders',
'InquisitionBosses',
'InquisitionUngreez',
'KillingInTheNameOfKills',
'KillingInTheNameOfKillss',
'KillingInTheNameOfKillsss',
'MastersVoiceServants',
'SecretServiceBlackKnight',
'ThievesGuildNomad',
'WotELizardMagistratus',
'WotELizardNoble',
'WotEKeeper',
'WotEBosses',
'WotEZalamon',
'WarzoneThree',
'PlayerDeath',
'AdvanceSave',
'bossesWarzone',
'AdvanceRookgaard',
'PythiusTheRotten',
'DropLoot',
'Yielothax',
'BossParticipation',
'Energized Raging Mage',
'Raging Mage',
'modalMD1',
'VibrantEgg',
'DeathCounter',
'KillCounter',
'bless1'

}

local function onMovementRemoveProtection(cid, oldPosition, time)
local player = Player(cid)
if not player then
return true
end

local playerPosition = player:getPosition()
if (playerPosition.x ~= oldPosition.x or playerPosition.y ~= oldPosition.y or playerPosition.z ~= oldPosition.z) or player:getTarget() then
player:setStorageValue(Storage.combatProtectionStorage, 0)
return true
end

addEvent(onMovementRemoveProtection, 1000, cid, oldPosition, time - 1)
end

function onLogin(player)
local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
if player:getLastLoginSaved() <= 0 then
loginStr = loginStr .. ' Please choose your outfit.'
player:sendTutorial(1)
else
if loginStr ~= '' then
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
end

loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))
end

player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)

local playerId = player:getId()

-- Stamina
nextUseStaminaTime[playerId] = 1

-- STAMINA DEVIDO A QUEDAS START

--local stamina_full = 42 * 60 -- config. 42 = horas
-- if player:getStamina() >= stamina_full then
-- player:sendCancelMessage("Your stamina is already full.")
-- elseif player:getPremiumDays() < 1 then
-- player:sendCancelMessage("You must have a premium account.")
-- else
-- player:setStamina(stamina_full)
-- player:sendTextMessage(MESSAGE_INFO_DESCR, "Your stamina has been refilled.")
-- end

-- STAMINA DEVIDO A QUEDAS END

-- Promotion
--[[ local vocation = player:getVocation()
local promotion = vocation:getPromotion()
if player:isPremium() then
local value = player:getStorageValue(Storage.Promotion)
if not promotion and value ~= 1 then
player:setStorageValue(Storage.Promotion, 1)
elseif value == 1 then
player:setVocation(promotion)
end
elseif not promotion then
player:setVocation(vocation:getDemotion())
end--]]

-- ABRIR CHANNELS
    if table.contains({"Rookgaard", "Dawnport"}, player:getVocation():getId()) or player:getLevel() < 6) then
        --player:openChannel(7) -- help channel
        player:openChannel(3) -- world chat
        player:openChannel(6) -- advertsing rook main
    else
        --player:openChannel(7) -- help channel
        player:openChannel(3) -- world chat
        player:openChannel(5) -- advertsing main
    end

--
-- Rewards
local rewards = #player:getRewardList()
if(rewards > 0) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))
end

-- Update player id
local stats = player:inBossFight()
if stats then
stats.playerId = player:getId()
end

-- fury gates

if Game.getStorageValue(GlobalStorage.FuryGates, (9710)) == 1 then -- for venore
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Venore Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9711)) == 2 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Abdendriel Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9712)) == 3 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Thais Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9713)) == 4 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Carlin Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9714)) == 5 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Edron Today.')
elseif Game.getStorageValue(GlobalStorage.FuryGates, (9716)) == 6 then -- for ab...
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Kazordoon Today.')
end


player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, '[TIBIA COINS] For purchases above 20 BRL receive Double Coins.')
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[Bugs Fixed] !')
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[BONUS EXP] Command for check !exp.')
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, '[GUILD LEADER COMMAND] Will change all outfits from members !outfit.')

-- Events
for i = 1, #events do
player:registerEvent(events)
end

if player:getStorageValue(Storage.combatProtectionStorage) <= os.time() then
player:setStorageValue(Storage.combatProtectionStorage, os.time() + 10)
onMovementRemoveProtection(playerId, player:getPosition(), 10)
end
return true
end
 
Dude ur a god it works! Now the only error i still have in console is this but i understand if you dont have time to help more right now :)
<3

[Error - mysql_real_query] Query: SELECT * FROM z_ots_guildcomunication
Message: Table 'forgotten.z_ots_guildcomunication' doesn't exist
[Error - mysql_store_result] Query: SELECT * FROM z_ots_guildcomunication
Message: Table 'forgotten.z_ots_guildcomunication' doesn't exist
[Error - mysql_real_query] Query: SELECT * FROM `z_ots_comunication`
Message: Table 'forgotten.z_ots_comunication' doesn't exist
[Error - mysql_store_result] Query: SELECT * FROM `z_ots_comunication`
Message: Table 'forgotten.z_ots_comunication' doesn't exist
[Error - mysql_real_query] Query: SELECT `marriage_status` FROM `players` WHERE `id` = '2'
Message: Unknown column 'marriage_status' in 'field list'
[Error - mysql_store_result] Query: SELECT `marriage_status` FROM `players` WHERE `id` = '2'
Message: Unknown column 'marriage_status' in 'field list'

Lua Script Error: [Action Interface]
data/actions/scripts/other/teleport.lua:onUse
data/actions/scripts/other/teleport.lua:3: attempt to call global 'isInArray' (a nil value)
stack traceback:
[C]: in function 'isInArray'
data/actions/scripts/other/teleport.lua:3: in function <data/actions/scripts/other/teleport.lua:2>
 
Dude ur a god it works! Now the only error i still have in console is this but i understand if you dont have time to help more right now :)
<3

[Error - mysql_real_query] Query: SELECT * FROM z_ots_guildcomunication
Message: Table 'forgotten.z_ots_guildcomunication' doesn't exist
[Error - mysql_store_result] Query: SELECT * FROM z_ots_guildcomunication
Message: Table 'forgotten.z_ots_guildcomunication' doesn't exist
[Error - mysql_real_query] Query: SELECT * FROM `z_ots_comunication`
Message: Table 'forgotten.z_ots_comunication' doesn't exist
[Error - mysql_store_result] Query: SELECT * FROM `z_ots_comunication`
Message: Table 'forgotten.z_ots_comunication' doesn't exist
[Error - mysql_real_query] Query: SELECT `marriage_status` FROM `players` WHERE `id` = '2'
Message: Unknown column 'marriage_status' in 'field list'
[Error - mysql_store_result] Query: SELECT `marriage_status` FROM `players` WHERE `id` = '2'
Message: Unknown column 'marriage_status' in 'field list'

Lua Script Error: [Action Interface]
data/actions/scripts/other/teleport.lua:eek:nUse
data/actions/scripts/other/teleport.lua:3: attempt to call global 'isInArray' (a nil value)
stack traceback:
[C]: in function 'isInArray'
data/actions/scripts/other/teleport.lua:3: in function <data/actions/scripts/other/teleport.lua:2>

The first error is regarding SQL
The second error will require that you post the following script:
data / actions / scripts / other / teleport.lua
Note: Place the tag [!!! code] and [!!! / code] (without exclamations)
 
Yeah i figured there was tables missing from the database but no idea where to locate them..

Code:
local upFloorIds = {1386, 3678, 5543, 22845, 22846}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if isInArray(upFloorIds, item.itemid) then
        fromPosition:moveUpstairs()
    else
        fromPosition.z = fromPosition.z + 1
    end
    player:teleportTo(fromPosition, false)
    return true
end
 
1° Error (SQL):
You will have to go to phpMyADMIN and execute these commands in SQL (one at a time):
Code:
CREATE TABLE `z_ots_guildcomunication` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `type` varchar(255) NOT NULL,
  `action` varchar(255) NOT NULL,
  `param1` varchar(255) NOT NULL,
  `param2` varchar(255) NOT NULL,
  `param3` varchar(255) NOT NULL,
  `param4` varchar(255) NOT NULL,
  `param5` varchar(255) NOT NULL,
  `param6` varchar(255) NOT NULL,
  `param7` varchar(255) NOT NULL,
  `delete_it` int(2) NOT NULL DEFAULT '1'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Code:
CREATE TABLE `players` (
  `marriage_status` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
Dude thanks so much for helping me! Never came this far before :D
Alright so the first one worked but the second one said this

Static analysis:

2 errors were found during analysis.



  1. Unrecognized data type. (near "=" at position 96)
  2. A comma or a closing bracket was expected. (near "InnoDB" at position 97)


SQL query:

CREATE TABLE `players` ( `marriage_status` bigint(20) UNSIGNED NOT NULL DEFAULT '0', ENGINE=InnoDB DEFAULT CHARSET=latin1

MySQL said:
 
My understanding of it is not enough.
run this on your sql
Code:
ALTER TABLE `players` ADD `marriage_status` bigint(20) UNSIGNED NOT NULL DEFAULT '0'
 
Alright so that worked!
Now the only issue that remains seems to be that i cant climb up ladders lmao.

*EDIT*
Can't seem to use doors either..
This is the error code that comes up in console if anyone happen to get time to look at it

Code:
Lua Script Error: [Action Interface]
data/actions/scripts/other/doors.lua:onUse
data/actions/scripts/other/doors.lua:47: attempt to call global 'isInArray' (a nil value)
stack traceback:
        [C]: in function 'isInArray'
        data/actions/scripts/other/doors.lua:47: in function <data/actions/scripts/other/doors.lua:45>
[code/]

[code]
Lua Script Error: [Action Interface]
data/actions/scripts/other/teleport.lua:onUse
data/actions/scripts/other/teleport.lua:3: attempt to call global 'isInArray' (a nil value)
stack traceback:
        [C]: in function 'isInArray'
        data/actions/scripts/other/teleport.lua:3: in function <data/actions/scripts/other/teleport.lua:2>
[code/]
 
Last edited:
If you have any clues where i can download a better 10.98 server let me know because this one is kinda buggy. Found one yesterday which was really stable and loaded quick etc but NPCs was missing and now i cant remember which one it was lol..
 
On this site they also do not tell you what the server base is.
I guess it's the sources that's in trouble.

It would be very important to know what the basis is,
to have a north on a more stable solution.
Did you compile the executable or did it come with the pack?
 
Yeah your right it's kinda shady. I didn't compile it i just added the data packs included etc.

Cool thanks i haven't seen that one before. So with that one everything is included? You dont have to compile etc?
Is it RL map or do i have to add that myself? :)
 
Yeah your right it's kinda shady. I didn't compile it i just added the data packs included etc.

Cool thanks i haven't seen that one before. So with that one everything is included? You dont have to compile etc?
Is it RL map or do i have to add that myself? :)
is RL MAP,
you need to compile more everything you need to know will find in the README of the page that I sent above.
However it is in Portuguese, if it is not your usual language you will have to translate.
More works very well and is constantly updated and updated.
 
Solution
Back
Top