The FFA Script offers extensive customization options via its configuration files, primarily config.lua and discord.lua. This guide will walk you through each section to help you tailor the script perfectly to your server’s needs.
Always create a backup of your configuration files before making significant
changes to avoid losing your settings.
-- Framework SelectionConfig.FrameWork = "ESX" -- Options: "ESX" or "QBCORE"Config.GiveWeaponsServerSideFrameWork = "esx" -- Options: "esx" or "qbcore"-- Only required if using a custom ESX prefixConfig.CustomESXPrefixEvents = "esx"
If you’re using an older version of ESX that uses events instead of exports, modify the initialization functions to use TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) instead.
Configure how weapons are given and handled with your inventory system:
Copy
-- For ESX with QS InventoryConfig.QSInventory = false-- Controls whether weapons are given server-side or client-sideConfig.GiveWeaponsServerSide = true-- Weapon giving function for server-sideConfig.GiveWeaponServerSideEvent = function(source, weapon, ammo) if Config.GiveWeaponsServerSideFrameWork == "esx" then local xPlayer = ESX.GetPlayerFromId(source) xPlayer.addWeapon(weapon, ammo) -- For QS Inventory, you might use: -- xPlayer.addInventoryItem(weapon, 1) else -- QBCore inventory method local Player = QBCore.Functions.GetPlayer(source) local info = {ammo = ammo} Player.Functions.AddItem(weapon, 1, false, info) endend
Different inventory systems require different approaches for handling weapons. If you’re using a custom inventory system, you may need to modify these functions to match your system’s requirements.
Config.ClearInventoryFunction = function() if Config.FrameWork == "ESX" then if Config.QSInventory then TriggerServerEvent('ffa:clearQSInventory') else RemoveAllPedWeapons(PlayerPedId()) end else SetCurrentPedWeapon(PlayerPedId(), GetHashKey("WEAPON_UNARMED"), true) TriggerServerEvent('ffa:clearQBInventory2') endend
Config.Debug = true -- Enable for additional debugging informationConfig.AdvancedDebug = true -- Enable for more detailed debuggingConfig.ServerName = "Your Server" -- Your server name displayed in various messagesConfig.SavePlayerTime = 60000 -- How often player data is saved (in milliseconds)Config.OpenMenuKey = 38 -- Key code for opening the FFA menu (38 = E)Config.OpenTimeout = 100 -- Cooldown between menu opens (in milliseconds)
-- Money handling optionsConfig.GiveMoneyOnKillToBank = false -- If true, kill rewards go to bank instead of cashConfig.RemoveMoneyFromBankOnJoin = false -- If true, join fee is taken from bank instead of cash
-- Respawn screen settingsConfig.RespawnScreen = true -- Show respawn countdown screenConfig.RespawnCountdown = 4 -- Respawn countdown in secondsConfig.RespawnInstant = false -- Instantly respawn without countdownConfig.SameRespawnCoords = false -- Prevent respawning at the same coordinates twice-- Out of zone settingsConfig.OutZoneScreen = true -- Show out-of-zone countdown screenConfig.OutZoneCountdown = 5 -- Out-of-zone countdown in secondsConfig.OutZoneRespawnInstant = false -- Instantly respawn when out of zone-- In-game HUD settingsConfig.IngameHud = true -- Show the in-game HUD for FFA
-- Weapon ammo settingsConfig.WeaponAmmo = 5000 -- Amount of ammo given when spawningConfig.LeaveAmmo = 200 -- Amount of ammo given when leaving FFA-- Give weapon once on spawn or every respawnConfig.GiveWeapon1TimeOnSpawn = true
Weapon settings control how and when players receive weapons in FFA zones, along with ammo quantities. Adjust these based on your server’s gameplay style.
FFA zones define the combat areas where players fight:
Copy
Config.Zones = { Zone0 = { Name = "Only Pistol", -- Zone name displayed to players Desc = "Pistols only zone with limited weapons.", -- Description AddedDate = "29.06.2022", -- When the zone was added MaxPlayers = 10, -- Maximum players allowed in this zone -- Dimension settings (requires OneSync Infinity) Dimension = true, -- Use separate dimension for this zone DimensionID = 10000, -- Unique dimension ID (must be different for each zone) -- Visual representation of zone boundaries ShowZone = true, -- Show zone boundaries ZoneHeight = 25, -- Height of zone visualization ZoneAlpha = 90, -- Transparency ZoneColor = {r = 69, g = 255, b = 141}, -- RGB color -- Zone boundary coordinates (vertices of the zone) ZoneCoords = { {-154.50605773926, -937.58984375, 253.3971862793}, {-157.92643737793, -948.24786376953, 252.89315795898}, -- Additional coordinates... }, -- Spawn points within the zone Spawnpoints = { {-159.85989379883, -990.80316162109, 254.13130187988}, {-185.45248413086, -1008.3400268555, 254.33544921875}, -- Additional spawn points... }, -- Weapon settings for this zone OwnWeapons = false, -- Allow players to use their own weapons Weapons = { -- Available weapons in this zone "WEAPON_PISTOL", "WEAPON_PISTOL_MK2", "WEAPON_COMBATPISTOL", -- Additional weapons... }, }, -- You can add more zones by adding Zone1, Zone2, etc.}
Each zone should have a unique DimensionID to prevent players in different zones from seeing each other. Make sure your server has OneSync Infinity enabled for the dimension feature to work.
Config.Gamemode = { Gamemode1 = { Name = "Hardcore", Desc = "Es gelten die selben Regeln wie im normalen Spielmodus, stirbst du, verlierst du <span>ALL</span> dein <span>GELD</span> was du dabei hast! Für jede Eliminierung die du erzielst, erhälst du <span>$90,000</span> auf deinem Konto gut geschrieben!", Death = "Alles Geld Verlieren", JoinPrice = 20000, -- Cost to join this game mode KillReward = 90000, -- Money reward per kill }, Gamemode2 = { Name = "Normal", Desc = "Es gelten die typischen FFA Regeln! Du kannst durch das spielen von FFA auszeichnungen erhalten. Durch das erbringen von Auszeichnungen erhälst du weitere Belohnungen!", Death = "Garnichts :)", JoinPrice = 10000, KillReward = 35000, }, // Add more game modes as needed}
Create game modes with different risk/reward profiles to appeal to different player types. High-risk modes like Hardcore can create exciting tension, while Normal modes can be more accessible.
Discord webhooks allow your server to automatically post FFA events,
leaderboards, and other important information to your Discord server. This
helps keep your community engaged and aware of in-game activities.