Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I allow the player to choose the song?

Here is my script. it gives me an error message: 18:43:02.550 - Failed to load sound rbxassetid://0: Unable to download sound data (x2)

button = script.Parent.Parent.TextButton
button.MouseButton1Click:Connect(function()
	stringID = script.Parent
	game.ReplicatedStorage.newSong.Value = tonumber(stringID.Text)
	game.Workspace.Sound.SoundId = "rbxassetid://"..game.ReplicatedStorage.newSong.Value
end)

2 comments

0

Are you using a string value? If not, try using one (I think it might work, but I'm going off of a limb).

0

No, that didn't work. It just turned it from 0 to nil

1 answer

✓ Accepted answer
script.Parent.Parent.TextButton.MouseButton1Click:Connect(function()
	local stringID = script.Parent.Text
	game.ReplicatedStorage.newSong.Value = tostring(tonumber(stringID))
	game.Workspace.Sound.SoundId = "rbxassetid://"..game.ReplicatedStorage.newSong.Value
	game.Workspace.Sound:Play()
end)

That should work. Make sure "newSong" is a stringValue

1 comment

0

22:51:16.462 - Failed to load sound rbxassetid://0: Unable to download sound data (x2)

This discussion is preserved as it was. New answers, comments, and votes are closed.