Yecoyz.
Docs/yecoyz_jukebox

Configuration

Every option in the Yecoyz Jukebox config file.

Get yecoyz_jukebox

All options are in JBConfig in config.lua.

Songs

The song list, in the order shown on the glass (codes A1–A8, B1–B8, …). Use file for a file in the resource's songs/ folder (mp3, ogg or wav), or url for a direct link to an audio file or a YouTube video. duration in seconds is optional: the first player who loads a song reports its length.

lua
songs = {
    { title = 'Neon Desert Drive', artist = 'Yecoyz Demo Band', file = 'songs/neon_desert_drive.mp3', duration = 80 },
    { title = 'My Song', artist = 'My Band', url = 'https://example.com/my_song.mp3' },
},

Files in songs/ are loaded automatically, so you don't need to edit fxmanifest.lua.

Tip

Only add music you have the right to play on your server. The four demo songs are royalty-free.

Interaction

Option Default Description
interaction 'auto' 'auto' uses ox_target when it runs, otherwise the prompt (E). 'target' or 'prompt' forces one.
interactDistance 1.4 Range of the prompt / target, from the spot in front of the buttons.
controlDistance 3.0 How close a player must stand to change the music. Checked on the server.

Queue and price

Option Default Description
queueLimit 20 Songs waiting per jukebox.
perPlayerQueue 3 Songs one player may have waiting per jukebox.
cooldownMs 1500 Time between two song picks of one player, in milliseconds.
maxSongSeconds 900 A song whose length is unknown moves on after this many seconds.
price 0 Price per song, charged as cash through yecoyz_core. 0 = free.
Option Default Description
allowUrls true Whether players can play YouTube and audio links.
urlAce false Ace needed to play links, for example 'yecoyz_jukebox.url'. false = everyone.
linkLimit 30 How many played links stay on each jukebox's list (saved in data/links.json). The oldest goes when full.

Permissions and messages

Option Default Description
placeAce 'yecoyz_jukebox.place' Ace for the editor and /jukebox remove. Admins with the command ace can use them too.
announce true Shows "Now playing" to players who can hear a new song start.

Audio

Option Default Description
defaultVolume 0.6 Jukebox volume (0–1) when it's first used. Players change it with ← / →.
volumeStep 0.1 How much one press of ← / → changes the volume.
refDistance 2.5 Full volume within this many metres of the speaker.
maxDistance 32.0 Silent beyond this distance.
rolloff 1.1 How fast the volume falls off after refDistance (1 = inverse distance).
streamDistance 42.0 Songs start loading this close, so they're in sync before you hear them.
pan 0.7 Left/right spread (0 = mono).
driftSeek 0.6 Seconds out of sync before a player jumps to the right position. Smaller drift is corrected smoothly.
pauseMenuMute true Mutes the music in the pause menu.

Muffling

Each situation has a low-pass cutoff (Hz), a volume factor and an optional bass boost (dB). They stack.

lua
muffle = {
    otherInterior = { gain = 0.4, cutoff = 450, bass = 7 }, -- outside the building, walls or a closed door between
    doorway = { gain = 0.6, cutoff = 1600, bass = 3 },       -- outside, looking in through an open door or window
    occluded = { gain = 0.7, cutoff = 2400 },                -- a wall between you and the jukebox (same building)
    vehicle = { gain = 0.55, cutoff = 1100, bass = 4 },      -- in a closed vehicle
    behindCutoff = 9000,                                     -- slightly duller when the jukebox is behind the camera
},

Screen and glow

lua
screen = {
    distance = 5.0, -- the glass shows what's playing to anyone this close
    width = 1024, height = 880, -- texture size
},
light = { enabled = true, distance = 30.0, range = 1.8, intensity = 0.35, pulse = 1.4 },

Locations

Extra jukeboxes spawned for everyone. Jukeboxes of a supported model that are already on the map work without this. x, y, z is the floor under the jukebox, and heading is the way the front faces.

lua
locations = {
    { id = 'vanilla', model = 'prop_jukebox_02', x = 0.0, y = 0.0, z = 0.0, heading = 0.0, label = 'Vanilla Unicorn' },
},
Tip

The editor is the easier way to place jukeboxes. It saves them without editing the config.

Models

Per model: where the hands land on the buttons (anim.origin), the glass the songs are drawn on (screen), the browsing camera, the speaker (sound) and the glow (light). All offsets are local to the prop. like copies another model's entry.

lua
models = {
    prop_jukebox_02 = {
        label = 'Jukebox',
        anim = { origin = vector3(0.0, -0.9, 0.0) },
        screen = { left = -0.35, right = 0.35, bottom = vector2(-0.48, 1.09), top = vector2(-0.18, 1.63) },
        camera = { pos = vector3(0.16, -1.0, 2.15), look = vector3(0.0, -0.33, 1.36), fov = 50.0 },
        sound = vector3(0.0, -0.3, 0.8),
        light = vector3(0.0, -0.85, 0.75),
    },
    bkr_prop_clubhouse_jukebox_01b = { like = 'prop_jukebox_02' },
},

Development

Option Default Description
devBridge false Development tooling.
Warning

Keep devBridge = false on a live server. It lets tools on the server machine run code on a connected client.