M2O Scripting APIScripting reference
    Preparing search index…
    Global objectServer API

    Jukebox

    Jukebox: {
        getState(jukeboxId: number): JukeboxState | null;
        playSong(jukeboxId: number, seed?: number): boolean;
        stop(jukeboxId: number): boolean;
    }

    Controls synchronized Mafia II jukebox playback by game jukebox identifier.

    Type Declaration

    • getState: function
      • Returns the synchronized state of a jukebox.

        Parameters

        • jukeboxId: number

          Game jukebox identifier.

        Returns JukeboxState | null

        The current playback state, or null when the jukebox has no state.

    • playSong: function
      • Starts synchronized playback on a jukebox.

        Parameters

        • jukeboxId: number

          Game jukebox identifier.

        • Optionalseed: number

          Optional deterministic selection seed.

        Returns boolean

        True when playback was started for a known jukebox.

    • stop: function
      • Stops synchronized playback on a jukebox.

        Parameters

        • jukeboxId: number

          Game jukebox identifier.

        Returns boolean

        True when an active jukebox state was stopped.