Sound won't play when I call the :Play() method

When I attempt calling the :Play() method there’s no error and no sound playing, I have also attempted using content provider service but that did not work either, I can’t find the root of the issues if someone has any idea how I can fix it I’d be very grateful!

local function action(Player, Id, Action)
	if Action == "Play" then
		Sound.SoundId = "rbxassetid://"..Id
		Sound:Play()
	elseif Action == "Stop" then
		Sound:Stop()
		print(Sound.SoundId)
	end
end
3 Likes

is the print function working?

1 Like

Where is the sound located? Is this a local script or server script? We will need more info to help you.

1 Like

Sorry I forgot to provide that, my apologies.
image

1 Like

Can you try printing to see if the function is working?
Is the sound a descendant of workspace when you are playing? I don’t think sound can play if it is not a descendant of workspace.

1 Like

Yes it is a descendant of workspace and the print works perfectly
image

2 Likes

What happens if you force the sound to be a certain id to test if it is a problem with the id or the script?

1 Like

I have tried and no result at all.

2 Likes

Then, I’m guessing its a problem with the script.
Is this the full script?

2 Likes

nope,

-- // Variables \\ --
local Boombox = script.Parent
local RemoteEvent = Boombox.RemoteEvent
local Sound = Boombox.Handle.Sound
Sound.Looped = true


-- // Functions \\ --
local function action(Player, Id, Action)
	if Action == "Play" then
		Sound:Play()
	elseif Action == "Stop" then
		Sound:Stop()
	end
end

-- // Connections \\ --
RemoteEvent.OnServerEvent:Connect(action)
1 Like

check if the volume in the sound is too low and check if it works when you manually put in the id and play the sound. maybe the sound wasnt approved by roblox, or it might be wrong

1 Like

It does work when I manually force play the sound from the properties.

1 Like

Take a screenshot of your sound properties for me.

1 Like

Hmmm, I am pretty confused. Can you print Sound.IsPlaying before and after stopping?

1 Like

1 Like

Set your RollOffMinDistance to anything above 0 (the default is 10).

3 Likes

Thank you for educating me I never really worked with audios nor did any in depth research so for me it was weird why it wouldn’t work, thank you so much anyways and also thank you to all the people who tried helping me!

1 Like

No problem. If you want an explanation: Sounds that are loaded in with MinRollOffDistance set to 0 fail to work as 3D sound - #2 by ReallyLongArms

1 Like

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