Server

AttachSongToEntity

Allows you to attach songs to entities.

exports["wais-speaker"]:AttachSongToEntity(netId, url, volume, loop, rate, maxDistance)
  • netId: number

    • The NetworkId belonging to the entity to which the song will be attached.

  • url: string

  • volume?: float

    • The volume level of the song.

    • Min: 0.0

    • Max: 1.0

    • Default: 0.50

  • loop?: boolean

    • Should the song be played again and again?

    • Default: false

  • rate?: float

    • The playback speed of the song.

    • Default: 1.0

  • maxDistance?: float

    • The distance value at which users will interact to hear the song.

    • Default: Config.InteractionDistances.speakers (10.0)

Return:

  • success: boolean

  • message: string


DestroySpeaker

It allows you to completely delete the song

  • netId: number

    • NetworkId belonging to the entity to which the song will be deleted

Return:

  • success: boolean

  • message: string


GetSpeaker

It allows you to access the speaker and its methods.

  • netId: number

    • The NetworkId of the speaker you want to access.

Return:

  • destroy()

    • Deletes the song completely.

  • pause()

    • It stops the song.

  • resume()

    • Continues the song.

  • setVolume(volume)

    • Adjusts the volume of the song.

    • volume: number

  • setDistance(distance)

    • It changes the distance the song can be heard.

    • distance: float

  • seek(duration)

    • You can skip to any second in the song.

    • duration: float

Last updated