0% found this document useful (0 votes)
34 views2 pages

Message 2

The document outlines a Lua script for creating a simple GUI menu in Roblox, featuring a draggable frame with three buttons: 'Нажми меня!', 'И на меня!', and 'Закрыть меню'. The first two buttons print messages when clicked, while the third button hides the menu. The script also enables the user to drag the menu around the screen using the mouse.

Uploaded by

lol27727127shsja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views2 pages

Message 2

The document outlines a Lua script for creating a simple GUI menu in Roblox, featuring a draggable frame with three buttons: 'Нажми меня!', 'И на меня!', and 'Закрыть меню'. The first two buttons print messages when clicked, while the third button hides the menu. The script also enables the user to drag the menu around the screen using the mouse.

Uploaded by

lol27727127shsja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

-- Создаем окно меню

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)

You might also like