Same here. Any solution yet?
Try this:
TriggerServerEvent(‘InteractSound_SV:PlayWithinDistance’, 10, “demo”, 1.0)
I restart the discussion, I have the same problem as Patrik_Tjernstrom, my sound only lasts 10 seconde while it lasts 2 minutes, someone can help me ?
( Sorry for translate i french boy )
Prob not the right place to ask but anyways, i want to make so a sound plays when pressing E if player is in Mule. But im stoopid so i need help…
local requiredModel = GetHashKey(“mule”)
Citizen.CreateThread(function()
while true do
Citizen.Wait(500)
ped = PlayerPedId()
if IsPedInAnyVehicle(ped, true) then
currentCar = GetVehiclePedIsIn(ped, false)
carModel = GetEntityModel(currentCar)
if IsVehicleModel(currentCar, requiredModel) then
if IsControlPressed(0, Keys['E']) then
TriggerServerEvent("InteractSound_SV:PlayWithinDistance", "glass", 1.0)
end
end
end
end)
local standardVolumeOutput = 1.0;
RegisterNetEvent('InteractSound_CL:PlayWithinDistance')
AddEventHandler('InteractSound_CL:PlayWithinDistance', function(playerNetId, maxDistance, soundFile, soundVolume)
local lCoords = GetEntityCoords(GetPlayerPed(-1))
local eCoords = GetEntityCoords(GetPlayerPed(GetPlayerFromServerId(playerNetId)))
local distIs = Vdist(lCoords.x, lCoords.y, lCoords.z, eCoords.x, eCoords.y, eCoords.z)
if(distIs <= maxDistance) then
SendNUIMessage({
transactionType = 'playSound',
transactionFile = glass,
transactionVolume = soundVolume
})
end
end)
Is there any method to loop a 1-second sound?
in nui index.html > js script -> audioPlayer.loop doesnt work.
I just need a 1 second sound loop for my interactions (for example: Somebody cancel interaction, there is no sound longer played than needed)
I am having issues with the sound.
They are only playing for a few seconds, then they just stop.
My code:
Citizen.CreateThread(function()
while true do
Citizen.Wait(10)
if IsControlJustReleased(0, 344) then
TriggerServerEvent('InteractSound_SV:PlayOnAll', 'purge', 1.0)
Wait(16000) -- Waits for the duration of the sound file
end
end
end)
It seems to be the same length as the original ‘demo.ogg’ file.
Is there a place where I need to change the length?
Someone help me to use it, I did not understand how to use it
Same problem here 
hi, i keep getting
cannot load resource, no errors showing.
here is my resource
– InteractSound by Scott
– Verstion: v0.0.1
– Manifest Version
resource_manifest_version ‘77731fab-63ca-442c-a67b-abc70f28dfa5’
– Client Scripts
client_script ‘client/main.lua’
– Server Scripts
server_script ‘server/main.lua’
– NUI Default Page
ui_page(‘client/html/index.html’)
– Files needed for NUI
– DON’T FORGET TO ADD THE SOUND FILES TO THIS!
files({
‘client/html/index.html’,
– Begin Sound Files Here…
– client/html/sounds/ … .ogg
‘client/html/sounds/beep.ogg’
‘client/html/sounds/belt.ogg’,
‘client/html/sounds/heartbeat.ogg’,
‘client/html/sounds/lock.ogg’,
‘client/html/sounds/off.ogg’,
‘client/html/sounds/on.ogg’,
‘client/html/sounds/seatbelt.ogg’,
‘client/html/sounds/SirenSwitch.ogg’,
‘client/html/sounds/SirenToggle.ogg’
})
i have the script
I just keep getting a “Failed to load resource: InteractSound” error when joining.
I have attempted to add my own sound, however whenever i add the file into the __resource.lua, it fails to load the script. Anybody know a fix?
Resource crashes my server, any fixes?
yeap m2
Yep same, maybe Skott need update this script or something.
last sound add… without any… ,
the resource work perfectly guys
i dont have any issues, so i dont think the resource is broken… im on the newest fxserver
What do you mean by that?
sometime people get an issue or error cause in the resource file they didnt add the sound file and or forget to erase the last ‘,’
blabla1,
blabla2,
blabla3