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

Update Player Pos - Help

Meferot

New Member
Joined
Jan 28, 2008
Messages
57
Reaction score
1
I have problem whit this script:

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.lua:eek:nThink
Description:
(luaGetThingPosition) Thing not found

[Error - GlobalEvent Interface]
data/globalevents/scripts/pos.lua:eek:nThink
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?
 
i use this tfs 0.3.6
Go to data/globalevents/start.lua and delete all in it.
Then paste this:
PHP:
function onStartup()
db.executeQuery("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
db.executeQuery("UPDATE players SET posx = 32369, posy = 32241, posz = 7;")
return TRUE
end
 
Back
Top