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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Scripts work in Studio but not in online mode

Previous Thread :: Next Thread 
Meowth552 is not online. 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
DoctorScrubbington is not online. DoctorScrubbington
Joined: 27 Sep 2010
Total Posts: 950
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
DoctorScrubbington is not online. DoctorScrubbington
Joined: 27 Sep 2010
Total Posts: 950
30 Jun 2016 11:41 AM
bump
Report Abuse
DoctorScrubbington is not online. DoctorScrubbington
Joined: 27 Sep 2010
Total Posts: 950
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
DoctorScrubbington is not online. DoctorScrubbington
Joined: 27 Sep 2010
Total Posts: 950
30 Jun 2016 12:37 PM
100 Robux to anyone who can figure out what the problem is ( ͡° ͜ʖ ͡°)
Report Abuse
iDerpyDogez is not online. iDerpyDogez
Joined: 05 Feb 2012
Total Posts: 1781
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
DoctorScrubbington is not online. DoctorScrubbington
Joined: 27 Sep 2010
Total Posts: 950
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
DoctorScrubbington is not online. DoctorScrubbington
Joined: 27 Sep 2010
Total Posts: 950
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
iDerpyDogez is not online. iDerpyDogez
Joined: 05 Feb 2012
Total Posts: 1781
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
DoctorScrubbington is not online. DoctorScrubbington
Joined: 27 Sep 2010
Total Posts: 950
30 Jun 2016 01:56 PM
Nope, still not repeating :/
Report Abuse
Previous Thread :: Next Thread 
Page 2 of 2Go to page: 1, [2] Prev
 
 
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