Advertisement
RoScripter

Intro GUI

Aug 30th, 2022 (edited)
2,680
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.45 KB | None | 0 0
  1. --PUT THIS SCRIPT UNDER ReplicatedFirst
  2.  
  3. local TweenService = game:GetService("TweenService")
  4.  
  5. local Camera = game.Workspace.CurrentCamera
  6. local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  7. local IntroGui = PlayerGui:WaitForChild("IntroGui")
  8. local IntroFrame = IntroGui:WaitForChild("IntroFrame")
  9. local TitleLabel = IntroFrame:WaitForChild("TitleLabel")
  10. local PlayButton = IntroFrame:WaitForChild("PlayButton")
  11.  
  12. local CameraAnimationTime = 60 --REPLACE 60 WITH THE DESIRED CAMERA ANIMATION TIME IN SECONDS
  13. local CameraTween
  14.  
  15. function setupCamera()
  16.     Camera:GetPropertyChangedSignal("CFrame"):Wait()
  17.     Camera.CameraType = Enum.CameraType.Scriptable
  18.  
  19.     Camera.CFrame = game.Workspace.CamPart1.CFrame
  20.  
  21.     CameraTween = TweenService:Create(Camera, TweenInfo.new(CameraAnimationTime), {["CFrame"] = game.Workspace.CamPart2.CFrame})
  22.     CameraTween:Play()
  23. end
  24.  
  25. setupCamera()
  26.  
  27. local Blur = Instance.new("BlurEffect", game.Lighting)
  28. Blur.Size = 12
  29.  
  30. IntroFrame.Visible = true
  31. TitleLabel.Text = game.MarketplaceService:GetProductInfo(game.PlaceId).Name
  32.  
  33. PlayButton.MouseButton1Click:Connect(function()
  34.     local FrameOutTween = TweenService:Create(IntroFrame, TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.In), {Position = UDim2.new(0.5, 0, -1, 0)})
  35.  
  36.     FrameOutTween:Play()
  37.     FrameOutTween.Completed:Wait()
  38.  
  39.     IntroFrame.Visible = false
  40.  
  41.     Blur:Destroy()
  42.  
  43.     CameraTween:Cancel()
  44.     Camera.CameraType = Enum.CameraType.Custom
  45. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement