UnAdmin
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 4706 |
|
|
| 08 Oct 2013 11:48 PM |
sound.Play = function(name,id,volume,looped) local song = Instance.new("Sound",game.Players.LocalPlayer) song.Name = name song.SoundId = "rbxassetid://"..id song.Volume = volume song.Looped = looped song:Play() end
local songs = { Dubstep = {ID = "130768080", Volume = tonumber(settings.Volume.Value/100)}, ParamaPanorama = {ID = "131852078", Volume = tonumber(settings.Volume.Value/100)}, Freedom = {ID = "130760592", Volume = tonumber(settings.Volume.Value/100)}, Resis = {ID = "27697234", Volume = tonumber(settings.Volume.Value/100)}, ElevatorMusic = {ID = "130768299", Volume = tonumber(settings.Volume.Value/100)} }
sound.Play(settings.GameMusic.Value,songs[settings.GameMusic.Value].ID,1,true)
The sound shows up where it should with the properties that it should, it just doesn't play. |
|
|
| Report Abuse |
|
|
|
| 08 Oct 2013 11:56 PM |
| Thanks for telling me that. What else do you have to complain about? |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 08 Oct 2013 11:58 PM |
sound = {Play = function(name,id,volume,looped) local song = Instance.new("Sound",game.Players.LocalPlayer) song.Name = name song.SoundId = "rbxassetid://"..id song.Volume = volume song.Looped = looped song:Play() end}
local songs = { ["Dubstep"] = {ID = "130768080", Volume = tonumber(settings.Volume.Value/100)}, ["ParamaPanorama"] = {ID = "131852078", Volume = tonumber(settings.Volume.Value/100)}, ["Freedom"] = {ID = "130760592", Volume = tonumber(settings.Volume.Value/100)}, ["Resis"] = {ID = "27697234", Volume = tonumber(settings.Volume.Value/100)}, ["ElevatorMusic"] = {ID = "130768299", Volume = tonumber(settings.Volume.Value/100)} }
sound.Play(settings.GameMusic.Value,songs[settings.GameMusic.Value].ID,1,true) |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 09 Oct 2013 12:28 AM |
You may be experiencing the issue that sounds won't Play until they are fully loaded, but they don't load until first Played. You can fix this using the Preload method of the ContentProvider service:
http://wiki.roblox.com/index.php/Preload_%28Method%29
|
|
|
| Report Abuse |
|
|
UnAdmin
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 4706 |
|
|
| 09 Oct 2013 04:00 PM |
Tried the preload and modified script. Still doesn't work. I have now just done this:
local songs = { Dubstep = {ID = "130768080", Volume = tonumber(settings.Volume.Value/100)}, ParamaPanorama = {ID = "131852078", Volume = tonumber(settings.Volume.Value/100)}, Freedom = {ID = "130760592", Volume = tonumber(settings.Volume.Value/100)}, Resis = {ID = "27697234", Volume = tonumber(settings.Volume.Value/100)}, ElevatorMusic = {ID = "130768299", Volume = tonumber(settings.Volume.Value/100)} } for i,v in pairs(songs) do Game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=" .. v.ID) wait(1/10) end
local song = Instance.new("Sound",game.Players.LocalPlayer) song.Name = "GameSound" song.SoundId = "http://www.roblox.com/asset/?id="..songs[settings.GameMusic.Value].ID song.Volume = songs[settings.GameMusic.Value].Volume song.Looped = true
Any other solutions?
|
|
|
| Report Abuse |
|
|
wally5026
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 503 |
|
|
| 09 Oct 2013 04:01 PM |
| try adding wait(5) for it to have time to load, if all else fails. |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2013 04:06 PM |
| Try un-muting your speakers. Usually works for me. |
|
|
| Report Abuse |
|
|
UnAdmin
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 4706 |
|
|
| 09 Oct 2013 04:08 PM |
| That's what I was afraid of. It works. |
|
|
| Report Abuse |
|
|
UnAdmin
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 4706 |
|
|
| 09 Oct 2013 04:09 PM |
| huehue I tried adding the wait, not unmuting my speakers. Plus I am not using speakers, I have an HDMI cable hooked up to a 32" TV mounted above my monitor. |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2013 05:07 PM |
| I use to think I was like the only 1 from 10 people int he whole world who had that... now I realise im not special... lol |
|
|
| Report Abuse |
|
|