So I have this script, and I use it for background music in game. The script is a normal script (a-non-local and stuff like that) and the sound that plays the music is called "Music". The sound is in the StarterGui.
01 | local sound 1 = 918984470 |
02 | local sound 2 = 949583914 |
03 | local sound 3 = 390846973 |
04 | music = script.Parent |
05 |
06 |
07 | while true do |
08 | wait() |
09 | music.SoundId = "rbxassetid://" ..sound 1 |
10 | music:Play() |
11 | music.Ended:wait() |
12 | wait() |
13 | music.SoundId = "rbxassetid://" ..sound 2 |
14 | music:Play() |
15 | music.Ended:wait() |
When I look in the output it says "Sound"" failed to load in "StarterGui.Music.SoundId": Request failed"
It works for me with your script or mine. And also works with a local script or server script. Here's a picture of StarterGui- imgur
01 | local sound 1 = 918984470 |
02 | local sound 2 = 949583914 |
03 | local sound 3 = 390846973 |
04 | local music = script.Parent |
05 |
06 | local function PlaySong(soundId) |
07 | music.SoundId = "rbxassetid://" ..soundId |
08 | music:Play() |
09 | print ( "Playing song: " .. soundId) |
10 |
11 | -- If statement just so I don't have to listen to the whole song |
12 | if soundId = = 390846973 then |
13 | music.TimePosition = 30 |
14 | else |
15 | music.TimePosition = 250 |