luigilc
Lua Learner
I need a lil help to make this script work:
I need to make it only if you look at the statue with id 9751 you see the top level player on your ot. I'm bad at scripting and I tried something like:
but it doesn't work, can anyone help me out?
LUA:
function onLook(cid, thing, position, lookDistance)
query = db.getResult("SELECT * FROM `players` ORDER BY `level`")
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You see a monument with a plate: 'The highest leveled player in the world is " .. query:getDataString("name") .. "'!")
query:free()
return true
end
LUA:
function onLook(cid, thing, position, lookDistance)
if (item.id, 9751) then
query = db.getResult("SELECT * FROM `players` ORDER BY `level`")
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You see a monument with a plate: 'The highest leveled player in the world is " .. query:getDataString("name") .. "'!")
query:free()
return true
end
but it doesn't work, can anyone help me out?