Envi Scripts Documentation
  • 👋Introduction
  • 🌉Envi-Bridge
  • ⚙️Compatibility
  • 🖨️Licensing
  • 📒Premium Scripts
    • ❔FAQ / COMMON ISSUES
    • ‼️FIRST STEPS (READ FIRST)
    • ⭐Useful Resources
    • 👀Envi FiveM Showcase Server
    • 📸Envi-Camera
      • ❗First Steps
      • Inventory Setup
      • Editable Functionality
      • Complete Lens Kit
      • Printing Photos
      • Ped Reactions
      • Exports
      • Config File
    • 🪚Envi-ChopShop
      • Inventory Setup
      • How to Chop
      • Props for AntiCheats
      • Editable Functionality
      • Config File
    • 🪣Envi-Dumpsters
      • Common Issues
      • Inventory Setup
      • Editable Functionality
      • Exports
      • Exclusive Zones
      • Survival Items
      • Shopping Carts
      • Hobo Bowling
      • Hobo Taxi
      • Rats and Racoons
      • Config File
      • V2 Config
    • 💺Envi-Ejector-Seats
      • Inventory Setup
      • How to Eject
      • Editable Functionality
      • Config File
    • 🔥Envi-Flamethrower (Standalone)
      • Common Issues
      • Inventory Setup
      • Refueling
      • Editable Functionality
      • Config File
    • 🪽Envi-Flight-Suits
      • Inventory Setup
      • Flight Suits
      • Config File
    • 🍜Envi-Food-Truck
      • ❗VooDoo Required
      • Common Issues
      • Inventory Setup
      • Adding Additional Grill Items
      • Unique Shops with Liveries
      • Spawning the Trucks
      • Using the Trucks
      • Exports
      • Config File
    • 💍Envi-Forever-Rings
      • Inventory Setup
      • Editable Functionality
      • Ring Shop MLO
      • Config File
    • 💻Envi-Hack-Minigames (Standalone)
      • The Worm
      • Password
      • Firewall
      • Node Runner
      • Config File
    • 🎞️Envi-HUD
      • ❗First Time Setup
      • Common Issues
      • Inventory Setup
      • Adding Custom Weapons
      • Change Logo
      • Custom Fonts
      • Converting Notifications
      • Converting Progress Bars
      • Editable Functionality
      • Settings Save Location
      • Exports and Events
      • Commands
      • Vehicle Control
      • Anti Muscle Spasm
      • Ragdoll
      • Config File
    • 🎇Envi-Items
      • Inventory Setup
      • Config File
    • 🚑Envi-Medic
      • Common Issues
      • Fully Disable Transport to Hospital
      • Failsafe
      • Ambulance Scripts
      • Vehicle Fuel
      • Vehicle Keys
      • Exports
      • Config File
    • ☄️Envi-MethVan
      • Common Issues
      • Inventory Setup
      • Cooking Process
      • Editable Functionality
      • Adding a Vehicle
      • Config File
    • 🍃Envi-Megablower9000 (Standalone)
      • Inventory Setup
      • Config File
    • 👯Envi-Population (Standalone)
      • ❗Initial Setup
      • Common Issues
      • Config File
    • 🗒️Envi-Prescriptions
      • Common Issues
      • Inventory Setup
      • Editable Functionality
      • Config File
    • 🔧Envi-Sabotage
      • ❗First Time Setup
      • Common Issues
      • Inventory Setup
      • Exports
    • 🛒Envi-Shops
      • Common Issues
      • Inventory Setup
      • Exports
      • Editable Functionality
      • Config File
    • 📱Envi-Trap-Phone
      • Common Issues
      • Inventory Setup
      • Commands
      • Exports
      • Adding Custom Drugs
      • Using the Phone
      • Disabling Extra Services
      • Config Files
        • config.lua
        • dialogueSettings.lua
        • extraServices.lua
        • gangZoneSettings.lua
        • personalitySettings.lua
        • specialContactSettings.lua
    • 👰Envi-Weddings
      • Inventory Setup
      • Starting Info
      • Manually Removing Data
      • Commands
      • Config File
    • 🎅Envi Xmas-Weapons (Standalone)
      • Inventory Setup
      • Config File
    • 🗡️Envi-Zombie-Weapons (Standalone)
      • Inventory Setup
    • 🧟‍♂️Envi-Zombies
Powered by GitBook
On this page
  1. Premium Scripts
  2. Envi-Population (Standalone)

Config File

Config = {}

-- Note: The density values are between 0.0 and 1.0. (disabled - max density)
-- Zones with 0.0 will disable ped spawning when you are inside the zone, so there could still be some peds / traffic remaining from before entering the zone - but no new ones will be produced.
-- In those cases where you want no traffic in an area at all - its better to make a radius zone, and set the raius to be much larger than the zone you want to disable peds in as other clients outside of the zone may still spawn them.

