Advertisement
Sungmingamerpro13

Cutscene STORY GAME

Dec 17th, 2022 (edited)
1,188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.98 KB | None | 0 0
  1. -- If you're making another cutscene, replace all of the "PointA"s and "PointB"s into the names of your cameras --
  2.  
  3. local TweenService = game:GetService("TweenService")
  4. local CutscenesFolder = game.ReplicatedStorage:WaitForChild("Cutscenes")
  5. local CutsceneEvent = CutscenesFolder:WaitForChild("Cutscene1")
  6. local CutsceneCameras = game.Workspace:WaitForChild("CutsceneCameras")
  7. local PointA = CutsceneCameras:WaitForChild("CameraA")
  8. local PointB = CutsceneCameras:WaitForChild("CameraB")
  9. local CutsceneTime = 10
  10. local TweenInfo = TweenInfo.new(
  11.     CutsceneTime,
  12.     Enum.EasingStyle.Sine,
  13.     Enum.EasingDirection.Out,
  14.     0,
  15.     false,
  16.     0
  17. )
  18.  
  19. CutsceneEvent.OnClientEvent:Connect(function()
  20.     game.Workspace.Camera.CameraType = Enum.CameraType.Scriptable
  21.     game.Workspace.Camera.CFrame = PointA.CFrame
  22.  
  23.     local Tween = TweenService:Create(game.Workspace.Camera, TweenInfo {CFrame = PointB.CFrame})
  24.     Tween:Play()
  25.     wait(CutsceneTime)
  26.     game.Workspace.Camera.CameraType = Enum.CameraType.Custom
  27. end)
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement