Standalone β’ QBCore β’ QBox β’ ESX
Place β’ Play β’ Carry β’ Group β’ Mount
Features β’ Installation β’ Configuration β’ Commands β’ Dependencies β’ Support
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.
|
|
|
|
- oxmysql β required only when persistent speaker storage is enabled.
- ox_target β used for third-eye speaker interactions.
| Framework | Support |
|---|---|
| Standalone | β |
| QBCore | β |
| QBox | β |
| ESX | β |
| Automatic Detection | β |
Place the resource inside your server's resources folder:
resources/
βββ 5Mspeakers/
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.
Add the following to your server.cfg:
ensure ox_lib
ensure oxmysql
ensure ox_target
ensure 5MspeakersIf you aren't using oxmysql:
ensure ox_lib
ensure ox_target
ensure 5MspeakersOpen:
5Mspeakers/config.lua
and customize the resource to your server.
Restart your server or resource:
restart 5MspeakersAlmost 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.
Config.Framework = 'auto'Available options:
auto
esx
qbcore
standalone
Automatically detects the framework being used.
For ESX servers.
For QBCore and compatible setups.
For servers that do not use a framework.
Config.UseOxMySQL = trueControls whether speakers are saved using oxmysql.
Config.UseOxMySQL = truePlaced speakers can persist between restarts.
Config.UseOxMySQL = falseDatabase persistence is disabled.
oxmysqlis only needed when this feature is enabled.
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 can be renamed from the configuration.
Config.Commands = {
create = 'create-speaker',
delete = 'delete-speaker',
speaker = 'speaker'
}Opens the speaker creation interface.
You can select the speaker type, give it a name, and place it in the world.
Deletes the closest speaker within the configured interaction distance.
Opens the interaction menu for the closest speaker.
This provides an alternative to using ox_target.
Command permissions can be controlled with:
Config.RequireAcePermissions = {
create = true,
delete = true,
speaker = false
}| 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 allowAllow everyone to use /speaker:
add_ace builtin.everyone command.speaker allowConfig.DefaultVolume = 0.5Controls the default speaker volume.
Range:
0.0 β 1.0
Config.DefaultRange = 15.0Controls how far away players can hear the speaker by default.
Config.MinRange = 3.0
Config.MaxRange = 35.0These prevent players from setting the speaker range outside your configured limits.
For example:
Config.MinRange = 5.0
Config.MaxRange = 50.0Config.SoundUpdateInterval = 200Controls how frequently spatial audio updates.
The value is in milliseconds.
100 = more frequent updates
200 = default
300 = less frequent updates
Config.MaxGroupCount = 5Controls the maximum number of speakers that can be connected to a group.
Default:
5 speakers
For example:
Config.MaxGroupCount = 10would allow groups of up to 10 speakers.
Config.InteractionDistance = 3.0Maximum distance for interacting with a speaker.
Config.TrunkAttachDistance = 3.0Maximum distance required to attach a carried speaker to a vehicle trunk.
Config.NearbySearchRange = 50.0Maximum distance used when searching for nearby speakers, such as when creating groups.
Speakers are configured through:
Config.SpeakerModelsThe 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 |
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.
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 use ox_lib by default:
Config.Notify = function(message, notifyType)
lib.notify({
title = 'Speaker System',
description = message,
type = notifyType or 'info'
})
endYou can replace this function with your own notification system if your server uses something different.
Speakers can be controlled using either:
Third-eye a speaker to access its interaction menu.
Use:
/speaker
to interact with the closest speaker.
The player must be within:
Config.InteractionDistanceOne 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)5Mspeakers/
β
βββ client/
βββ server/
βββ html/
β
βββ config.lua
βββ fxmanifest.lua
βββ video.mp4
βββ README.md
Your resource structure may differ depending on the version you're using.
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_libis running correctly.
Check your ACE permissions:
add_ace group.admin command.create-speaker allowand:
Config.RequireAcePermissions.create = trueIf persistence is enabled:
Config.UseOxMySQL = truemake sure oxmysql is running before 5Mspeakers.
Adjust:
holdOffset
holdRotation
trunkOffset
trunkRotationfor the affected speaker model.
Please refer to the license included with the resource for usage and redistribution terms.
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.