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

How do I pause this cutscene? [closed]

Asked by
po_oping -15
6 years ago
01
repeat wait () until game.Workspace.CurrentCamera ~= nil
02

03
local c = game.Workspace.CurrentCamera
04
local data = LoadLibrary("RbxUtility").DecodeJSON(script.CutsceneData.Value)
05
local rs = game:GetService("RunService").RenderStepped
06

07
function tweenCam(c1,f1,time,fov,roll)
08
    local c0,f0,fv0,r0,frames = c.CoordinateFrame,c.Focus,c.FieldOfView,c:GetRoll(),time/0.015
09
    for i = 1,frames do
10
        c.CameraType = "Scriptable"
11
        c.CoordinateFrame = CFrame.new(c0.p:lerp(c1.p,i/frames),f0.p:lerp(f1.p,i/frames))
12
        c.FieldOfView = (fv0+(fov-fv0)*(i*(1/frames)))
13
        c:SetRoll(r0+(roll-r0)*(i*(1/frames)))
14
        rs:wait()
15
    end
16
end
17

18
print("Running")
19
c.CameraSubject = nil  
20
c.CameraType = "Scriptable"
21
c.CoordinateFrame = CFrame.new(unpack(data[1].c1))
22
c.Focus = CFrame.new(unpack(data[1].f1))
23
c.FieldOfView = data[1].FOV
24
c:SetRoll(data[1].Roll)
25
if script:findFirstChild("SkipCutsceneGuiValue") then
26
    local gui = script.SkipCutsceneGui:clone()
27
    gui.Parent = game.Players.LocalPlayer.PlayerGui
28
    gui.Cutscene.Value = script
29
    gui.Main.Debug.Disabled = false
30
    script.SkipCutsceneGuiValue.Value = gui
31
end
32
for i = 2,#data do
33
    tweenCam(CFrame.new(unpack(data[i].c1)),CFrame.new(unpack(data[i].f1)),data[i].step,data[i].FOV,data[i].Roll)
34
end
35
c.CameraSubject = game.Players.LocalPlayer.Character.Humanoid  
36
c.CameraType = "Custom"
37
c.FieldOfView = 70
38
if script:findFirstChild("SkipCutsceneGuiValue") then
39
    if script.SkipCutsceneGuiValue.Value ~= nil then
40
        script.SkipCutsceneGuiValue.Value:Destroy()
41
    end
42
end
43

44
script:Destroy()

Closed as Too Broad by gitrog and Goulstem

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?