Advertisement
Sungmingamerpro13

Cutscene with Skip Cutscene (Break In Style)

Aug 9th, 2024 (edited)
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.91 KB | Source Code | 0 0
  1. local TweenService = game:GetService("TweenService")
  2. local Camera = game.Workspace.CurrentCamera
  3.  
  4. local players = game.Players:GetPlayers()
  5. local PlayersAmount = script.PlayersAmount
  6.  
  7. local function MoveCamera(StartPart, EndPart, Duration, EasingStyle, EasingDirection)
  8.     Camera.CameraType = Enum.CameraType.Scriptable
  9.     Camera.CFrame = StartPart.CFrame
  10.     local Cutscene = TweenService:Create(Camera, TweenInfo.new(Duration, EasingStyle, EasingDirection), {CFrame = EndPart.CFrame})
  11.     Cutscene:Play()
  12.     wait(Duration)
  13. end
  14.  
  15. local function EndCamera(StartPart, EndPart, Duration, EasingStyle, EasingDirection)
  16.     Camera.CameraType = Enum.CameraType.Scriptable
  17.     Camera.CFrame = StartPart.CFrame
  18.     local Cutscene = TweenService:Create(Camera, TweenInfo.new(Duration, EasingStyle, EasingDirection), {CFrame = EndPart.CFrame})
  19.     Cutscene:Play()
  20. end
  21.  
  22. local function Cutscene()
  23.     MoveCamera(workspace.Cutscenes.Camera3, workspace.Cutscenes.Camera4, 5 , Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
  24.     wait(.5)
  25.     Camera.CameraType = Enum.CameraType.Custom
  26.     Camera.CameraSubject = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
  27. end
  28.  
  29. local function EndCutscene()
  30.     EndCamera(workspace.Cutscenes.Camera3, workspace.Cutscenes.Camera4, 5 , Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
  31. end
  32.  
  33. game.ReplicatedStorage.Cutscenes.Cutscene2.OnClientEvent:Connect(function()
  34.     script.Parent.CutsceneFrame.Visible = true
  35.     Cutscene()
  36. end)
  37.  
  38. script.Parent.CutsceneFrame.SkipButton.MouseButton1Click:Connect(function()
  39.     PlayersAmount.Value += 1
  40. end)
  41.  
  42. PlayersAmount:GetPropertyChangedSignal("Value"):Connect(function()
  43.     script.Parent.CutsceneFrame.SkipButton.PlayesLeft.Text = PlayersAmount.Value.."/"..#players
  44.  
  45.     if PlayersAmount.Value >= #players then
  46.         script.Parent.CutsceneFrame.Visible = false
  47.         EndCutscene()
  48.     end
  49. end)
  50.  
  51. script.Parent.CutsceneFrame.SkipButton.PlayesLeft.Text = PlayersAmount.Value.."/"..#players
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement