Advertisement
CV7-Studios

ROBLOX STUDIO | Main Menu Play Button SCRIPT with Animation | @CV7 Studios

May 8th, 2024
1,563
1
Never
3
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.01 KB | Source Code | 1 0
  1. --  ________  ___      ___ ________                                      
  2. -- |\   ____\|\  \    /  /|\_____  \                                      
  3. -- \ \  \___|\ \  \  /  / /\|___/  /|                                    
  4. --  \ \  \    \ \  \/  / /     /  / /                                    
  5. --   \ \  \____\ \    / /     /  / /                                      
  6. --    \ \_______\ \__/ /     /__/ /                                      
  7. --     \|_______|\|__|/      |__|/                                        
  8. --                                                                        
  9. --                                                                        
  10. --                                                                        
  11. --  ________  _________  ___  ___  ________  ___  ________  ________      
  12. -- |\   ____\|\___   ___\\  \|\  \|\   ___ \|\  \|\   __  \|\   ____\    
  13. -- \ \  \___|\|___ \  \_\ \  \\\  \ \  \_|\ \ \  \ \  \|\  \ \  \___|_    
  14. --  \ \_____  \   \ \  \ \ \  \\\  \ \  \ \\ \ \  \ \  \\\  \ \_____  \  
  15. --   \|____|\  \   \ \  \ \ \  \\\  \ \  \_\\ \ \  \ \  \\\  \|____|\  \  
  16. --     ____\_\  \   \ \__\ \ \_______\ \_______\ \__\ \_______\____\_\  \
  17. --    |\_________\   \|__|  \|_______|\|_______|\|__|\|_______|\_________\
  18. --    \|_________|                                            \|_________|
  19.  
  20. -- Made by CV7 Studios, a.k.a @CobraCXC. https://www.youtube.com/@TeamCV7
  21.  
  22. -- Put this code inside a LocalScript of the Play button
  23.  
  24. local playButton = script.Parent
  25. local frame = playButton.Parent
  26.  
  27. playButton.MouseButton1Click:Connect(function()
  28.     local startPosition = frame.Position
  29.     local endPosition = UDim2.new(-1, 0, startPosition.Y.Scale, startPosition.Y.Offset) -- Moves all the way out left
  30.  
  31.     -- Disable player movement while in menu
  32.     game.Players.LocalPlayer.Character.Humanoid.JumpPower = 0
  33.     game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 0
  34.  
  35.     -- Move out animation before destroying
  36.     local moveInfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false)
  37.     local moveTween = game:GetService("TweenService"):Create(frame, moveInfo, {Position = endPosition})
  38.     moveTween:Play()
  39.  
  40.     -- Fade out and disappear animation
  41.     wait(1) -- Wait for 1 second (same duration as the move animation)
  42.     frame:Destroy() -- This will fade out and then disappear as it's being destroyed
  43.  
  44.     -- Remove blur effect after frame is destroyed
  45.     wait(0.5) -- Wait for 1 second ahead
  46.     -- Access the BlurEffect in Lighting and disable it
  47.     game:GetService("Lighting").Blur.Enabled = false
  48.  
  49.     -- Enable player movement and camera control after script is finished
  50.     game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 -- Reset jump power to default
  51.     game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 -- Reset walk speed to default
  52. end)
  53.  
  54. -- Play button script for GUIs.
  55. -- Put this as a child to the selected Play Button.
  56. -- Also put a BlurEffect in lightning.
  57.  
  58. -- Note: Please do not rip this off and claim it as your own.
  59.  
  60. -- Thank You for using our Script!
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement