Play sound on specific position and radius with interaction sound

Hello. I have a little problem with interaction sound. I play the sound on all players at the hole map. But I want to play the sound on a specific radius at a position. But I’m to stupid to make it. Can anyone help me please?

Here’s the source from my client.lua and the server.lua.

client.lua

RegisterNetEvent('InteractSound_CL:siren1')

-- Audio Triggers
AddEventHandler('InteractSound_CL:siren1', function(soundFile, soundVolume)
	local soundFile = 'siren1'
    SendNUIMessage({
        transactionType     = 'playSound',
        transactionFile     = soundFile,
        transactionVolume   = 250
    })
end)

-- Functions
function Notif( text )
    SetNotificationTextEntry( "STRING" )
    AddTextComponentString( text )
    DrawNotification( false, false )
end

And here is the server.lua

server.lua

RegisterServerEvent('InteractSound_SV:siren1')

RegisterCommand("fire1", function(source, args, rawCommand)
    TriggerClientEvent('InteractSound_CL:siren1', -1, soundFile, soundVolume)
end)

--Audio Triggers
AddEventHandler('InteractSound_SV:siren1', function(soundFile, soundVolume)
    TriggerClientEvent('InteractSound_CL:siren1', source, soundFile, soundVolume)
end)

A little information at the end. It is a fire siren script for the fire alarm on a fire department to call the fire members they are on the station.

help pls

Hi,

Since you are using InteractSound, the InteractSound_SV:PlayWithinDistance event is what you want to use. Here is a link to the event on Github.

Do you know if there is a new fix to make the sounds still play within distance?

I’m using OneSync maybe this is the problem? The sounds play to everyone across the server

My InteractSound resource is 0.5 and I dont really know what else to do but the guy who made that script isn’t responding

I wish it still worked for the distance :frowning:

Is there a way to use 3d positional audio? Not within distance.