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

Why do i get errors when trying to play a sound or music?

i keep getting the error: Failed to load sound 1051512943: Unable to download sound data

Code:

--local id_1 =  1051512943 2664600468

local id_1 = 1051512943
local id_2 = 596403163
local id_3 = 2698664996
local id_4 = 560295048
local id_5 = 2636748467
local id_6 = 2676908523
local id_7 = 2604329687
local id_8 = 2540121335
local id_9 = 444608325
local id_10 = 2513692510
local id_11 = 2452872276
local id_12 = 360056845
local id_13 = 1016483868
local id_14 = 2177911889
local id_15 = 2636236176
local id_16 = 2331188047
local id_17 = 2475780282
local id_18 = 1960947032

--DONT TOUCH THE CODE

wait(1)
local Repstorage = game:GetService("ReplicatedStorage")
local Remote = Repstorage:WaitForChild("MusicRemote")
local waitTime = game.Workspace.Music.TimeLength
wait(1)

Remote.OnServerEvent:Connect(function()
	print("Working")
	while true do
		wait(1)
		--Song1
		game.Workspace.Music.SoundId = id_1
		wait(0.01)
		waitTime = game.Workspace.Music.TimeLength
		game.Workspace.Music:Play()
		wait(waitTime)
		game.Workspace.Music:Stop()

1 answer

✓ Accepted answer

You just need to append rbxassetid:// to the beginning of each ID.

--local id_1 =  1051512943 2664600468

local id_1 = 1051512943
local id_2 = 596403163
local id_3 = 2698664996
local id_4 = 560295048
local id_5 = 2636748467
local id_6 = 2676908523
local id_7 = 2604329687
local id_8 = 2540121335
local id_9 = 444608325
local id_10 = 2513692510
local id_11 = 2452872276
local id_12 = 360056845
local id_13 = 1016483868
local id_14 = 2177911889
local id_15 = 2636236176
local id_16 = 2331188047
local id_17 = 2475780282
local id_18 = 1960947032

--DONT TOUCH THE CODE

wait(1)
local Repstorage = game:GetService("ReplicatedStorage")
local Remote = Repstorage:WaitForChild("MusicRemote")
local waitTime = game.Workspace.Music.TimeLength
wait(1)

Remote.OnServerEvent:Connect(function()
    print("Working")
    while true do
        wait(1)
        --Song1
        game.Workspace.Music.SoundId = "rbxassetid://" .. id_1
        wait(0.01)
        waitTime = game.Workspace.Music.TimeLength
        game.Workspace.Music:Play()
        wait(waitTime)
        game.Workspace.Music:Stop()
   end
end)

1 comment

0

i closed your function and loop bc you hadnt done that already

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