Troubleshooting
Solutions for the problems that come up most often with more_lib.
Common problems with more_lib and how to resolve them. Most of them come from the start order, the framework, or a setting in config.lua.
The library answers only once your framework is ready. Before that, every call returns nil and prints an error. Wait for the event more_lib::server:frameworkLoaded (or more_lib::client:frameworkLoaded on the client), check MORE.IsFrameworkLoaded(), or on the client call WaitForPlayer() from a thread. Also make sure es_extended, qb-core or qbx_core starts before more_lib.
With MS.Framework set to auto, more_lib uses the framework that is started. If it says no framework was found, MS.Framework in config.lua names a framework that more_lib does not know: use esx, qbcore or auto. If it says it gave up waiting after 30 seconds, es_extended, qb-core or qbx_core did not start or did not answer. Start the framework before more_lib in your server.cfg, and check the framework for its own errors.
Start more_lib after oxmysql, your framework and your inventory, and before every MORE script. After you update the library, restart the server, or restart every MORE script after more_lib, so they all use the new callbacks. Keep your edited config.lua, sv_config.lua and module files when you replace the folder.
A callback answers once. If the server function throws an error, the error is printed in the server console (Server callback failed) and the client gets an answer with nothing in it. If the server function never calls cb, the client prints that the callback got no answer within 60 seconds and gets nothing. Check the name: a name that is registered again replaces the first function. On ESX, a client callback needs the callback API of your es_extended version.
MORE.Notify shows the notification of more_hud when more_hud is started, and otherwise sends esx:showNotification. On QBCore without more_hud nothing is shown, so install and start more_hud. To use another notification script, change backend/modules/notify/client.lua and backend/modules/notify/server.lua, which are not encrypted.
MS.Settings.inventory is auto by default: it uses ox_inventory when that resource exists on your server, and the inventory of your framework otherwise. Set it to ox_inventory or native to choose yourself. The item calls take a count above 0, and RemoveItem and RemoveMoney return false when the player doesn't have enough. AddItem uses the metadata only on QBCore and with ox_inventory.
Scripts use the neutral account keys cash, bank and black. MS.Accounts in config.lua maps them: on ESX to money, bank and black_money, and on QBCore to cash, bank and crypto. Change the right-hand names if your server uses other accounts, for example a black money item account.
more_lib learns about death from the events of your ambulance script, which are set in MS.Death in config.lua: on ESX esx:onPlayerDeath and esx:onPlayerSpawn, on QBCore qbx_medical:client:onPlayerDied and hospital:client:Revive. If you use another ambulance script, change the down and revive events to the ones it sends.
The phone number is read from the phone_phones table by backend/modules/phone/server.lua. If your phone script keeps its numbers somewhere else, or the table doesn't exist, phone is an empty text and the server prints an error about the lookup. Change that file so it finds the number in your phone script.
On QBCore, the group comes from the permissions of the core. When the core reports no group, more_lib checks the ACE groups in MS.Permissions in sv_config.lua, in the order god, admin, mod. Add the group you use there, or give the player the ACE permission.
Both work on ESX only. On QBCore they always return false and write a debug line when MS.Settings.dev_mode is on.
MS.Interaction is false by default, which hides the dot: the points and the Interact key keep working, and a point can show its own marker or ped instead. Set MS.Interaction to true to show the dot. A point with wrong options is ignored and the console prints which one and why: it needs a vector coords, a number showDist, a number interactDist when it has pressed, and a marker with a number type or a string image. Players can rebind the Interact key (E) under Settings, Key Bindings, FiveM.
The picture must be a link to an image (a transparent PNG for a marker). Each different picture link keeps a hidden browser open in the player's game until more_lib stops, so use one picture for many points instead of one for each.
Only one menu shows at a time: when another resource opens its menu, it replaces yours. Restarting your resource closes its menu. The menu uses the arrow keys, Enter and Backspace, which players can rebind under Settings, Key Bindings, FiveM (Menu up, Menu down, Menu left, Menu right, Menu select and Menu back). Another script that uses the same keys can clash.
Both use the library's own screen elements by default. In backend/modules/progressbar/client.lua, progressType set to custom calls the progress bar of echo_hud (an example that you replace with your own); in backend/modules/helpkey/client.lua, helpKeyType set to custom uses the game's help box. Leave both at default for the library's look. Both are hidden while the game's pause menu is open.
DrawText3D and MORE.GetFont use the font in MS.Settings.font, which is Gilroy-Medium by default. It must be a .gfx file in the stream folder of more_lib. Add your font file there, write its name without .gfx, and restart the resource.
Yes. With MS.Telemetry set to true in sv_config.lua, the server sends a heartbeat to more-scripts.com about every 5 minutes for each MORE script that is started (its id and version, the server id from web_baseUrl, the server name, the uptime, the player count and maximum, the framework and the server build), and it checks about every hour for new versions, which it prints in the console at start. It sends nothing about your players. Set MS.Telemetry to false to turn off both the heartbeat and the update check.
Last updated