Meferot
New Member
- Joined
- Jan 28, 2008
- Messages
- 57
- Reaction score
- 1
I have problem whit this script:
This is error:
How to fix it?
Code:
function onThink(cid, interval, lastExecution)
local pos = getCreaturePosition(cid)
db.executeQuery("UPDATE `players` SET `posx` = '".. pos.x .."', `posy` = '".. pos.y .."' WHERE `name` = '".. getCreatureName(cid) .."' LIMIT 1;")
return TRUE
end
This is error:
[Error - GlobalEvent Interface]
data/globalevents/scripts/pos.luanThink
Description:
(luaGetThingPosition) Thing not found
[Error - GlobalEvent Interface]
data/globalevents/scripts/pos.luanThink
Description:
data/globalevents/scripts/pos.lua:5: attempt to index local 'pos' (a boolean val
ue)
stack traceback:
data/globalevents/scripts/pos.lua:5: in function <data/globalevents/scri
pts/pos.lua:1>
[Error - GlobalEvents::think] Couldn't execute event: pos
How to fix it?