Advertisement
luchitasin9

Play Button Script

Feb 26th, 2025
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.14 KB | Source Code | 0 0
  1. local TweenService = game:GetService("TweenService")
  2. local button = script.Parent  -- This is your "Play" button
  3. local mainFrame = script.Parent.Parent  -- Assumes the button is a direct child of MainFrame
  4. local lighting = game:GetService("Lighting")
  5. local blurEffect = lighting:FindFirstChildWhichIsA("BlurEffect")  -- Ensure your BlurEffect is named properly
  6.  
  7. -- Set up the tween parameters
  8. local tweenTime = 1  -- Duration of the tween (adjust as needed)
  9. local tweenInfo = TweenInfo.new(
  10.     tweenTime,
  11.     Enum.EasingStyle.Quad,
  12.     Enum.EasingDirection.Out
  13. )
  14.  
  15. -- Define the target position for MainFrame: from {0,0},{0,0} to {0,0},{1,0}
  16. local targetFrameProps = {Position = UDim2.new(0, 0, 1, 0)}
  17. local frameTween = TweenService:Create(mainFrame, tweenInfo, targetFrameProps)
  18.  
  19. -- If a BlurEffect is found, tween its Size from 14 to 0
  20. local blurTween
  21. if blurEffect then
  22.     local targetBlurProps = {Size = 0}
  23.     blurTween = TweenService:Create(blurEffect, tweenInfo, targetBlurProps)
  24. end
  25.  
  26. -- Connect the button click to playing the tweens
  27. button.MouseButton1Click:Connect(function()
  28.     frameTween:Play()
  29.     if blurTween then
  30.         blurTween:Play()
  31.     end
  32. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement