Skip to content

S4 Performance Lab (Fps Menu)

FPS boost menu + kill/hit effect system for FiveM. Players get a full in-game panel to tweak render settings, pick performance presets, and set up custom kill & hit effects with sounds, screen FX, par

All settings are saved per-player on the server side and auto-loaded on reconnect.


Table of Contents#

  • Getting Started
  • Configuration
    • Locale & Keybinds
    • Feature Flags
    • Data Saving
    • Notifications
    • Kill Effect Settings
    • Hit Effect Settings
    • Sound Limits
    • Default Player Settings
    • Preset Draw Distances
  • Menu Tabs
  • FPS Tab
    • Live FPS Chart
    • Presets
    • Sliders
    • Toggles
  • Kill Effect Tab
    • Kill Toggle
    • Kill Style
    • Screen Effects
    • Color Picker
    • Kill Sounds
  • Hit Effect Tab
    • Hit Toggle
    • Hit Style
    • Screen Effects
    • Color Picker
    • Particles
    • Hit Sounds
  • Save & Load System
  • Commands & Keybinds
  • Test Ped
  • Localization
  • Dependencies

Getting Started#

  1. Drop the resource folder into your resources directory.

  2. Add to your server.cfg:

    text
    ensure ox_lib
    ensure s4-fpsmenu
    
  3. Edit config.lua to fit your server.

That's it — players can press F7 for the FPS menu or F6 for effects.


Configuration#

Everything lives in config.lua.

Locale & Keybinds#

KeyDefaultWhat it does
Config.Locale'en'Menu language. Ships with: ar, de, el, en, es, fr, it, pl, pt, ru, tr. Want another language? Copy any file in locales/ and translate it.
Config.FPSMenuKey'F7'Opens the FPS boost menu.
Config.EffectsMenuKey'F6'Opens the kill & hit effects menu.

Feature Flags#

KeyDefaultWhat it does
Config.EnableFPSMenutrueSet to false to completely disable the FPS menu for everyone.
Config.EnableEffectsMenutrueSet to false to completely disable the effects menu for everyone.

Data Saving#

KeyDefaultWhat it does
Config.LoadUserDataOnStarttrueAuto-load saved settings when a player connects.
Config.AutoSaveOnClosetrueAuto-save when the menu is closed.

Notifications#

KeyDefaultWhat it does
Config.DebugfalsePrints debug info to console. Keep this off in production.
Config.NotifytrueShows ox_lib notifications to players. false = silent mode.
Config.NotifyDuration3000How long notifications stay on screen (ms).

Kill Effect Settings#

These are server-wide behavior values — not personal player preferences.

KeyDefaultWhat it does
Config.KillEffect.duration3.0How long the kill marker stays visible (seconds).
Config.KillEffect.speed0.02How fast the marker floats upward (units/frame).
Config.KillEffect.scale0.5Size of the marker.

Hit Effect Settings#

KeyDefaultWhat it does
Config.HitEffect.duration0.5How long the hit marker is visible (seconds).
Config.HitEffect.particleDuration0.8How long the particle effect plays (seconds).

Sound Limits#

You can cap the max volume players are allowed to set:

KeyDefaultWhat it does
Config.MaxKillSoundVolume100Max kill sound volume (0–100).
Config.MaxHitSoundVolume100Max hit sound volume (0–100).

Default Player Settings#

The Config.Defaults block defines initial values for new players (no saved data yet). Existing players always keep their own saved settings.

FPS / Visual:

KeyDefaultNotes
presetnilNo preset active. Options: 'potato', 'ultra_low', 'low', 'medium'
shadowDist5.0Shadow distance. 0 = off, 5 = full.
objQuality1.0Object LOD quality (0–1).
charQuality1.0Character LOD quality (0–1).
vehDist9999.0Vehicle render distance in metres.
toggles.clearEventsfalseAuto effect cleanup.
toggles.lightReflectionstrueLight reflections.
toggles.rainWindtrueRain & wind.
toggles.bloodStainstrueBlood stains.
toggles.fireEffectstrueFire effects.

Kill Effect:

KeyDefaultNotes
killEnabledfalseOff by default.
killStyle{ marker = false, screen = false }Both sub-options off.
killFx'DeathFailOut'Default screen FX.
killColor{ r=255, g=0, b=0, a=200 }Red.
killSoundEnabledfalseOff by default.
killSoundId'ks1'Default sound.
killSoundVolume50Mid volume.

Hit Effect:

KeyDefaultNotes
hitEnabledfalseOff by default.
hitStyle{ particle = false, screen = false }Both sub-options off.
hitFx'FocusIn'Default screen FX.
hitColor{ r=255, g=50, b=50, a=180 }Red.
hitParticlescr_martin1 / scr_sol1_sniper_impactDefault particle.
hitSoundEnabledfalseOff by default.
hitSoundId'hit1'Default sound.
hitSoundVolume50Mid volume.

Preset Draw Distances#

Config.DrawPresets controls LOD and entity cleanup distances for each performance level:

PresetLOD ScalePed Cleanup DistVehicle Cleanup Dist
Potato0.85180 m250 m
Ultra Low0.80130 m190 m
Low0.75100 m150 m
Medium0.90100 m150 m

The menu has 3 tabs along the top:

TabWhat's inside
FPSPerformance tuning — presets, sliders, toggles
Kill EffectVisuals and sounds when you kill someone
Hit EffectVisuals and sounds when you land a hit

FPS Tab#

Live FPS Chart#

There's a real-time FPS graph at the top of the tab. It tracks the last 30 readings (updated every 500 ms) and shows the current FPS as a big number. Useful for seeing the immediate impact of your changes.

Presets#

Quick performance profiles. Pick one and everything adjusts at once:

PresetWhat happens
DefaultResets everything back to normal. All optimizations off, shadows/LOD/distances restored, timecycle cleared.
PotatoMaximum FPS, minimum visuals. Shadows off, custom timecycle applied, decals/particles/occlusion disabled, artificial lights forced on, distant vehicles hidden, weather locked to CLEAR, rain & wind off.
Ultra LowSimilar to Potato but slightly less aggressive. Different timecycle combo, distant cars not fully hidden.
LowTimecycle applied, shadows off, entity cleanup active. Less aggressive than Ultra Low.
MediumNo timecycle change, shadows at 3.0, no entity cleanup. Just light optimization.

When a preset is applied the script also runs cleanup on misc effects (broken glass, help messages, etc.) and clears ped blood/wetness/dirt.

Note: Presets can interfere with hit particles. If particles aren't showing up, go back to Default.

Sliders#

Fine-tune individual settings:

SliderRangeStepHow it works
Shadow Quality0–101Controls shadow render distance and quality. At 0 shadows are completely off. Uses CascadeShadows* natives.
Texture Detail0.0–1.00.05Object LOD multiplier. Lower values = objects switch to low-detail models sooner. Below 1.0, objects past 50 + (quality × 150) metres get reduced LOD.
Resolution Scale0.2–0.90.05Map/building LOD quality via OverrideLodscaleThisFrame(). Lower = less building detail. Clamped to 0.2–0.9 on both client and UI side.
Character Quality0.0–1.00.05Character LOD multiplier. Lower values reduce detail on distant peds and turn off AO blob rendering.
Vehicle Distance18–50010Vehicle render cutoff in metres. Vehicles past this distance are made invisible. Floor is 18 m.

Toggles#

On/off switches for specific optimizations:

ToggleDefaultWhat it does
Auto CleanupOFFEvery 500 ms: clears broken glass, removes decals and particles in a 100 m radius.
Light ReflectionsONTurn off to disable light reflections.
Rain & WindONTurn off to force rain level and wind speed to 0 every second.
Blood StainsONTurn off to clear blood on your ped and all nearby peds every 500 ms.
Fire EffectsONTurn off to kill all fires within 500 m and remove particles within 200 m. Runs every frame so it's aggressive.

Note: Turning off Fire Effects can break hit particle effects since it removes particles in range.


Kill Effect Tab#

Everything here triggers when you kill another ped.

Kill Toggle#

Master switch — turns kill effects on or off. Off by default.

The script detects kills two ways:

  1. Listens to CEventNetworkEntityDamage and checks the isDead flag.
  2. Runs a fallback loop every 100 ms that scans nearby peds with IsPedDeadOrDying() + GetPedSourceOfDeath(), so kills don't get missed.

