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: Sound

Previous Thread :: Next Thread 
SuperSniper222 is not online. SuperSniper222
Joined: 09 Jul 2010
Total Posts: 426
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
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
06 Apr 2015 02:50 AM
while not song do
Report Abuse
SuperSniper222 is not online. SuperSniper222
Joined: 09 Jul 2010
Total Posts: 426
06 Apr 2015 04:09 PM
Bump
Report Abuse
rayk999 is not online. 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
SuperSniper222 is not online. SuperSniper222
Joined: 09 Jul 2010
Total Posts: 426
06 Apr 2015 04:13 PM
Nevermind I fixed it,

Previous

music.SoundId = songid[songmath]

New

music.SoundId = "rbxassetid://"..songid[songmath]
Report Abuse
SuperSniper222 is not online. SuperSniper222
Joined: 09 Jul 2010
Total Posts: 426
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
SuperSniper222 is not online. SuperSniper222
Joined: 09 Jul 2010
Total Posts: 426
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
SuperSniper222 is not online. SuperSniper222
Joined: 09 Jul 2010
Total Posts: 426
06 Apr 2015 04:37 PM
Bump
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