Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TweenService = game:GetService("TweenService")
- local button = script.Parent -- This is your "Play" button
- local mainFrame = script.Parent.Parent -- Assumes the button is a direct child of MainFrame
- local lighting = game:GetService("Lighting")
- local blurEffect = lighting:FindFirstChildWhichIsA("BlurEffect") -- Ensure your BlurEffect is named properly
- -- Set up the tween parameters
- local tweenTime = 1 -- Duration of the tween (adjust as needed)
- local tweenInfo = TweenInfo.new(
- tweenTime,
- Enum.EasingStyle.Quad,
- Enum.EasingDirection.Out
- )
- -- Define the target position for MainFrame: from {0,0},{0,0} to {0,0},{1,0}
- local targetFrameProps = {Position = UDim2.new(0, 0, 1, 0)}
- local frameTween = TweenService:Create(mainFrame, tweenInfo, targetFrameProps)
- -- If a BlurEffect is found, tween its Size from 14 to 0
- local blurTween
- if blurEffect then
- local targetBlurProps = {Size = 0}
- blurTween = TweenService:Create(blurEffect, tweenInfo, targetBlurProps)
- end
- -- Connect the button click to playing the tweens
- button.MouseButton1Click:Connect(function()
- frameTween:Play()
- if blurTween then
- blurTween:Play()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement