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.