• 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 & mysql

Holloweye

New Member
Joined
Jul 13, 2007
Messages
52
Reaction score
4
---------------------
Code:
local Name = ""
local Pic = 0
local ATK1 = 0
local ATK2 = 0
local ATK3 = 0
local ATK4 = 0

local res = db.storeQuery("SELECT * FROM zz;")
if(res:getID() ~= -1) then
repeat
Name = res:getDataString("NAME")
Pic = res:getDataInt("PIC")
ATK1 = res:getDataInt("ATK1")
ATK2 = res:getDataInt("ATK2") << Line 24
ATK3 = res:getDataInt("ATK3")
ATK4 = res:getDataInt("ATK4")
until not res:next()
res:free()
end
----------------------



----------------------
The Error:
[05/04/2009 21:49:13] Lua Script Error: [MoveEvents Interface]
[05/04/2009 21:49:13] data/movements/scripts/monsters.lua:eek:nStepIn

[05/04/2009 21:49:13] data/movements/scripts/monsters.lua:24: attempt to index local 'res' (a number value)
[05/04/2009 21:49:13] stack traceback:
[05/04/2009 21:49:13] data/movements/scripts/monsters.lua:24: in function <data/movements/scripts/monsters.lua:1>
---------------------------


What is wrong with this code?
 
Back
Top