Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

When I run My script the outpt says I cant load the sound what do i do ?

Asked by 3 years ago
01~local SoundService = game:GetService("SoundService")
02local ReplicatedStorage = game:GetService("ReplicatedStorage")
03local GameMusic = require(ReplicatedStorage:WaitForChild("GameMusic"))
04 
05local function MusicPlay()
06    for i,music in pairs(GameMusic) do
07 
08        local sound = Instance.new("Sound")
09        sound.SoundId = music
10        sound.Parent = SoundService:FindFirstChild("GameTrack")
11        local audio = SoundService:FindFirstChild(sound)
12 
13        if not audio.IsLoaded then
14 
15            audio.Loaded:Wait()
View all 29 lines...

the output says : Failed to load sound 1500963599: Unable to download sound data

1 answer

Log in to vote
0
Answered by 3 years ago

Make sure your sound data is is associated with rbx asset ID.

All sounds MUST have 'rbxassetid://' before the actual sound ID.

For example:

1local Id = "123456789"
2 
3game.Workspace.Sound.SoundId = Id --This would cause an error because it isn't registered with rbxassetid://
4 
5game.Workspace.Sound.SoundId = "rbxassetid://" .. Id --Wont cause an error because is registered with rbxassetid://

Keep in mind, this is only when a script is setting the Id. In studio you can just put in the number and it will automatically register it for you. This error will also happen when a sound doesn't exist, or was moderated.

Ad

Answer this question