Sounds Not Working

Hello, I am trying to make a sound board for one of my games. It is a simple test that I wanted to try out. I put Many text buttons in a grid. Depending on which button I press It will play a different sound. And I want everyone in the server to be able to hear the sounds.

However it does not seen to be working. And I can not seem to figure out how to fix it. Whenever I click on a sound It does not play. The only time it did play is when I used a local script. But when I use a local script no one else can hear it.

This is how I organised it

Starter GUI > Frame > Text Buttons > Audio and Script.

script.Parent.MouseButton1Up:Connect(function()
	script.Parent["Crowd Reactions 1 (SFX)"]:Play()	
end)

I tried to see if the game was detecting me clicking on a sound button my adding…

print("Test")

… to the script. And surely enough it appeared in the output.

I know this is probably an easy fix but I don’t have much experience in scripting because im mostly a builder so don’t get mad at me if it is dumb mistake. :pray:

All help is appreciated :smiley:

1 Like

I’m not too sure, but is .Playing true?

1 Like

You’ll need to fire a remote event to the server and play it from there. If you want it to play to everyone.

Do you mean like this

script.Parent.MouseButton1Up:Connect(function()
	script.Parent["Crowd Reactions 1 (SFX)"]:Play(true)	
end)

With true right after play?

Never mind, you might wanna look at
https://developer.roblox.com/en-us/api-reference/function/SoundService/PlayLocalSound

But I meant the sound property in the explorer.

Thank you, but this script is only for the client.

Plays a Sound locally, meaning the sound will only be heard by the client calling this function,

So that won’t work.

Thanks anyways!

Oh, I misunderstood what you wanted. You would have to do what @Valkyrop suggested.

1 Like

Sorry if I was unclear about what I wanted.

I am looking into that right now.

Thanks!

1 Like

When I try to fire a remote event, an error appears in the output that says:

13:45:16.944 FireServer can only be called from the client - Server

I changed everything up so now the script looks like this:

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local SoundBoard = ReplicatedStorage:WaitForChild("SoundBoard")

local Sound = script.Parent["Crowd Reactions 1 (SFX)"]

script.Parent.MouseButton1Up:Connect(function()

print("Test")

SoundBoard:FireServer(Sound)

end)

I added a remote event to ReplicatedStorage Called SoundBoard

I also added a script to ServerScriptService:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SoundBoard = ReplicatedStorage:WaitForChild("SoundBoard")

SoundBoard.OnServerEvent:Connect(function(player, sound)
	sound:Play()
end)

It still does not seem to be working.

You should try

script.Parent.MouseButton1Up:Connect(function()
	script.Parent.CrowdReactions1(SFX):Play()	
end)

(Without the spaces is well)

Not sure if this has been mentioned but make sure your sounds are parented to the workspace directly and everyone will hear them.

So you mean adding them into the workspace rather then having them in the gui?

Yes, just the sounds. . . . . .

This should work better, and look cleaner.

Local sound = Script.parent.(Your sound here)

script.parent.Mousebutton1Click:Connect(function)
sound:play
end()

lemme know if this works

Oh wait i made a minor mistake here.

this is how it Should be

Local sound = script.parent.(Your sound here)

script.parent.Mousebutton1Click:Connect(function)
sound:play()
end()