-- Services
local TweenService = game:GetService("TweenService")
local Camera = workspace.CurrentCamera
local Blur = Instance.new("BlurEffect", Camera)
Blur.Size = 12
Blur.Enabled = false
local GUI = script.Parent
local ShopWindow = GUI.Shop
ShopWindow.Visible = false
local openShop = GUI.OpenShop
local function OpenWindow()
ShopWindow.Visible = true
ShopWindow.Position = UDim2.new(0.5, 0, 0.55, 0)
TweenService:Create(ShopWindow, TweenInfo.new(0.1), {Position = UDim2.new(0.5, 0, 0.5, 0)}):Play()
TweenService:Create(Camera, TweenInfo.new(0.1), {FieldOfView = 75}):Play()
Blur.Enabled = true
end
local function CloseWindow()
TweenService:Create(ShopWindow, TweenInfo.new(0.05), {Position = UDim2.new(0.5, 0, 0.55, 0)}):Play()
TweenService:Create(Camera, TweenInfo.new(0.05), {FieldOfView = 70}):Play()
Blur.Enabled = false
task.wait(0.05)
ShopWindow.Visible = false
end
openShop.MouseButton1Click:Connect(function()
if ShopWindow.Visible == true then
CloseWindow()
else
OpenWindow()
end
end)
ShopWindow.Exit.MouseButton1Click:Connect(CloseWindow)