I am trying to make the camera return to the player and stop a tween once the player closes the menu. For some reason the GUI disappears like normal, but the tween doesn't stop nor does the camera change. Here is the script i'm using:
-- Varibles -- local Camera = game.Workspace.CurrentCamera local Player = game.Players.LocalPlayer local TweenService = game:GetService("TweenService") repeat wait() until Player.Character -- Function -- script.Parent.Parent.ReturnMenu.TextButton.MouseButton1Click:Connect(function() script.Parent.Enabled = true script.Parent.Parent.ReturnMenu.TextButton.Visible = false Camera.CameraType = Enum.CameraType.Scriptable Camera.CFrame = game.Workspace.Cameras.A.CFrame local TweeningInfo = TweenInfo.new(60,Enum.EasingStyle.Cubic,Enum.EasingDirection.InOut,0) local CutsceneAProperties = {CFrame = game.Workspace.Cameras.B.CFrame} local CutsceneBProperties = {CFrame = game.Workspace.Cameras.D.CFrame} MenuCutsceneA = TweenService:Create(Camera,TweeningInfo,CutsceneAProperties) MenuCutsceneB = TweenService:Create(Camera,TweeningInfo,CutsceneBProperties) MenuCutsceneA:Play() wait(61) Camera.CFrame = game.Workspace.Cameras.C.CFrame MenuCutsceneB:Play() wait(61) end) script.Parent.Frame.exit.MouseButton1Click:Connect(function() game.Players.LocalPlayer.PlayerGui.Menu.Frame.Visible = false MenuCutsceneA:Pause() MenuCutsceneB:Pause() Camera.CameraType = Enum.CameraType.Custom Camera.CameraSubject = "Humanoid" end)