Both methods work for vehicle kills (if you're in the driver seat).

Kill Style#

Two independent sub-toggles:

StyleWhat it does
MarkerDraws a 3D crosshair marker above the victim's head. Floats upward over time and fades after the configured duration. Uses DrawMarker() (type 25 + type 2). Color is customizable.
ScreenPlays a full-screen post-process effect using AnimpostfxPlay(). Auto-stops after 1 second.

You can have both on at the same time.

Kill Screen Effects#

39 screen effects to choose from. All use GTA V's built-in AnimPostFX system. When you select one, it plays a 1.5-second preview.

The first 15 are shown by default. Click "Show All" to see the rest.

Full list (click to expand)
IDLabel
DeathFailOutDeath Fail
FocusInFocus In
FocusOutFocus Out
SwitchHUDInHUD In
SwitchHUDOutHUD Out
MinigameEndNeutralEnd Neutral
MinigameEndTrevorEnd Trevor
MinigameEndFranklinEnd Franklin
MinigameEndMichaelEnd Michael
MinigameTransitionOutTrans. Out
MinigameTransitionInTrans. In
RampageRampage
RampageOutRampage Out
SwitchShortNeutralInSwitch Neutral
SwitchShortFranklinInSwitch Frank.
SwitchShortTrevorInSwitch Trevor
SwitchShortMichaelInSwitch Michael
SwitchOpenMichaelInOpen Michael
SwitchOpenFranklinInOpen Franklin
SwitchOpenTrevorInOpen Trevor
SwitchHUDMichaelOutHUD Michael
SwitchHUDFranklinOutHUD Franklin
SwitchHUDTrevorOutHUD Trevor
SwitchShortFranklinMidFrank. Mid
SwitchShortMichaelMidMichael Mid
SwitchShortTrevorMidTrevor Mid
MPCoronaSwitchMP Corona
MenuMGHeistInHeist
MenuMGTournamentInTournament
MenuMGSelectionInSelection
ChopVisionChop Vision
DMT_flight_introDMT Intro
DMT_flightDMT Flight
DrugsDrivingInDrugs In
DrugsDrivingOutDrugs Out
SwitchOpenNeutralFIB5FIB Neutral
HeistLocateHeist Locate
HeistCelebPassHeist Pass
HeistCelebFailHeist Fail

Kill Color Picker#

7 color options for the marker:

ColorRGB
Red255, 0, 0
Orange255, 77, 0
Yellow255, 255, 0
Green0, 255, 0
Blue0, 189, 248
Pink255, 0, 255
White255, 255, 255

Kill Sounds#

Separate toggle from the kill effect itself — you can have sounds without visuals or vice versa. Off by default.

  • 18 sounds available (ks1 through ks18)
  • Selecting a sound plays it as a preview
  • Volume slider: 0–100
  • Server owner can cap max volume with Config.MaxKillSoundVolume
  • Audio plays through the NUI browser layer

Hit Effect Tab#

Triggers when you deal damage to a ped (non-lethal hits).

Hit Toggle#

Master switch. Off by default.

Detection: listens to CEventNetworkEntityDamage. Checks that the attacker is your ped (or a vehicle you're driving) and the victim is another ped. Ignores self-damage.

Hit Style#

Two independent sub-toggles:

StyleWhat it does
ParticleSpawns a particle effect at the exact bone that got hit. Uses GetPedLastDamageBone() to find the impact point and spawns the particle there. Auto-stops after particleDuration (0.8 s).
ScreenPlays a screen-wide post-process effect via AnimpostfxPlay().

Hit Screen Effects#

10 screen effects, each with a preview thumbnail in the menu

Selecting one plays a 1.5-second preview in-game.

Hit Color Picker#

Same 7 colors as the kill effect (Red, Orange, Yellow, Green, Blue, Pink, White).

Particles#

20 particle effects. Each one shows a thumbnail in the menu grid. First 10 are shown by default, hit "Show All" for the rest.

When you pick a particle, it plays a 1.2-second preview at your ped's head position.

Heads up: FPS presets (especially Potato and Ultra Low) remove particles in range as part of their optimization. If your hit particles aren't showing, reset FPS settings to Default first.

Hit Sounds#

Works the same way as kill sounds. Separate toggle, off by default.

  • 10 sounds available (hit1 through hit10)
  • Selecting a sound plays a preview
  • Volume slider: 0–100
  • Server owner can cap max volume with Config.MaxHitSoundVolume

Save & Load System#

How it works:

  • Each player is identified by their license: identifier (: replaced with _ in the filename).
  • Settings are stored as JSON files in the data/ folder. Example: data/license_abc123def.json
  • If Config.AutoSaveOnClose is on, settings save every time the player closes the menu.
  • If Config.LoadUserDataOnStart is on, saved settings are loaded when the player joins.
  • There's also a manual cloud save button in the UI (currently hidden, ready for future use).

What gets saved:

Preset, shadow distance, object quality, character quality, vehicle distance, LOD scale, all toggle states, kill effect settings (enabled, style, screen FX, color, sound config), hit effect settings (enabled, style, screen FX, color, particle, sound config).


Commands & Keybinds#

CommandDefault KeyWhat it does
/fpsF7Opens the FPS boost menu
/effectsF6Opens the kill & hit effects menu

Keys are registered with RegisterKeyMapping() so players can rebind them from the FiveM settings.


Test Ped#

When Config.EnableTestPedCommand is true:

CommandWhat it does
/testpedSpawns a godmode + frozen test ped in front of you. Run it again to delete the ped. Useful for testing kill/hit effects without needing another player.

Localization#

11 languages included out of the box:

CodeLanguage
arArabic
deGerman
elGreek
enEnglish
esSpanish
frFrench
itItalian
plPolish
ptPortuguese
ruRussian
trTurkish

Adding a new language: copy any file from locales/, translate the strings, done.


Dependencies#

DependencyWhy
ox_libUsed for notifications (lib.notify)
  • Requires Lua 5.4 (lua54 'yes' in manifest)
  • Requires FiveM cerulean manifest version or newer