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: Help with a music script

Previous Thread :: Next Thread 
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
23 Jul 2015 07:44 PM
Song1 = script.Song1
Song2 = script.Song2
Song3 = script.Song3
Song4 = script.Song4
Song5 = script.Song5
Song6 = script.Song6
Song7 = script.Song7
Song8 = script.Song8
Song9 = script.Song9
Song10 = script.Song10
Song11 = script.Song11

songnumber = 1
script.songnumber.Value = 1
wait(1)
songnumber = 1
script.songnumber.Value = 1

musicArray = {Song1, Song2, Song3, Song4, Song5, Song6, Song7, Song8, Song9, Song10, Song11, Song1}



function playSongs()

if songnumber > 11 then
songnumber = 1
script.songnumber.Value = 1
end

musicArray[songnumber]:Play()
print(musicArray[songnumber])



wait(musicArray[songnumber].TimeLength)
musicArray[songnumber]:Stop()


end

skip = script.skip

skip.Changed:connect(function()
if skip.Value == true then
musicArray[songnumber]:Stop()
skip.Value = false
songnumber = songnumber + 1
if songnumber > 11 then
songnumber = 1
end
game.Workspace.MusicQueue.songnumber.Value = songnumber
playSongs()
end
end)

musicArray[songnumber].Stopped:connect(function()
if musicArray[songnumber].IsPaused == true then
songnumber = songnumber + 1
game.Workspace.MusicQueue.songnumber.Value = songnumber
playSongs()
end

end)

playSongs()

However, it doesn't work when I join the game. I have to skip song and then the song plays, but it doesn't play the 1st song when I join. Skip works fine tho, ayy.
Report Abuse
Npokemonmaster2alt is not online. Npokemonmaster2alt
Joined: 13 Dec 2014
Total Posts: 135
23 Jul 2015 07:59 PM
Do what i said to do b4 but make songnumber 0 by default if dat didn't work show what it says in the output
Report Abuse
Npokemonmaster2alt is not online. Npokemonmaster2alt
Joined: 13 Dec 2014
Total Posts: 135
23 Jul 2015 08:00 PM
And remove play songs() from the very end of the script when u called it
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
23 Jul 2015 08:19 PM
If i make it 0 by default, another script breaks.

Also, the playsongs() at the end is just so that the song starts at the start
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
23 Jul 2015 08:26 PM
Any ideas?
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
23 Jul 2015 08:29 PM
Please c;
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
23 Jul 2015 08:38 PM
):
Report Abuse
Vritix is online. Vritix
Joined: 01 Jan 2011
Total Posts: 2790
23 Jul 2015 08:41 PM
What are you trying to do with this script?
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
23 Jul 2015 08:42 PM
It's supposed to be a musicqueue where it plays the first song, then second etc.

However, there is a skip button which skips the song. The skip is fully functional, just that the 1st song doesnt start
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
23 Jul 2015 08:51 PM
Helpppp
Report Abuse
Npokemonmaster2alt is not online. Npokemonmaster2alt
Joined: 13 Dec 2014
Total Posts: 135
23 Jul 2015 08:57 PM
Maybe at the start just put

Song1:play()
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
23 Jul 2015 09:00 PM
I'm dumb.

Thanks
Report Abuse
Npokemonmaster2alt is not online. Npokemonmaster2alt
Joined: 13 Dec 2014
Total Posts: 135
23 Jul 2015 09:02 PM
Lmao
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