#how to cancel a cutscene script with a button
1 messages · Page 1 of 1 (latest)
local plr = game.Players.LocalPlayer
local plrgui = plr.PlayerGui
local CC = workspace.CurrentCamera
local Cameras = game.Workspace:WaitForChild("Cameras")
local MenuCams = Cameras:WaitForChild("MenuCams")
local Set1 = MenuCams.Set1
local S1C1 = Set1:WaitForChild("Cam1")
local S1C2 = Set1:WaitForChild("Cam2")
local Set2 = MenuCams.Set2
local S2C1 = Set2:WaitForChild("Cam1")
local S2C2 = Set2:WaitForChild("Cam2")
local Set3 = MenuCams.Set3
local S3C1 = Set3.Cam1
local S3C2 = Set3.Cam2
local RS = game:GetService("RunService")
local TS = game:GetService("TweenService")
local TI = TweenInfo.new(8.3, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local TI2 = TweenInfo.new(.6, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local FadeFrame = plrgui:WaitForChild("Fade"):WaitForChild("Frame")
local Play = plrgui["Main Menu"]:WaitForChild("Frame"):WaitForChild("Play")
local Set1Tween = TS:Create(CC, TI, {CFrame = S1C2.CFrame})
local Set2Tween = TS:Create(CC, TI, {CFrame = S2C2.CFrame})
local Set3Tween = TS:Create(CC, TI, {CFrame = S3C2.CFrame})
local FadeTweenIn = TS:Create(FadeFrame, TI2, {BackgroundTransparency = 0})
local FadeTweenOut = TS:Create(FadeFrame, TI2, {BackgroundTransparency = 1})
local LobbyCams = true
local function LFade(NextSetCam)
FadeTweenIn:Play()
task.wait(.6)
CC.CFrame = NextSetCam.CFrame
task.wait(.6)
FadeTweenOut:Play()
end
local function Fade(NextSetCam)
FadeTweenIn:Play()
FadeTweenIn.Completed:Wait()
FadeTweenOut:Play()
end
Play.MouseButton1Click:Connect(function()
LobbyCams = false
Fade()
Set1Tween:Cancel()
Set2Tween:Cancel()
Set3Tween:Cancel()
end)
while LobbyCams do
CC.CameraType = Enum.CameraType.Scriptable
CC.CFrame = S1C1.CFrame
Set1Tween:Play()
Set1Tween.Completed:Wait()
LFade(S2C1)
Set2Tween:Play()
Set2Tween.Completed:Wait()
LFade(S3C1)
Set3Tween:Play()
Set3Tween.Completed:Wait()
LFade(S1C1)
end
im trying to make it so that it cancels the cutscene and it goes to a static cam part
see here its making me have to click play 3 times until it can stop
you need to reset the player camera to default
do i reset it back because i want it to stay as scriptable
i just need the cutscene to end for the static camera
then set the player camera to the static camera
like do i put it to default and then back to scriptable
set CC.CFrame to the static camera