|
| 06 Apr 2015 02:29 AM |
songid = {158525402, 177768707, 171190450, 148284458} song = false songmath = math.random(1, 4) music = Instance.new("Sound", game.Players.LocalPlayer.Character)
while song == false do song = true music.SoundId = songid[songmath] music.Volume = 1 wait(1) music:Play() wait(1) musictime = music.TimeLength wait(1) wait(musictime) song = false end
Song claims it is playing, but I can't hear anything at all. Tried putting it into the workspace previously same problem. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 06 Apr 2015 04:13 PM |
You need to concatenate the sound id into the ROBLOX asset url
music.SoundId = "http://www.roblox.com/asset?id="..songid[songmath] |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2015 04:13 PM |
Nevermind I fixed it,
Previous
music.SoundId = songid[songmath]
New
music.SoundId = "rbxassetid://"..songid[songmath]
|
|
|
| Report Abuse |
|
|
|
| 06 Apr 2015 04:17 PM |
New problem, its stuck looping. Goes on for about 5 seconds then the song restarts.
And I've checked the songlength, its supposed to go on for around 2 minutes each. |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2015 04:30 PM |
songid = {158525402, 171190450, 148284458} song = false
music = Instance.new("Sound", game.Workspace)
while not song do song = true songmath = math.random(1, 3) music.SoundId = "rbxassetid://"..songid[songmath] music.Volume = 1 wait(1) music:Play() wait(5) print(music.TimeLength) wait(music.TimeLength) song = false end
TimeLength comes out with 0 when in game. TimeLength comes out with the real value in studio mode. |
|
|
| Report Abuse |
|
|
| |
|