-- Создаем окно меню
local ScreenGui = [Link]("ScreenGui", [Link])
local Frame = [Link]("Frame", ScreenGui)
[Link] = [Link](0, 200, 0, 150)
[Link] = [Link](0.5, -100, 0.5, -75)
Frame.BackgroundColor3 = [Link](50, 50, 50)
-- Создаем кнопку "Привет"
local Button = [Link]("TextButton", Frame)
[Link] = [Link](0, 180, 0, 50)
[Link] = [Link](0, 10, 0, 10)
[Link] = "Нажми меня!"
Button.BackgroundColor3 = [Link](100, 100, 250)
Button.TextColor3 = [Link](1,1,1)
local Button2 = [Link]("TextButton", Frame)
[Link] = [Link](0, 180, 0, 50)
[Link] = [Link](0,10,0,70)
[Link] = "И на меня!"
Button.BackgroundColor3 = [Link](50, 50, 300)
Button.TextColor3 = [Link](1,1,1)
-- Третья кнопка (Закрыть)
local Button3 = [Link]("TextButton", Frame)
[Link] = [Link](0, 180, 0, 50)
[Link] = [Link](0, 10, 0, 130)
[Link] = "Закрыть меню"
Button3.BackgroundColor3 = [Link](200, 50, 50)
Button3.TextColor3 = [Link](1, 1, 1)
Button3.MouseButton1Click:Connect(function()
[Link] = false -- скрыть окно
end)
-- Перетаскивание меню мышкой
local dragging = false
local dragInput, mousePos, framePos
[Link]:Connect(function(input)
if [Link] == [Link].MouseButton1 then
dragging = true
mousePos = [Link]
framePos = [Link]
end
end)
[Link]:Connect(function(input)
if [Link] == [Link].MouseButton1 then
dragging = false
end
end)
[Link]:Connect(function(input)
if dragging and [Link] == [Link] then
local delta = [Link] - mousePos
[Link] = [Link](
[Link],
[Link] + delta.X,
[Link],
[Link] + delta.Y
)
end
end)
-- Что происходит при нажатии на кнопку
Button.MouseButton1Click:Connect(function()
print("Привет! Ты нажал кнопку!")
end)