Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TweenService = game:GetService("TweenService")
- local Camera = game.Workspace.CurrentCamera
- local players = game.Players:GetPlayers()
- local PlayersAmount = script.PlayersAmount
- local function MoveCamera(StartPart, EndPart, Duration, EasingStyle, EasingDirection)
- Camera.CameraType = Enum.CameraType.Scriptable
- Camera.CFrame = StartPart.CFrame
- local Cutscene = TweenService:Create(Camera, TweenInfo.new(Duration, EasingStyle, EasingDirection), {CFrame = EndPart.CFrame})
- Cutscene:Play()
- wait(Duration)
- end
- local function EndCamera(StartPart, EndPart, Duration, EasingStyle, EasingDirection)
- Camera.CameraType = Enum.CameraType.Scriptable
- Camera.CFrame = StartPart.CFrame
- local Cutscene = TweenService:Create(Camera, TweenInfo.new(Duration, EasingStyle, EasingDirection), {CFrame = EndPart.CFrame})
- Cutscene:Play()
- end
- local function Cutscene()
- MoveCamera(workspace.Cutscenes.Camera3, workspace.Cutscenes.Camera4, 5 , Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
- wait(.5)
- Camera.CameraType = Enum.CameraType.Custom
- Camera.CameraSubject = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
- end
- local function EndCutscene()
- EndCamera(workspace.Cutscenes.Camera3, workspace.Cutscenes.Camera4, 5 , Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
- end
- game.ReplicatedStorage.Cutscenes.Cutscene2.OnClientEvent:Connect(function()
- script.Parent.CutsceneFrame.Visible = true
- Cutscene()
- end)
- script.Parent.CutsceneFrame.SkipButton.MouseButton1Click:Connect(function()
- PlayersAmount.Value += 1
- end)
- PlayersAmount:GetPropertyChangedSignal("Value"):Connect(function()
- script.Parent.CutsceneFrame.SkipButton.PlayesLeft.Text = PlayersAmount.Value.."/"..#players
- if PlayersAmount.Value >= #players then
- script.Parent.CutsceneFrame.Visible = false
- EndCutscene()
- end
- end)
- script.Parent.CutsceneFrame.SkipButton.PlayesLeft.Text = PlayersAmount.Value.."/"..#players
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement