Configuration
All configuration for legends_safezones is done in the config/config.lua and client/editable.lua files.
Main Configuration
Location: config/config.lua
Config.Framework
Config.Framework = "qb"Description: Determines which framework to use for job checking.
Type: string
Options:
| Value | Description |
|---|---|
"qb" | Use QB-Core |
"qbx" | Use QBX-Core |
"esx" | Use ESX |
Config.ShowUIinSafeZone
Config.ShowUIinSafeZone = trueDescription: Shows a visual UI indicator when players are inside a safe zone.
Type: boolean
Default: true
The UI displays:
- "SAFE ZONE" title
- "Weapons & Violence Disabled" subtitle
Config.RestoreHealthInSafeZone
Config.RestoreHealthInSafeZone = falseDescription: Automatically restores player health to maximum when inside safe zones.
Type: boolean
Default: false
Warning: Enabling this can be abused by players for free healing. Only enable if this is intentional behavior for your server.
Config.RestoreArmorInSafeZone
Config.RestoreArmorInSafeZone = falseDescription: Automatically restores player armor to maximum when inside safe zones.
Type: boolean
Default: false
Warning: Enabling this can be abused by players for free armor. Only enable if this is intentional behavior for your server.
Config.Lang
Config.Lang = "en"Description: Language for notifications and UI text.
Type: string
Default: "en"
Language files are located in locales/. To add a new language, create a JSON file (e.g., locales/es.json) with the required translations.
Config.Debug
Config.Debug = falseDescription: Enables global debug mode for all zones.
Type: boolean
Default: false
Restricted Zones
Config.RestrictedZones
The main configuration for defining protected areas. Each zone is a table with the following properties:
Config.RestrictedZones = {
{
name = "DiamondCasino",
debug = false,
points = {
vector2(870.47, 16.06),
vector2(947.22, 118.22),
vector2(1035.37, 64.72),
vector2(970.77, -44.91),
},
minZ = 65.0,
maxZ = 135.0,
allWeapons = true,
weapons = {},
bypassJobs = { "police" },
antiVDM = true
},
}Zone Properties
| Property | Type | Description |
|---|---|---|
name | string | Unique identifier for the zone |
debug | boolean | Enable debug visualization for this specific zone |
points | table | Array of vector2 coordinates defining zone boundaries |
minZ | number | Minimum height (ground level) |
maxZ | number | Maximum height (ceiling level) |
allWeapons | boolean | If true, blocks ALL weapons in zone |
weapons | table | List of specific weapon hashes to block (used when allWeapons = false) |
bypassJobs | table | Jobs that can use weapons in this zone |
antiVDM | boolean | Enable vehicle damage protection |
Creating Custom Zones
Step 1: Get Coordinates
Use a tool like PolyZone Creator (opens in a new tab) or manually collect coordinates at each corner of your desired zone.
Step 2: Define the Zone
{
name = "MyCustomZone", -- Unique name
debug = true, -- Enable while setting up
points = {
vector2(x1, y1), -- Corner 1
vector2(x2, y2), -- Corner 2
vector2(x3, y3), -- Corner 3
vector2(x4, y4), -- Corner 4
},
minZ = 20.0, -- Ground level
maxZ = 50.0, -- Ceiling level
allWeapons = true,
weapons = {},
bypassJobs = { "police", "ambulance" },
antiVDM = true
}Step 3: Test and Adjust
- Enable
debug = truefor the zone - Restart the resource
- Check if the zone covers the intended area
- Adjust coordinates as needed
- Set
debug = falsewhen finished
Blocking Specific Weapons
To only block certain weapons instead of all:
{
name = "PartialWeaponZone",
-- ... other properties
allWeapons = false, -- Disable blocking all weapons
weapons = {
`WEAPON_PISTOL`,
`WEAPON_SMG`,
`WEAPON_ASSAULTRIFLE`,
`WEAPON_SNIPERRIFLE`,
},
-- ...
}When allWeapons = false, only weapons listed in the weapons table will be blocked. All other weapons can be used.
Bypass Jobs
Define which jobs can use weapons inside safe zones:
bypassJobs = { "police", "ambulance", "sheriff" }Players with these jobs will:
- Keep their weapons when entering the zone
- Be able to use weapons normally
- Still receive entity protection (damage immunity)
Entity Protection Settings
Location: client/editable.lua
These settings control what types of damage protection are applied to players in safe zones.
EntityProofs = {}
EntityProofs.BulletProof = true -- Protects from bullet damage
EntityProofs.FireProof = true -- Protects from fire damage
EntityProofs.ExplosionProof = true -- Protects from explosion damage
EntityProofs.CollisionProof = true -- Prevents collision interactions
EntityProofs.MeleeProof = true -- Protects from melee damage
EntityProofs.SteamProof = true -- Protects from steam damage
EntityProofs.P7 = true -- Unknown parameter (keep true)
EntityProofs.DrownProof = true -- Protects from drowningEntityProofs.CollisionProof
EntityProofs.CollisionProof = trueImportant: If you're experiencing issues with vehicle entry, trunk access, or other vehicle interactions inside safe zones, set CollisionProof = false.
Note: Setting this to false will reduce Anti-VDM effectiveness - vehicles will no longer pass through players, but players will still be protected from damage.
Localization
Location: locales/en.json
{
"RestrictedArea": "You are not allowed to enter this area with that weapon",
"SafeZoneTitle": "SAFE ZONE",
"SafeZoneSubtitle": "Weapons & Violence Disabled"
}To add a new language:
- Create a new file in
locales/(e.g.,es.json) - Translate all strings
- Set
Config.Lang = "es"in config
Example Configurations
Hospital Safe Zone (Full Protection)
{
name = "Hospital",
debug = false,
points = {
vector2(275.71, -615.22),
vector2(293.09, -539.1),
vector2(388.79, -573.18),
vector2(352.06, -653.81),
},
minZ = 15.78,
maxZ = 104.61,
allWeapons = true,
weapons = {},
bypassJobs = { "police", "ambulance" },
antiVDM = true
}Nightclub (No Heavy Weapons)
{
name = "Nightclub",
debug = false,
points = { ... },
minZ = 20.0,
maxZ = 50.0,
allWeapons = false,
weapons = {
`WEAPON_ASSAULTRIFLE`,
`WEAPON_CARBINERIFLE`,
`WEAPON_SNIPERRIFLE`,
`WEAPON_RPG`,
`WEAPON_GRENADELAUNCHER`,
},
bypassJobs = { "police" },
antiVDM = true
}VIP Area (Police Only)
{
name = "VIPArea",
debug = false,
points = { ... },
minZ = 0.0,
maxZ = 100.0,
allWeapons = true,
weapons = {},
bypassJobs = { "police", "security" },
antiVDM = true
}Need Help?
Join our Discord for support: discord.gg/lgnds (opens in a new tab)