Skip to content

Screen Effects

The client-side Screen global manages post-processing screen effects (blur, color grading, etc.) with a priority system. Never call AnimpostfxPlay directly — Screen ensures only the highest-priority effect is active at any time.

Applying an Effect

lua
Screen.apply(effectName, priority, opts)
lua
Screen.apply('DeathFailMPIn', 10, {})
ParameterTypeDescription
effectNamestringFiveM Animpostfx effect name
prioritynumberHigher number wins when multiple effects compete
optstableOptions passed to AnimpostfxPlay (optional)

Removing an Effect

lua
Screen.remove('DeathFailMPIn')

If a lower-priority effect was waiting underneath, it becomes active automatically.

Clearing All Effects

lua
Screen.clear()

Priority Guidelines

Use CaseSuggested Priority
Ambient/atmosphere1–5
Ability / status effect10–20
Cinematic / cutscene50
Death / respawn100

Full Example

lua
-- Apply blur while the player is handcuffed
AddEventHandler('mymodule:handcuffed', function()
    Screen.apply('CamPushInNeutral', 15, {})
end)

AddEventHandler('mymodule:uncuffed', function()
    Screen.remove('CamPushInNeutral')
end)

API Reference

MethodDescription
Screen.apply(effectName, priority, opts)Apply a screen effect at the given priority
Screen.remove(effectName)Remove a specific screen effect
Screen.clear()Remove all active screen effects

Client-only

Screen is a client-side global. It is not available in server scripts.

See Also

Released under the MIT License.