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 » Scripting Helpers
Home Search
 

Re: Random Asset

Previous Thread :: Next Thread 
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
19 Nov 2013 07:48 PM
Assets = {130768080,130762736,130762870,131243684,130773779,131293487,131389245,132251996,131055106,131509782,130788529,131321256,131320359,131394800,135646205}
for _, asset in ipairs(Assets) do
Game:GetService("ContentProvider"):Preload("http://roblox.com/asset/?id="..asset)
end

Tool.Handle.Song.SoundId = ("http://www.roblox.com/asset/?id="..Assets[math.random(#Assets)])
Tool.Handle.Song:Play()

Why doesn't this work, not output it just doesn't play the sound.
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
19 Nov 2013 07:53 PM
bump
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
21 Nov 2013 06:51 PM
bump
Report Abuse
Jetta765214 is not online. Jetta765214
Joined: 22 Oct 2008
Total Posts: 1855
21 Nov 2013 06:53 PM
try adding a wait() between assigning the sound ID, and playing it.
Report Abuse
Madified is not online. Madified
Joined: 19 Apr 2011
Total Posts: 5292
21 Nov 2013 07:08 PM
[ Content Deleted ]
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
21 Nov 2013 07:10 PM
Madified, instead of wasting a post insulting someone who tries to help, how about you actually explain what's wrong with the script.
Report Abuse
coplox is not online. coplox
Joined: 07 Jun 2008
Total Posts: 3252
21 Nov 2013 07:12 PM
The "math.random(#Assets)" should be "math.random(1, #Assets)"
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
21 Nov 2013 07:36 PM
Aww it didn't work :P
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
21 Nov 2013 07:37 PM
Stop the sound then play it then stop it then play it again is my suggestion. Sometimes it only loads while activating it.
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
21 Nov 2013 07:50 PM
That didn't work :(
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
21 Nov 2013 07:54 PM
The script works but the sound doesn't play.
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
21 Nov 2013 08:04 PM
A wait(1) seem to do the trick.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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