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

[LUA] bad argument #1 to 'ipairs' (table expected, got nil)

Lejjo

New Member
Joined
Sep 21, 2007
Messages
78
Reaction score
1
What I wonder is what does this error output mean?

Code:
bad argument #1 to 'ipairs' (table expected, got nil)


The code looks like this:

Code:
function spellSys:setCombatParam(paramType, value, ...)
	for _, v in ipairs(arg) do <--This is where the error occur when I look in my GUI
		setCombatParam(self:getCombat(v), paramType, value)
	end
end

Thanks in advance!
 
The first argument you've thrown into the function ipairs is nil, Lua (not LUA..) expects a table. You give it 'arg' which is an unassigned variable, aka nil.
 
The thing is that it worked on TFS before but now it doesnt anymore. Back then I used TFS for 8.1 and now I use TFS 9.1
 
Back
Top