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

Works on studio but not in-game, what's the problem?

Asked by
uZelt 15
9 years ago

The script is in a folder called "AudioController" and the music IDs are in another folder called "Songs"

01local sound = Instance.new("Sound")
02sound.Parent = game.Soundscape
03sound.Name = "CoolAudio"
04 
05local number = 1
06local songs = script.Parent.Songs:GetChildren()
07 
08local currentsong = 1
09local nowplaying = 0
10 
11for i=1,#songs do
12    songs[i].Name = tostring(number)
13    number = number + 1
14end
15 
View all 33 lines...

1 answer

Log in to vote
2
Answered by 9 years ago

In order for your song to be heard ingame, it has to be in the Workspace, Soundscape is like a storage place, not a song-playing service.

0
The audio now plays in-game though it stops as soon as you actually spawn. uZelt 15 — 9y
0
Try and redo the script, this time make the sound play and exist in the workspace, and make is more simple, there are more less complicated and efficient ways to play sound like this. laughablehaha 494 — 9y
Ad

Answer this question