-- If you use`qb-smallresources` please remove the `density.lua` file (older versions) or remove lines 34-38 in `hudcomponents.lua` (newer qb-smallresources versions) as it will conflict with this script. - More info in readme.md
-- if you use qbx_density (Qbox) please remove it as it will conflict with this script.

-- NOTE: IF SETTING ARES TO HAVE 0.0 PEDS, USE RADIUSZONES AND KEEP THE RADIUS LARGE ENOUGH TO DISABLE PEDS IN THE AREA YOU WANT TO DISABLE PEDS IN TO AVOID PEDS CREATED OUTSIDE THE ZONE FROM ENTERING. - ALTHOUGH THIS JUST HAPPENS SOMETIMES, SO THERE ISNT MUCH THAT CAN BE DONE TO 100% PREVENT IT.

Config.PopulationDefaults = {
    parkedVehicles = 0.8,
    trafficVehicles = 0.8,
    randomVehicles = 0.8,
    pedestrians = 1.0,
    scenarioPeds = 1.0,
}

-- Multipliers for the time of day (0.0 - 1.0) - For example, if you want much less peds in the morning, you can set the morning multiplier to 0.3
-- Example Calculation: 1.0 (default pedestrians density) * 0.3 (morning multiplier) = 0.3 (new density)
Config.TimeMultipliers = {
    enabled = true,
    debug = true,
    times = {
        morning = 0.3, -- 6am - 12pm
        afternoon = 1.0, -- 12pm - 6pm
        evening = 0.8, -- 6pm - 12am
        night = 0.2, -- 12am - 6am
    }
}

-- NEW Weather Multipliers
Config.WeatherMultipliers = {
    enabled = true,
    debug = true,
    weather = {
        [`BLIZZARD`] = 0.3,
        [`CLEAR`] = 0.9,
        [`CLEARING`] = 0.8,
        [`CLOUDS`] = 0.8,
        [`EXTRASUNNY`] = 1.0,
        [`FOGGY`] = 0.7,
        [`NEUTRAL`] = 0.9,
        [`OVERCAST`] = 0.7,
        [`RAIN`] = 0.6,
        [`SMOG`] = 0.4,
        [`SNOW`] = 0.5,
        [`SNOWLIGHT`] = 0.5,
        [`THUNDER`] = 0.4,
        [`XMAS`] = 1.0
    }
}


Config.PolyZones = {
    [1] = {
        name = "Vespucci Beach",
        points = {
            vec3(-1048.1771, -1683.7151, 2.0),  -- make sure all the Z coords match
            vec3(-1244.6178, -1844.8206, 2.0),
            vec3(-1770.1569, -899.3431, 2.0),
            vec3(-1620.7841, -799.3641, 2.0)
        },
        debug = true,
        height = 100,
        density = {
            pedestrians = 1.0,
            scenarioPeds = 1.0,
            vehicles = 1.0,
            randomVehicles = 1.0,
            parkedVehicles = 1.0,
            trafficVehicles = 1.0,
        },
        onEnter = function(self)
            print("You have entered a zone with density: " .. json.encode(self.density, {indent = true}))
            -- Custom Code to execute when entering the zone
        end,
        onExit = function(self)
            print("You have exited a zone with density: " .. json.encode(self.density, {indent = true}))
            -- Custom Code to execute when exiting the zone
        end,
    },
    -- Add more zones as needed
}

Config.RadiusZones = {
    [1] = {
        name = "Legion Square",
        center = vec3(192.77, -931.4, 30.69),
        radius = 300,
        debug = true,
        density = {
            pedestrians = 0.0,
            scenarioPeds = 0.0,
            vehicles = 0.0,
            randomVehicles = 0.0,
            parkedVehicles = 0.0,
            trafficVehicles = 0.0,
        },
        onEnter = function(self)
            print("You have entered a zone with density: " .. json.encode(self.density, {indent = true}))
            -- Custom Code to execute when entering the zone
        end,
        onExit = function(self)
            print("You have exited a zone")
            print('Resetting to Global density: ' .. json.encode(GlobalState.populationDensities, {indent = true}))
            -- Custom Code to execute when exiting the zone
        end,
    },
    -- Add more zones as needed
}

Config.ServerSideSpawnPrevention = false -- NEW: Completely Prevents entities from being spawned in RadiusZones with 0.0 density. -- This is very resource intensive, so probably best to deal with the occasional entity spawn in the zone.
PreviousCommon IssuesNextEnvi-Prescriptions

Last updated 10 days ago

📒
👯