Skip to content

Latest commit

Β 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”Š 5Mspeakers

A modern, immersive speaker system for FiveM

Standalone β€’ QBCore β€’ QBox β€’ ESX

FiveM Lua ox_lib oxmysql




Place β€’ Play β€’ Carry β€’ Group β€’ Mount


Features β€’ Installation β€’ Configuration β€’ Commands β€’ Dependencies β€’ Support



Watch 5Mspeakers Demo




πŸ“– About

5Mspeakers is a fully configurable speaker system built for FiveM.

Place physical speakers around your server, play YouTube audio, adjust the hearing distance, group multiple speakers together, carry speakers around, mount them to vehicle trunks, and control them through ox_target or the /speaker command.

The resource is designed to work across multiple frameworks while keeping the majority of the system framework-independent.


✨ Features

🎡 Audio

  • YouTube URL playback
  • YouTube video IDs
  • Spatial audio
  • Custom volume
  • Custom hearing range
  • Shared playback

πŸ”Š Speakers

  • Multiple speaker models
  • Custom speaker names
  • Physical world objects
  • Pick up speakers
  • Carry speakers
  • Vehicle trunk attachment

πŸ”— Speaker Groups

  • Group nearby speakers
  • Up to 5 speakers by default
  • Synchronized speaker systems
  • Configurable group limits

🎯 Interaction

  • ox_target support
  • /speaker command
  • ox_lib menus
  • Configurable interaction distances
  • Admin-controlled creation/deletion

πŸ“¦ Dependencies

Required

Optional

  • oxmysql β€” required only when persistent speaker storage is enabled.
  • ox_target β€” used for third-eye speaker interactions.

Framework Support

Framework Support
Standalone βœ…
QBCore βœ…
QBox βœ…
ESX βœ…
Automatic Detection βœ…

πŸš€ Installation

1. Download

Place the resource inside your server's resources folder:

resources/
└── 5Mspeakers/

2. Install Dependencies

Make sure ox_lib is installed and started before 5Mspeakers.

If using persistent speakers, also install oxmysql.

If using third-eye interactions, install ox_target.

3. Start the Resources

Add the following to your server.cfg:

ensure ox_lib
ensure oxmysql
ensure ox_target
ensure 5Mspeakers

If you aren't using oxmysql:

ensure ox_lib
ensure ox_target
ensure 5Mspeakers

4. Configure

Open:

5Mspeakers/config.lua

and customize the resource to your server.

5. Restart

Restart your server or resource:

restart 5Mspeakers

βš™οΈ Configuration

Almost everything you need to customize is located inside:

config.lua

The configuration is intentionally kept in one place so server owners can easily modify the resource without editing the main scripts.


🧩 Framework

Config.Framework = 'auto'

Available options:

auto
esx
qbcore
standalone

auto

Automatically detects the framework being used.

esx

For ESX servers.

qbcore

For QBCore and compatible setups.

standalone

For servers that do not use a framework.


πŸ’Ύ Database

Config.UseOxMySQL = true

Controls whether speakers are saved using oxmysql.

Enabled

Config.UseOxMySQL = true

Placed speakers can persist between restarts.

Disabled

Config.UseOxMySQL = false

Database persistence is disabled.

oxmysql is only needed when this feature is enabled.


🎡 YouTube API

Config.YoutubeApiKey = ''

A YouTube API key is not required for normal playback.

You can leave this blank:

Config.YoutubeApiKey = ''

YouTube playback can still use supported URLs and video IDs.

The API key is optional and can be used for additional YouTube information such as metadata and playlist functionality.


πŸŽ›οΈ Commands

Commands can be renamed from the configuration.

Config.Commands = {
    create = 'create-speaker',
    delete = 'delete-speaker',
    speaker = 'speaker'
}

/create-speaker

Opens the speaker creation interface.

You can select the speaker type, give it a name, and place it in the world.

/delete-speaker

Deletes the closest speaker within the configured interaction distance.

/speaker

Opens the interaction menu for the closest speaker.

This provides an alternative to using ox_target.


πŸ” ACE Permissions

Command permissions can be controlled with:

Config.RequireAcePermissions = {
    create = true,
    delete = true,
    speaker = false
}

Default

Command ACE Required
/create-speaker βœ…
/delete-speaker βœ…
/speaker ❌

For example:

add_ace group.admin command.create-speaker allow
add_ace group.admin command.delete-speaker allow

Allow everyone to use /speaker:

add_ace builtin.everyone command.speaker allow

πŸ”Š Audio Configuration

Default Volume

Config.DefaultVolume = 0.5

Controls the default speaker volume.

Range:

0.0 β†’ 1.0

Default Range

Config.DefaultRange = 15.0

Controls how far away players can hear the speaker by default.


Range Limits

Config.MinRange = 3.0
Config.MaxRange = 35.0

