Leyla Cullin
Honey
Hello Guys, can you help me again please?
I want to use this Don. Castle System for my Server but i get the following error when starting the server:
I searched on OTLand for some useful ideas but nothing did work. As example i tried to use db.storeQuery
instead of db.getResult. But this just occurs the error:
If needed, here is the code of the Castles.lua:
Thank you very much for every help!
Feel loved by me, Leyla.
I want to use this Don. Castle System for my Server but i get the following error when starting the server:
Code:
data/globalevents/scripts/Castles.lua:2: attempt to call field 'getResult' (a nil value)
instead of db.getResult. But this just occurs the error:
Code:
data/globalevents/scripts/Castles.lua:3: attempt to index local 'castles' (a number value)
Code:
function onThink()
local castles = db.storeQuery("SELECT id FROM houses WHERE `town` = '4';")
if(castles:getID() == -1) then
return true
end
local p = getPlayersOnline()[1]
repeat
local hid = castles:getDataInt('id')
local h = getHouseInfo(hid)
if h.owner == 0 then
setHouseOwner(hid, 3)
elseif p then
local n = tonumber(h.name:sub(-2)) or 0
h.entry.x = h.entry.x + (n % 2 == 0 and 3 or -3)
doCreatureSay(p, getPlayerNameByGUID(h.owner), TALKTYPE_ORANGE_1, false, 0, h.entry)
end
until not castles:next()
castles:free()
return true
end
Thank you very much for every help!
Feel loved by me, Leyla.