|
| 14 Jul 2015 01:38 PM |
choices = script:GetChildren() songs = #choices randomsong = math.random(1,songs)
game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(char)
end
How would I make it so it played one of those songs? (The song's parent is the script) |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2015 01:41 PM |
songid = '21345678','12345678' -- these are just examples
songpick = math.random(1,#songid)
songpick:Play(songpick)
this is just a really basic example. It would look something like that. |
|
|
| Report Abuse |
|
|
| |
|
|
| 14 Jul 2015 02:03 PM |
| Read the post again. I said this is a basic example, and will not work. |
|
|
| Report Abuse |
|
|
MisBloxy
|
  |
| Joined: 13 Sep 2008 |
| Total Posts: 164 |
|
|
| 14 Jul 2015 02:09 PM |
hai im back again... :D here, this will help:
choices = script:GetChildren() songs = #choices randomsong = math.random(1,songs)
game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(char) local song = choices[randomSong]:Clone() song.Parent = --Put the song anywhere you want end) end)
Yay I did it :D |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2015 02:17 PM |
Thank you miss, but I have a question.
If I die, the song doesn't stop playing, which is good, but then another song starts playing also.
How do I stop that? |
|
|
| Report Abuse |
|
|
Fribet
|
  |
| Joined: 08 Feb 2014 |
| Total Posts: 700 |
|
|
| 14 Jul 2015 02:25 PM |
| More scripting, use if statements and check if more then 1 are running. |
|
|
| Report Abuse |
|
|
MisBloxy
|
  |
| Joined: 13 Sep 2008 |
| Total Posts: 164 |
|
|
| 14 Jul 2015 02:28 PM |
the song only stops playing if the song's parent is parented to the player backpack or starterGUI
Yay I did it :D |
|
|
| Report Abuse |
|
|
MisBloxy
|
  |
| Joined: 13 Sep 2008 |
| Total Posts: 164 |
|
|
| 14 Jul 2015 02:29 PM |
oh yeah, wht he said. i didnt see wat u said at first.
Yay I did it :D |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2015 02:51 PM |
I have another problem... The song that just finished won't go to finished songs
script:
choices = script:GetChildren() songs = #choices randomsong = math.random(1,songs)
game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(char) while true do local song = choices[randomsong] song.Parent = game.Workspace.CurrentSong --Put the song anywhere you want song:Play() wait(song.TimeLength) song.Parent = game.Workspace.FinishedSong end
end) end) |
|
|
| Report Abuse |
|
|