Hello,
I created a table in the database called monsters that has the name of the monster and how many times he died
I am trying to create a modal so when choosing choice show a window with only the monsters that have deaths
I created a table in the database called monsters that has the name of the monster and how many times he died
I am trying to create a modal so when choosing choice show a window with only the monsters that have deaths
Code:
function Player:monsters()
local player = Player(playerId)
if not player then
return false
end
local entries = {}
local resultId = db.storeQuery("SELECT * FROM `monsters` WHERE ORDER BY `kill` DESC LIMIT 15;")
if resultId ~= false then
repeat
local entry = {
timestamp = result.getDataInt(resultId, "kill"),
}
table.insert(entries, entry)
until not result.next(resultId)
result.free(resultId)
end
return entries
end
Last edited: