Meowth552
|
  |
| Joined: 17 Dec 2009 |
| Total Posts: 2181 |
|
|
| 30 Jun 2016 10:33 AM |
Is there a part named Player in the part Player?
Otherwise you should define the player:
local Player = game.Players.LocalPlayer |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2016 10:40 AM |
Yes, the "Player" in the WaitForChild is the Sound being generated by the music script, inside the parent part also named "Player"
It looks like this in the explorer when the game is run:
Workspace Speaker Player Player Playlist (music-playing script) |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 Jun 2016 12:17 PM |
| Alright, so I guess the :WaitForChild("Player") is working, it's just that the wait(10) and the wait(TimeLength) aren't working in the music playing script. If I can make those work in online mode, it should fix the whole thing. The only thing is, I don't know how. |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2016 12:37 PM |
| 100 Robux to anyone who can figure out what the problem is ( ͡° ͜ʖ ͡°) |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2016 12:49 PM |
try doing game:WaitForChild("Workspace") instead of wait(10) and this is from the wiki: "(TimeLength) This property can only be read from. Attempting to write to it will cause an error."
#code while true do end |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2016 12:52 PM |
| Oh yeah, I meant to say wait(music.TimeLength), so it should wait for the TimeLength of the song currently playing. It works like that in Studio, but maybe it just doesn't work in Online. I'll test it out. |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2016 01:38 PM |
First of all, it was a good try, but the "game:WaitForChild("Workspace")" doesn't seem to do anything either. It's as if that first line just doesn't work at all. However, I changed the "wait(music.TimeLength)" to "music.Ended:wait(0.01);" and that allows the song to play in online mode, and the lights aren't flashing either, they're matching up correctly! Also, it turns out if some of the lights don't change color at first, when the next song plays, they turn on, so that's all good. However, there's just one more problem. In Studio, the music playing script does what it's supposed to - it plays a song, waits until it's finished, and then plays another song. However, in the online test, the script doesn't repeat - it plays one song, and when the song ends, the script ends. It doesn't play another song. How could I get this script to repeat itself properly? Here it is again so you can see:
math.randomseed(tick()) while (true) do songs = {song1,song2,song3,song4,song5,song6,song7,song8,song9,song10,song11,song12,song13,song14,song15,song16,song17,song18,song19,song20,song21,song22,song23} song = math.random(1,#songs) var = song print("Playing Sound"..song) script.Off.Value = false script.Song.Value = "Song"..song music.SoundId = songs[song] music:play() music.Ended:wait(0.01); music:stop() end
|
|
|
| Report Abuse |
|
|
|
| 30 Jun 2016 01:41 PM |
while (true) do math.randomseed(tick())
instead of
math.randomseed(tick()) while (true) do
#code while true do end |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2016 01:56 PM |
| Nope, still not repeating :/ |
|
|
| Report Abuse |
|
|