Guest User

Untitled

a guest
Jan 23rd, 2025
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.13 KB | None | 0 0
  1. local TweenService = game:GetService("TweenService")
  2. local ButtonTween = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
  3. local FrameTween = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
  4. local TransitionTween1 = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
  5. local TransitionTween2 = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
  6.  
  7. local MainFrame = script.Parent
  8.  
  9. local Buttons = MainFrame.Buttons
  10. local Popups = MainFrame.Popups
  11. local Title = MainFrame.Title
  12.  
  13. local PlayButton = Buttons.Play
  14. local SettingsButton = Buttons.Settings
  15. local CreditsButton = Buttons.Credits
  16.  
  17. local Transition = MainFrame.Parent.Transition
  18.  
  19. for i, v in pairs(Buttons:GetChildren()) do
  20.     if v:IsA("Frame") then
  21.         v.MouseEnter:Connect(function()
  22.             TweenService:Create(v, ButtonTween, {BackgroundColor3 = Color3.fromRGB(40,40,40)}):Play()
  23.         end)
  24.  
  25.         v.MouseLeave:Connect(function()
  26.             TweenService:Create(v, ButtonTween, {BackgroundColor3 = Color3.fromRGB(30,30,30)}):Play()
  27.         end)
  28.     end
  29. end
  30.  
  31. local function openPopup(popupName)
  32.  
  33.     for i, v in pairs(Buttons:GetDescendants()) do
  34.         if v:IsA("TextButton") then
  35.             v.Visible = false
  36.         end
  37.     end
  38.  
  39.     TweenService:Create(Buttons, FrameTween, {Position = UDim2.new(0.5, 0, 1.1, 0)}):Play()
  40.     TweenService:Create(Title, FrameTween, {Position = UDim2.new(0.5, 0, -0.15, 0)}):Play()
  41.  
  42.     TweenService:Create(Popups:FindFirstChild(popupName), FrameTween, {Position = UDim2.new(0.5, 0, 0.5, 0)}):Play()
  43.     Popups:FindFirstChild(popupName).Back.TextButton.Visible = true
  44. end
  45.  
  46. local function closePopup(popupName)
  47.  
  48.     for i, v in pairs(Buttons:GetDescendants()) do
  49.         if v:IsA("TextButton") then
  50.             v.Visible = true
  51.         end
  52.     end
  53.  
  54.     TweenService:Create(Buttons, FrameTween, {Position = UDim2.new(0.5, 0, 0.729, 0)}):Play()
  55.     TweenService:Create(Title, FrameTween, {Position = UDim2.new(0.5, 0, 0.299, 0)}):Play()
  56.  
  57.     TweenService:Create(Popups:FindFirstChild(popupName), FrameTween, {Position = UDim2.new(0.5, 0, 1.5, 0)}):Play()
  58.     Popups:FindFirstChild(popupName).Back.TextButton.Visible = false
  59. end
  60.  
  61. SettingsButton.TextButton.MouseButton1Click:Connect(function()
  62.     openPopup("Settings")
  63. end)
  64.  
  65. CreditsButton.TextButton.MouseButton1Click:Connect(function()
  66.     openPopup("Credits")
  67. end)
  68.  
  69. Popups.Settings.Back.TextButton.MouseButton1Click:Connect(function()
  70.     closePopup("Settings")
  71. end)
  72.  
  73. Popups.Credits.Back.TextButton.MouseButton1Click:Connect(function()
  74.     closePopup("Credits")
  75. end)
  76.  
  77. PlayButton.TextButton.MouseButton1Click:Connect(function()
  78.     for i, v in pairs(Buttons:GetDescendants()) do
  79.         if v:IsA("TextButton") then
  80.             v.Visible = false
  81.         end
  82.     end
  83.  
  84.     TweenService:Create(Buttons, FrameTween, {Position = UDim2.new(0.5, 0, 1.1, 0)}):Play()
  85.     TweenService:Create(Title, FrameTween, {Position = UDim2.new(0.5, 0, -0.15, 0)}):Play()
  86.  
  87.     TweenService:Create(Transition, TransitionTween1, {Position = UDim2.new(0.5,0,0,0)}):Play()
  88.  
  89.     wait(2)
  90.  
  91.     TweenService:Create(Transition, TransitionTween1, {Position = UDim2.new(0.5,0,1,0)}):Play()
  92.     workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
  93.  
  94.     wait(0)
  95.  
  96.     script.Parent.Parent:Destroy()
  97. end)
Advertisement
Add Comment
Please, Sign In to add comment