I’m trying to make a coroutine run a repeated function that cycles cutscenes in my core game, while also executing the title screen intro.
However, no matter what I try, it’s always this line that breaks not only the script, but kills the entire game. No matter where in the script I put it, my game becomes completely nonfunctional when it is present. (No scripts run, no audio plays, nothing in output.) (Below)
local lol = coroutine.create(CycleCutscenes())
These are the contents of the CycleCutscenes()
function:
local CycleCutscenes = function()
repeat
CutsceneService.CreateCutscene(CutscenePositions.Core1, CutscenePositions.Core2, 40, 40, 14, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
wait(10)
CutsceneService.CreateCutscene(CutscenePositions.Coolant1, CutscenePositions.Coolant2, 40, 40, 14, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
wait(10)
CutsceneService.CreateCutscene(CutscenePositions.ControlRoom1, CutscenePositions.ControlRoom2, 45, 45, 14, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
wait(10)
until IsItPressed == true
end
CutsceneService is a simple custom ModuleScript I made that allows for cutscenes to be created without a plugin. IsItPressed is a variable that looks for when the play button is pressed. It would usually avert the loop and put the player in game. But, like I said before,
However, no matter what I try, it’s always this line that breaks not only the script, but kills the entire game.
Also, if I should mention this, everything is run inside a LocalScript.
If anyone needs the full script, let me know. I really need some help here. I’ve never been really experienced with coroutines and have never been able to successfully use them.