Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is there any way to make this script more efficient?

codeblock
function playmusic()
	wait(15) -- to make sure the server is done loading up
	while not game.Workspace.Fade.IsPlaying do
	wait(1)
		game.Workspace.music3:Play()
		wait (120)
				game.Workspace.music2:Play()
					wait (120)
							game.Workspace.music1:Play()
								wait (120)
									end end

while true do
	wait(360)
	playmusic()
end

I am making a music script where songs are played in a playlist repeatedly but it doesnt seem to be very efficient, is there any way to make it so that it syncs up, so that every player hears the same thing at the same time? This is a server script, i dont think it would work very well as a local script though

2 comments

0

You could go ahead and throw the function into the loop, rather then having the function called inside the loop. Ex. Remove the function, but keep the code inside, then throw the code into the loop. That would make it a bit better.

0

thanks nathan, you helped

1 answer

Please put a code block around it as it would make it easier to understand

2 comments

0

sorry, i shall edit it

0

This is not an answer, so please do not leave it as one.

This discussion is preserved as it was. New answers, comments, and votes are closed.