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

Why wont my brick move? Plus one more question about playing music!

I am using the bodyforce movement thing (i'm new to this) and no matter what direction i put numbers in it doesn't work!

How do I get more than one song to play infinitly? Like song one plays- finishes and song two plays- finishes and then goes BACK to song one! Hers is what i currently use (doesnt work) y = game.Workspace while true do y.T2:Play() while y.T2.IsPlaying do wait() end y.clubstep:Play() while y.clubstep.IsPlaying do wait() end y.T1:Play() while y.T1.IsPlaying do wait() end y.TNP:Play() while y.TNP.IsPlaying do wait() end end

T2,clubstep,T1,TNP are all song names!!!

1 answer

BodyForces only work on unanchored parts that aren't attached to anything (i.e. another part via welds) and when the game is running (not Edit mode). If the part isn't moving and it's not anchored/attached to anything and the game is running, increase the amount of force you're exerting on the part.

You can use sound.Ended to check when a sound has finished playing, and use a while true loop to continue this behavior forever. Example:

local sounds = {sound1, sound2, sound3}
while true do
	for _,sound in next,sounds do
		sound:Play()
		sound.Ended:wait()
		sound:Stop()
	end
end

Keep in mind that sounds won't play until they're loaded, so you need to make sure they're loaded beforehand with Preload/PreloadAsync if you want a seamless loop.

2 comments

0

what do you mean by preload???

0

Preloading an asset forces it into the loading queue (explanation of loading queue: https://scriptinghelpers.org/questions/22873/loading-gui-that-actually-loads-stuff#26473) Here is the wiki page for Preload with some example usage: http://wiki.roblox.com/index.php?title=API:Class/ContentProvider/Preload

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