Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local Lighting = game:GetService("Lighting")
- local TweenService = game:GetService("TweenService")
- local BlurEffect = Lighting:WaitForChild("Blur")
- local Player = Players.LocalPlayer
- local PlayerGui = Player.PlayerGui
- local TweenGui = {}
- function TweenGui.OpenGui(Gui: ScreenGui, Frame: Frame)
- for _, ScreenGui in PlayerGui:GetChildren() do
- if ScreenGui:IsA("ScreenGui") then
- if ScreenGui.Name ~= Gui.Name then
- ScreenGui.Enabled = false
- Gui.Enabled = true
- BlurEffect.Enabled = true
- local BlurTween = TweenService:Create(BlurEffect, TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {Size = 24}):Play()
- Frame:TweenPosition(UDim2.fromScale(0.5, 0.5), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, 1)
- end
- end
- end
- end
- function TweenGui.CloseGui(Gui: ScreenGui, Frame: Frame)
- Frame:TweenPosition(UDim2.fromScale(0.5, -2), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, 1)
- local BlurTween = TweenService:Create(BlurEffect, TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Size = 0}):Play()
- task.wait(0.5)
- BlurEffect.Enabled = false
- Gui.Enabled = false
- for _, ScreenGui in PlayerGui:GetChildren() do
- if ScreenGui:IsA("ScreenGui") then
- if ScreenGui.Name == "Main" then
- ScreenGui.Enabled = true
- end
- end
- end
- end
- return TweenGui
Advertisement
Add Comment
Please, Sign In to add comment