How can I play a cutscene?

Hey there folks!

I am in the middle of improving my piggy game (see here) and I have made some adjustments. However, I can’t seem to figure out how to make the cutscene play.

I have tried RemoteEvents but can’t seem to pinpoint the correct location as to where it should go.

I tried placing it before the RoundStart, after the RoundStart and in the middle of functions.

If someone could lend a hand, that’d be great!

GameHandler
local Round = require(script.RoundModule)

local Door = require(script.DoorModule)

local Status = game.ReplicatedStorage:WaitForChild("Status")

while wait() do

repeat

local availablePlayers = {}

for i, plr in pairs(game.Players:GetPlayers()) do
	if not plr:FindFirstChild("InMenu") then
		table.insert(availablePlayers,plr)
	end
end
wait(1)
Status.Value = #availablePlayers.."/2"

until #availablePlayers >= 2

Round.Intermission(20)

local chosenChapter = Round.SelectChapter()

local clonedChapter = chosenChapter:Clone()
clonedChapter.Name = "Map"
clonedChapter.Parent = game.Workspace

wait(2)

if clonedChapter:FindFirstChild("Doors") then
	Door.ActivateDoors(clonedChapter.Doors)
else
		warn("Forgot to add doors")
end

local contestants = {}

for i, v in pairs(game.Players:GetPlayers()) do
	if not v:FindFirstChild("InMenu") then
		table.insert(contestants,v)
	end
end

local chosenRabbit = Round.ChooseRabbit(contestants)

for i,v in pairs(contestants) do
	if v == chosenRabbit then
		table.remove(contestants,i)
	else
			game.ReplicatedStorage.ToggleCrouch:FireClient(v,true)
	end
end

wait(2)

Round.DressRabbit(chosenRabbit)

Round.TeleportRabbit(chosenRabbit)

if clonedChapter:FindFirstChild("PlayerSpawns") then
Round.TeleportPlayers(contestants, clonedChapter.PlayerSpawns:GetChildren())
else
	warn("Fatal error, no spawns")
end

Round.InsertTag(contestants,"Contestant")
Round.InsertTag({chosenRabbit}, "Rabbit")
game.ReplicatedStorage.ChangeView:FireClient(chosenRabbit)

Round.StartRound(600,chosenRabbit,clonedChapter)

contestants = {}

for i, v in pairs(game.Players:GetPlayers()) do
	if not v:FindFirstChild("InMenu") then
		table.insert(contestants,v)
	end
end

if game.Workspace.Lobby:FindFirstChild("Spawns") then
	Round.TeleportPlayers(contestants, game.Workspace.Lobby.Spawns:GetChildren())
else
		warn("Fatal error: Cannot find spawns")
end

clonedChapter:Destroy()

Round.RemoveTags()

wait(2)
   end

Any help would be very much appreciated!

What is the most efficient way?

Should I fire a RemoteEvent and then use an OnClientEvent in a cutscene plugin module?

What I do is place some parts on the Workspace and set their position to where the camera will move. I’ll save the position and delete those parts then I just tween the camera to the saved position.

If you want only for certain players for the cutscene, yes. Do a FireClient event.

I understand that, I fully do, but how can I make that cutscene play before the round starts?

Also, since this is AlvinBlox’s tutorial, I think he has a tutorial for the cutscene on that Piggy game tutorial.

Is the cutscene gonna be a tween? (TweenService)

He doesn’t, I checked several times.

Yes it will be :wink:

I will be using Tween’s and camera etc…

When you create a tween, there will be a function called Completed. You can use this and check if the tween is completed and the cutscene is completed. A wiki for it: Tween | Documentation - Roblox Creator Hub :smile:

I understand, but again, where shall I call this function?

I think before the Piggy and the Players are teleported, since in the real game the Piggy will also see the cutscene.

1 Like

Late reply but I’d like to help. Here is a post on player-based cutscenes.