These prevent players from setting the speaker range outside your configured limits.

For example:

Config.MinRange = 5.0
Config.MaxRange = 50.0

Audio Update Rate

Config.SoundUpdateInterval = 200

Controls how frequently spatial audio updates.

The value is in milliseconds.

100 = more frequent updates
200 = default
300 = less frequent updates

πŸ”— Speaker Groups

Config.MaxGroupCount = 5

Controls the maximum number of speakers that can be connected to a group.

Default:

5 speakers

For example:

Config.MaxGroupCount = 10

would allow groups of up to 10 speakers.


πŸ“ Interaction Distances

Speaker Interaction

Config.InteractionDistance = 3.0

Maximum distance for interacting with a speaker.

Vehicle Trunk

Config.TrunkAttachDistance = 3.0

Maximum distance required to attach a carried speaker to a vehicle trunk.

Speaker Search

Config.NearbySearchRange = 50.0

Maximum distance used when searching for nearby speakers, such as when creating groups.


πŸ”Š Speaker Models

Speakers are configured through:

Config.SpeakerModels

The default models are:

Model Name
prop_speaker_05 Wood Speaker 1
prop_speaker_03 Wood Speaker 2
h4_prop_battle_club_speaker_array Small Floor Speaker
h4_prop_battle_club_speaker_med Medium Speaker
sf_prop_sf_speaker_stand_01a Standing Speaker

βž• Adding a Speaker

You can add your own speaker models directly to the configuration:

{
    model = 'my_custom_speaker',
    label = 'Custom Speaker',

    holdOffset = vector3(0.0, 0.35, 0.0),
    holdRotation = vector3(0.0, 0.0, 0.0),

    trunkOffset = vector3(0.0, -0.15, 0.1),
    trunkRotation = vector3(0.0, 0.0, 0.0)
}

Each speaker has its own:

model
label
holdOffset
holdRotation
trunkOffset
trunkRotation

This allows different models to have completely different carrying and vehicle positions.


🧳 Carry System

The carrying system is configured with:

Config.Carry = {
    animDict = 'anim@heists@box_carry@',
    animClip = 'idle',
    animFlag = 49,
    bone = 60309
}

This controls the animation and bone used when carrying a speaker.


πŸ”” Notifications

Notifications use ox_lib by default:

Config.Notify = function(message, notifyType)
    lib.notify({
        title = 'Speaker System',
        description = message,
        type = notifyType or 'info'
    })
end

You can replace this function with your own notification system if your server uses something different.


🎯 Interactions

Speakers can be controlled using either:

ox_target

Third-eye a speaker to access its interaction menu.

/speaker

Use:

/speaker

to interact with the closest speaker.

The player must be within:

Config.InteractionDistance

πŸš— Vehicle Speakers

One of the main features of 5Mspeakers is the ability to turn speakers into mobile audio systems.

A player can:

Pick Up Speaker
       ↓
Carry Speaker
       ↓
Walk to Vehicle
       ↓
Attach to Trunk
       ↓
Continue Playback

Each speaker model has configurable trunk positioning:

trunkOffset = vector3(0.0, -0.15, 0.1)
trunkRotation = vector3(0.0, 0.0, 0.0)

πŸ—‚οΈ Resource Structure

5Mspeakers/
β”‚
β”œβ”€β”€ client/
β”œβ”€β”€ server/
β”œβ”€β”€ html/
β”‚
β”œβ”€β”€ config.lua
β”œβ”€β”€ fxmanifest.lua
β”œβ”€β”€ video.mp4
└── README.md

Your resource structure may differ depending on the version you're using.


πŸ› οΈ Troubleshooting

Speaker doesn't play audio

Check:

  • The YouTube URL/video ID is valid.
  • Your FiveM client has audio enabled.
  • You are within the configured speaker range.
  • The speaker volume is above 0.
  • ox_lib is running correctly.

/create-speaker doesn't work

Check your ACE permissions:

add_ace group.admin command.create-speaker allow

and:

Config.RequireAcePermissions.create = true

Speakers disappear after restart

If persistence is enabled:

Config.UseOxMySQL = true

make sure oxmysql is running before 5Mspeakers.

Speaker positioning is incorrect

Adjust:

holdOffset
holdRotation
trunkOffset
trunkRotation

for the affected speaker model.


πŸ“„ License

Please refer to the license included with the resource for usage and redistribution terms.


πŸ’¬ Support

If you encounter an issue, please provide:

FiveM Artifact:
Framework:
5Mspeakers Version:
ox_lib Version:
oxmysql Version:
ox_target Version:
Server Console Error:
F8 Error:
Description:

This makes troubleshooting significantly easier.


πŸ”Š 5Mspeakers

A better way to bring music into your FiveM world.

⬆ Back to Top

About

A free alternative to a speaker system for your fivem server.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages