generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: whats wrong with my script

Previous Thread :: Next Thread 
chrislojet5533 is not online. chrislojet5533
Joined: 15 Jun 2015
Total Posts: 2419
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 is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
24 Jan 2017 02:46 PM
script.Parent.Sound.Id = sound


Report Abuse
KritikalGunzz is not online. KritikalGunzz
Joined: 10 Nov 2013
Total Posts: 1633
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 is online. 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 is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
24 Jan 2017 02:47 PM
the rbxasset:// is unnecessary


Report Abuse
chrislojet5533 is not online. chrislojet5533
Joined: 15 Jun 2015
Total Posts: 2419
24 Jan 2017 02:49 PM
doesnt work it says Sound ########### failed to load in ########################## ############################
Report Abuse
KritikalGunzz is not online. KritikalGunzz
Joined: 10 Nov 2013
Total Posts: 1633
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
KritikalGunzz is not online. KritikalGunzz
Joined: 10 Nov 2013
Total Posts: 1633
24 Jan 2017 02:51 PM
found it:

s.SoundId = "http://www.roblox.com/asset/?id="..sound
Report Abuse
4ef is not online. 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
chrislojet5533 is not online. chrislojet5533
Joined: 15 Jun 2015
Total Posts: 2419
24 Jan 2017 02:53 PM
fixed


Report Abuse
4ef is not online. 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
chrislojet5533 is not online. chrislojet5533
Joined: 15 Jun 2015
Total Posts: 2419
24 Jan 2017 02:55 PM
it only adds one so one the song finishes should i remove the sound?


Report Abuse
chrislojet5533 is not online. chrislojet5533
Joined: 15 Jun 2015
Total Posts: 2419
24 Jan 2017 02:55 PM
**when


Report Abuse
4ef is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image