• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Modal

theduck

Member
Joined
Dec 6, 2018
Messages
246
Reaction score
20
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

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:
Back
Top