|
| 24 Jan 2017 02:44 PM |
sounds = {527167110,511530448,562131781, 511527172,511528845} sound = sounds[math.random(1,#sounds)] s = Instance.new("Sound",script.Parent) script.Parent.Sound.Volume = 1 script.Parent.Sound:Play() --it adds a new sound but the sound has no id so it cant play why?
|
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 24 Jan 2017 02:46 PM |
script.Parent.Sound.Id = sound
|
|
|
| Report Abuse |
|
|
|
| 24 Jan 2017 02:46 PM |
you forgot to set the sound id of the new instance you created
do
sound.SoundId = "rbxasset://"..sound |
|
|
| Report Abuse |
|
|
doctor152
|
  |
| Joined: 30 Nov 2008 |
| Total Posts: 308 |
|
|
| 24 Jan 2017 02:47 PM |
You literally just answered your own question, it doesn't have an ID.
|
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 24 Jan 2017 02:47 PM |
the rbxasset:// is unnecessary
|
|
|
| Report Abuse |
|
|
|
| 24 Jan 2017 02:49 PM |
| doesnt work it says Sound ########### failed to load in ########################## ############################ |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2017 02:50 PM |
No its is otherwise you get this contentprovider error:
failed to load in "Workspace.Sound.SoundId": OnContentProviderSoundLoaded gg (x627)
Link the sound with the url (check i forgot) but goes something like this
....assetid="..sound
|
|
|
| Report Abuse |
|
|
|
| 24 Jan 2017 02:51 PM |
found it:
s.SoundId = "http://www.roblox.com/asset/?id="..sound |
|
|
| Report Abuse |
|
|
4ef
|
  |
| Joined: 27 May 2013 |
| Total Posts: 5633 |
|
|
| 24 Jan 2017 02:52 PM |
Sounds = {'527167110', '511530448', '562131781', '511527172', '511528845'} for _,Sound in pairs (Sounds) do local Sound = Instance.new('Sound', script.Parent) Soud.Volume = 1 Sound:Play() wait(Sound.TimeLength) end
|
|
|
| Report Abuse |
|
|
| |
|
4ef
|
  |
| Joined: 27 May 2013 |
| Total Posts: 5633 |
|
|
| 24 Jan 2017 02:54 PM |
sorry bout last
Sounds = {'527167110', '511530448', '562131781', '511527172', '511528845'} for _,Sound in pairs (Sounds) do local Sound = Instance.new('Sound', script.Parent) Sound.SoundId = 'http://www.roblox.com/asset/?id='..Sound Soud.Volume = 1 Sound:Play() wait(Sound.TimeLength) end
|
|
|
| Report Abuse |
|
|
|
| 24 Jan 2017 02:55 PM |
it only adds one so one the song finishes should i remove the sound?
|
|
|
| Report Abuse |
|
|
| |
|
4ef
|
  |
| Joined: 27 May 2013 |
| Total Posts: 5633 |
|
|
| 24 Jan 2017 02:59 PM |
you can do that with table manipulation google it
|
|
|
| Report Abuse |
|
|