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

How to break out of a cutscene when the player clicks "Play"?

Asked by 8 years ago
Edited 8 years ago

So, I have a cutscene intro, with "Play" in front of it. When the player presses play, I want the camera to return to the player, and not continue the cutscene. Part of script that is meant to move the camera to follow the player:

01script.Parent.Parent.Play.MouseButton1Click:connect(function()
02    local camera = workspace.CurrentCamera
03 
04    camera.CameraType = Enum.CameraType.Attach
05    script.Parent.Visible = false
06    script.Parent.Parent.Play.Visible = false
07    workspace.CutscenePlayer:Destroy()
08 
09    for i = 0, 24, 1 do
10        game.Lighting.Blur.Size = i
11        wait(0.09)
12    end
13 
14    wait(3)
15 
16    for i = 24, 0, 1 do
17        game.Lighting.Blue.Size = i
18        wait(0.09)
19    end
20end)

Cutscene Script:

01repeat wait () until game.Workspace.CurrentCamera ~= nil
02 
03local c = game.Workspace.CurrentCamera
04local data = LoadLibrary("RbxUtility").DecodeJSON(script.CutsceneData.Value)
05local rs = game:GetService("RunService").RenderStepped
06 
07function 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
View all 43 lines...

1 answer

Log in to vote
0
Answered by 8 years ago

Well, Im not sure about making a "play button" but if you configure the script, there is a button which says skip cutscene. I will look into thsi later on

0
Or You could do a button which basically destroys the cutscene tonyv537 95 — 8y
Ad

Answer this question