Tommy's AFK Cinematics
Cinematic camera shots whenever you go AFK!
Escrow Encrypted: Yes | Requirements: None
Features
Smooth Cinematics
Shuffled Custom Background Music (optional)
Smart Shot Selection (prevents clipping and repetative shots (not always))
Smart Beat Detection (attempts to cut on beat if music is enabled)
Add or modify any camera sequence in the configuration
Configurable AFK detection and triggering
Live Test Server
If you would like to test it out yourself, come check it out:
Open FiveM & Press F8
Type
connect 178.156.146.100
& hit enter.Hop in a vehicle and run the
/afk
command!
Configuration
AFK Detection
Config.Timeout
(number) - Seconds of inactivity before AFK camera activates. Set to0
to disable automatic detection.
Music Settings
Config.useMusic
(boolean) - Enable/disable background music during AFK mode.Config.musicVolume
(number) - Music volume level (0.0
to1.0
).Config.musicTracks
(table) - Array of music (ogg) files from themusic/
folder. Randomly selected on AFK start.
Camera Sequences
Config.CameraSequences
(table) - Array of cinematic camera sequences. Each sequence has:startPos
- Camera cuts to this positionoffset
- vector3(x, y, z) relative to vehiclerotation
- vector3(pitch, roll, yaw) in degreesfov
- Field of view (number)dof
- Depth of field {near, far, strength}
endPos
- Camera smoothly animates to this position (5-10 second duration)Same properties as
startPos
Events
tommys-afk:stateChanged
tommys-afk:stateChanged
Triggered when AFK state changes.
Parameters:
isAFK
(boolean) -true
when entering AFK,false
when exiting
Example:
AddEventHandler('tommys-afk:stateChanged', function(isAFK)
if isAFK then
-- Player entered AFK mode
DisplayRadar(false)
else
-- Player exited AFK mode
DisplayRadar(true)
end
end)
Exports
IsAFK()
IsAFK()
Check if player is currently in AFK mode.
Returns: boolean
local afk = exports['tommys-afk']:IsAFK()
StartAFK()
StartAFK()
Manually start AFK camera (requires player in vehicle).
Returns: boolean
- true
if started successfully
exports['tommys-afk']:StartAFK()
StopAFK()
StopAFK()
Manually stop AFK camera.
Returns: nil
exports['tommys-afk']:StopAFK()
ToggleAFK()
ToggleAFK()
Toggle AFK mode on/off.
Returns: boolean
- New AFK state after toggle
local newState = exports['tommys-afk']:ToggleAFK()
IsAFKEnabled()
IsAFKEnabled()
Check if AFK system is enabled for the player.
Returns: boolean
local enabled = exports['tommys-afk']:IsAFKEnabled()
SetAFKEnabled(enabled)
SetAFKEnabled(enabled)
Enable or disable the AFK system entirely for the player.
Parameters:
enabled
(boolean) -true
to enable,false
to disable
Returns: boolean
- true
if successful
exports['tommys-afk']:SetAFKEnabled(false) -- Disable AFK system
Commands
/afk
/afk
Manually toggle AFK camera on/off. Must be in a vehicle.
/toggle_afk_cinematics
/toggle_afk_cinematics
Enable/disable the entire AFK system for your session.
Notes
AFK camera only works when player is in a vehicle
Camera automatically exits on any input (movement, camera rotation, controls)
System uses smart sequence selection to avoid obstructions and vehicle clipping (not always)
Automatic AFK triggers after
Config.Timeout
seconds of inactivity
Last updated