Script wouldn't play sound

I’m trying to make a script that plays a sound when a proximity prompt is toggled, but it doesn’t work

Here is my explorer:
image

Here is my script:

script.Parent.ProximityPrompt.Triggered:Connect(function(player)
	script.Parent.Switch:Play()
end)

What doesn’t work? The script looks fine. Does your sound work?

Try to debug

script.Parent.ProximityPrompt.Triggered:Connect(function(player)
	script.Parent.Switch:Play()
	
	if script.Parent.Switch.Playing then
		print("Sound is playing.")
	else
		print("Sound isn't playing")
	end
end)

It wouldn’t play the sound… Your script gave me this:
image

My sound properties:

I just copied your sound over and it plays fine. Have you tested in studio to see if it plays normally?

rbxassetid://9119733434

hellohellohellohello

Are your ingame volume and device volume high? (At a hearing point)

I’ve tried it in my studio, and the sound played normally, but the sound is a little delayed, i think because of the delay that you think the sound won’t play?

Okay, I loaded a new place and now it works, weird.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.