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?