Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How do I make music play during a cutscene, then make a different one play after it?

Asked by 7 years ago

So I was making an RPG with a cutscene, and I can't get different music to play during or after a cutscene. The only cutscene I have is the one when you join, so needing to make it play more than once is out of the question. Here is my code:

`cutscene = script.Parent.Parent.PlayerGUI.Cutscene

mainMusic = script.Parent.Parent.PlayerGUI.MainMusic

if cutscene.isPlaying then

    wait(1)

    print "Playing"

else

    mainMusic.Playing = true

end

--LocalScript is in StarterPack --Music is in StarterGUI, which is linked to PlayerGUI`

So basically, it won't print "Playing", and it won't play mainMusic either.

Cutscene music isn't looped. mainMusic is, Please help!!!

Can you give me the code, and explain it so i can use it quick, but can do again later?

0
Keep in mind that will only run once or when the script is called. harryisbeast 70 — 7y
0
try using :Play() rather than .Playing. And check the output. cabbler 1942 — 7y
0
There's no such thing as PlayerGUI, only PlayerGui Kampfkarren 215 — 7y
0
didnt work ronitrocket 120 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

Just as cabbler said, use :Play() and :Stop(). Try to do some loops with the volume if you want a nicer effect than just a cut. Kampfkarren is also right, there is only PlayerGui.

Ad

Answer this question