{"id":93579,"date":"2024-02-05T09:21:58","date_gmt":"2024-02-05T08:21:58","guid":{"rendered":"https:\/\/fivem-mods.net\/?p=93579"},"modified":"2026-08-16T13:42:41","modified_gmt":"2026-08-16T11:42:41","slug":"how-to-reduce-npcs-density","status":"publish","type":"post","link":"https:\/\/fivemx.com\/nl\/how-to-reduce-npcs-density\/","title":{"rendered":"How to Reduce NPC Density in FiveM Safely"},"content":{"rendered":"<!-- fivemx-content-rework-remaining:2026-07-20:how-to-reduce-npcs-density -->\n<section class=\"fivemx-content-rework-remaining\">\n<p><strong>Snel antwoord:<\/strong> reduce ambient NPCs and traffic with a small client resource that calls the density multiplier natives every frame. Include both <code data-no-translation=\"\">fxmanifest.lua<\/code> and the client Lua file, start with a moderate value on staging, and measure the same route before and after. Do not promise an FPS gain: the result depends on the wider client resource and asset workload.<\/p>\n<\/section>\n\n\n<p class=\"wp-block-paragraph\">Soms wil je het aantal niet-speelbare personages (NPC's) of hun dichtheid in de gamewereld verminderen om de serverprestaties te verbeteren of specifieke gameplay-scenario's te cre\u00ebren. In deze tutorial laten we je zien hoe je NPC's kunt verminderen in FiveM.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Notitie<\/strong>: Het verminderen van de NPC-dichtheid kan enige kennis van server-side scripting in FiveM vereisen. Zorg ervoor dat u administratieve toegang hebt tot uw FiveM-server en een basiskennis van Lua-scripting.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Voorwaarden<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Een FiveM-server. (<a href=\"https:\/\/fivemx.com\/nl\/how-to-create-a-fivem-server\/\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/fivemx.com\/how-to-create-a-fivem-server\/\" rel=\"noreferrer noopener\">Hoe in te stellen<\/a>)<\/li>\n\n\n\n<li>Administratieve toegang tot de server.<\/li>\n\n\n\n<li>Een teksteditor (bijv., <a href=\"https:\/\/notepad-plus-plus.org\/downloads\/\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/notepad-plus-plus.org\/downloads\/\" rel=\"noreferrer noopener\">Notepad++<\/a>) voor het bewerken van Lua-scripts.<\/li>\n\n\n\n<li>Basiskennis van Lua-scripting.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Stappen<\/strong>:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. Toegang tot uw FiveM-server:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Zorg ervoor dat u SSH- of RDP-toegang hebt tot uw FiveM-server, of toegang tot het configuratiescherm.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. Zoek uw resources-map:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Navigeer naar de hoofdmap van uw FiveM-server.<\/li>\n\n\n\n<li>Zoek de map \u201cresources\u201d; hier bevinden zich de scripts en bronnen van uw server.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. Maak een nieuw Lua-script:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Maak in de map \u201cresources\u201d indien nodig een nieuwe map aan, bijvoorbeeld \u201cnpc_reducer\u201d.\u201d<\/li>\n\n\n\n<li>Binnen <code data-no-translation=\"\">npc_reducer<\/code>, maak <code data-no-translation=\"\">fxmanifest.lua<\/code> and a client script such as <code data-no-translation=\"\">reduce_npc_density.lua<\/code>. The manifest must declare the Lua file as a <code data-no-translation=\"\">client_script<\/code> or FiveM will not detect and load it as described below.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4. Bewerk het Lua-script:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open het bestand \u201creduce_npc_density.lua\u201d met uw favoriete teksteditor.<\/li>\n\n\n\n<li>Voeg de volgende Lua-code toe aan het bestand:<\/li>\n<\/ul>\n\n\n\n<pre data-no-translation=\"\" class=\"EnlighterJSRAW\" data-enlighter-language=\"lua\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"> Citizen.CreateThread(function()\n while true do\n Citizen.Wait(0)\n -- Adjust the number below to set the desired NPC density.\n local newDensity = 0.1 -- Modify this value as needed.\n SetVehicleDensityMultiplierThisFrame(newDensity)\n SetPedDensityMultiplierThisFrame(newDensity)\n SetRandomVehicleDensityMultiplierThisFrame(newDensity)\n SetParkedVehicleDensityMultiplierThisFrame(newDensity)\n SetScenarioPedDensityMultiplierThisFrame(newDensity, newDensity)\n end\n end)<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In de bovenstaande code kunt u de <code data-no-translation=\"\">newDensity<\/code> variabele aanpassen om de dichtheid van verschillende soorten NPC's en voertuigen in de spelwereld te regelen. Een waarde van <code data-no-translation=\"\">1.0<\/code> vertegenwoordigt de standaarddichtheid, terwijl kleinere waarden deze verminderen.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>5. Sla het Lua-script op en sluit het:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Sla de wijzigingen die u in het Lua-script hebt aangebracht op en sluit de teksteditor.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>6. Configureer uw server.cfg:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Navigeer naar de hoofdmap van uw FiveM-server.<\/li>\n\n\n\n<li>Open het \u201cserver.cfg\u201d bestand met een teksteditor.<\/li>\n\n\n\n<li>Voeg de volgende regel toe aan het bestand:<\/li>\n<\/ul>\n\n\n\n<pre data-no-translation=\"\" class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"> ensure npc_reducer<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Deze regel zorgt ervoor dat je \u201creduce_npc_density.lua\u201d script wordt geladen wanneer de server start.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>7. Herstart je FiveM server:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Sla het <a href=\"https:\/\/fivemx.com\/nl\/fivem-server-cfg\/\" title=\"FiveM server.cfg \u2013 Volledige Gids\" data-wpil-monitor-id=\"1578\">\u201cserver.cfg\u201d bestand<\/a> en herstart je FiveM server om de wijzigingen toe te passen.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>8. Pas de NPC-dichtheid in real-time aan:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Zodra je server weer online is, kun je de NPC-dichtheid in real-time aanpassen door de <code data-no-translation=\"\">newDensity<\/code> variabele in het Lua-script te wijzigen. Lagere waarden verminderen de NPC-dichtheid, terwijl hogere waarden deze verhogen.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Je hebt succesvol geleerd hoe je NPC's (dichtheid) in FiveM kunt verminderen door een Lua-script te maken en je server te configureren om het te laden. Dit kan je helpen om serverprestaties te optimaliseren of specifieke gameplay-scenario's te cre\u00ebren met minder NPC's in je GTA V FiveM server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Like, deel en reageer als dit je heeft geholpen. :)<\/strong><\/p>\n\n\n<!-- fivemx-quality-enrichment-v2 -->\n<h2>Gerelateerde resources<\/h2><!-- fivemx-quality-depth-v3 -->\n<h2>Add the required resource manifest<\/h2>\n<p>Cfx.re&#8217;s Lua resource guide states that a resource folder needs a manifest to be detected and that <code data-no-translation=\"\">client_script<\/code> tells the client runtime which file to load. Add this beside <code data-no-translation=\"\">reduce_npc_density.lua<\/code>:<\/p>\n<pre data-no-translation=\"\"><code data-no-translation=\"\">fx_version 'cerulean'\ngame 'gta5'\n\nclient_script 'reduce_npc_density.lua'<\/code><\/pre>\n<p>The example uses <code data-no-translation=\"\">SetPedDensityMultiplierThisFrame<\/code>, <code data-no-translation=\"\">SetScenarioPedDensityMultiplierThisFrame<\/code>, <code data-no-translation=\"\">SetVehicleDensityMultiplierThisFrame<\/code>, <code data-no-translation=\"\">SetRandomVehicleDensityMultiplierThisFrame<\/code> En <code data-no-translation=\"\">SetParkedVehicleDensityMultiplierThisFrame<\/code>. Keep the loop client-side and yield every frame as shown. Test populated interiors, emergency traffic, missions and job scripts before rollout because reduced ambient populations can change gameplay as well as load.<\/p>\n<p>Do not combine this approach with undocumented <code data-no-translation=\"\">popcycle.dat<\/code> edits during the same test. Change one control at a time, record the value, compare client performance and restore the previous resource if behavior regresses.<\/p>\n<p>Primary references: <a href=\"https:\/\/docs.fivem.net\/docs\/scripting-manual\/introduction\/creating-your-first-script\/\" rel=\"nofollow noopener\" target=\"_blank\">Cfx.re Lua resource guide<\/a> en de <a href=\"https:\/\/github.com\/citizenfx\/natives\" rel=\"nofollow noopener\" target=\"_blank\">official CitizenFX native documentation repository<\/a>.<\/p>\n<\/section>","protected":false},"excerpt":{"rendered":"<p>Fast answer: reduce ambient NPCs and traffic with a small client resource that calls the density multiplier natives every frame. Include both fxmanifest.lua and the client Lua file, start with a moderate value on staging, and measure the same route before and after. Do not promise an FPS gain: the result depends on the wider [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":93580,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1899],"tags":[],"class_list":["post-93579","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/fivemx.com\/nl\/wp-json\/wp\/v2\/posts\/93579","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemx.com\/nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemx.com\/nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemx.com\/nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemx.com\/nl\/wp-json\/wp\/v2\/comments?post=93579"}],"version-history":[{"count":3,"href":"https:\/\/fivemx.com\/nl\/wp-json\/wp\/v2\/posts\/93579\/revisions"}],"predecessor-version":[{"id":217304,"href":"https:\/\/fivemx.com\/nl\/wp-json\/wp\/v2\/posts\/93579\/revisions\/217304"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemx.com\/nl\/wp-json\/wp\/v2\/media\/93580"}],"wp:attachment":[{"href":"https:\/\/fivemx.com\/nl\/wp-json\/wp\/v2\/media?parent=93579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemx.com\/nl\/wp-json\/wp\/v2\/categories?post=93579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemx.com\/nl\/wp-json\/wp\/v2\/tags?post=93579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}