Audios not playing (literally)

Hello, I am having troubles with audios… not playing
Code:

if (RealDanger and Variables.Speed > 10 and (not Variables.Keys.S)) then
					if not (alert.Playing) then
						alert:Play()
						print("alert!")
					end
				end

Variable=

local brake,alert = Configurations.DistanceDetection.beeplarger,Configurations.DistanceDetection.beep
print(brake,alert) -- prints correctly their name..

image

Video of error;


This is a local script.

1 Like

All audios are approved, and when testing in studio and doing play, it works, but not with command bar on scripting
Here’s command bar;

Have you specified in the script what the audio you are playing is?

Yes, in the variables, it’s a sound in a part.

Did you do the full path when doing variables? eg.

local alert = game.testcar.Detection.beep
local Lalert = game.testcar.Detection.beeplarger

yes… I just showed the variables here

is the script inside the car model?

no, in player UI, but it’s not the trouble, I got the audios, they’re just not playing.

ok.

surely that not right because in image the path sould end with

Detection.beep 

not

Also here is the api documentation for SoundService:PlayLocalSound

image
image

1 Like

do you have a game link where I can test the sound?

This seems like it worked

How can I stop audio without creating another?

you must show us the whole script if you dont do that we can’t help you, i got what you’re trying to do but I dont know how to help you when you just write a part from the scritpt

local audio = Detection.beep
audio:Stop()

local audio = Detection.alert
audio:Stop()

Can someone experienced help me? this seems like none helped me yet…
The code is right, I am using :Play() but it won’t play.

I thought it worked. So does it or does it not work?

It’s not what I’m searching for, I just want to understand why Sound:Play() inside a part is not working on a local script.

I think its because Sound:Play() is used only in server. Not sure though, but PlayLocalSound is used for local scripts, not server replication