I made a screenGui that lets you input a sound ID and then just hit the "Play" button to play a sound on a speaker I have in the workspace, but the value isn't chaining together or something else. I'm getting the following error: "Failed to load sound rbxassetid://: Unable to download sound data (x2)".
Here's my code
local btn = script.Parent
local playSound = Instance.new('Sound')
local speaker = game.Workspace.SPEAKER
btn.MouseButton1Down:Connect(function()
playSound.Parent = speaker
playSound.Volume = 1
playSound.RollOffMaxDistance = 200
playSound.RollOffMinDistance = 20
playSound.Looped = false
playSound.Playing = true
playSound.SoundId = "rbxassetid://".. tostring(script.Parent.Parent.TextBox.Text)
end)
I'm guessing the error is where I'm chaining the "rbxassetid://" and input value for the Id together? This is a server script btw, I want this to be a server script so the submitted sound Id's are server-sided.

1 comment
Oooooh Ok. That makes more sense. And thank you for the example game!