-- 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.1), {Position = UDim2.new(0.5, 0, 0.55, 0)}):Play()
TweenService:Create(Camera, TweenInfo.new(0.1), {FieldOfView = 70}):Play()
Blur.Enabled = false
task.wait(0.1)
ShopWindow.Visible = false
end
openShop.MouseButton1Click:Connect(function()
if ShopWindow.Visible == true then
CloseWindow()
else
OpenWindow()
end
end)
ShopWindow.Exit.MouseButton1Click:Connect(CloseWindow)
p.s: Интерфейс магазина я сделал, хотел сделать анимации открытия/закрытия и появления магазина
-- Services
local TweenSevuce = game:GetService(2"TweenService")
local Camera = workspace.CurrentCamera
local Blur = Instance.new ("BlurEffect",Camera)
Blur.Size = 12
Blue.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 = UDim.2(0.5, 0, 0.5, 0)}):Play()
TweenService:Create(Camera, TweenInfo.new (0.1), {Field0fView = 75}):Play()
Blur.Enabled = true
end
local function CloseWindow ()
TweenService:Create(ShopWindow, TweenInfo.new (0.1), {Position = UDim.2(0.5, 0, 0.55, 0)}):Play()
TweenService:Create(Camera, TweenInfo.new (0.1), {Field0fView = 70}):Play()
Blur.Enabled = false
task.wait(0.1)
ShopWindow.Visible = false
end
openShop.MouseBittonClick:Connect(function()
if ShopWindow.Visible == true then
CloseWindow()
else
OpenWindow()
end
end)
ShopWindow.Exit.MouseBittonClick:Connect(CloseWindow())