I'm making a GUI where when you type text into a textbox then press "Play" it will play that audio in a brick but it doesn't seem to be working. Im getting the error:
Failed to load sound rbxassetid://blarfart: Unable to download sound data (x2)
and
Here is the script inside of the button:
script.Parent.MouseButton1Click:Connect(function()
local SoundID = script.Parent.Parent.Music.Text
game.ReplicatedStorage.Music:FireServer(SoundID)
end)
And in the brick
game.ReplicatedStorage.Music.OnServerEvent:Connect(function(SoundID)
script.Parent.Sound.SoundId = "rbxassetid://"..SoundID
script.Parent.Sound:Play()
end)

1 comment
also, the first argument to OnServerEvent handlers is the player that fired the server.. so:
function(player, SoundID) .. end