Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Локальные переменные
- local UserInputService = game:GetService("UserInputService")
- local Players = game:GetService("Players")
- local player = Players.LocalPlayer
- -- Создаем GUI
- local ScreenGui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
- ScreenGui.Name = "DrawGUI"
- -- Функция для перемещения GUI
- local function makeDraggable(frame)
- local dragging, dragInput, dragStart, startPos
- local function update(input)
- local delta = input.Position - dragStart
- frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X,
- startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- frame.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- dragStart = input.Position
- startPos = frame.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- frame.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement then
- dragInput = input
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if input == dragInput and dragging then
- update(input)
- end
- end)
- end
- -- Кнопка для открытия меню
- local openButton = Instance.new("TextButton")
- openButton.Size = UDim2.new(0, 120, 0, 40)
- openButton.Position = UDim2.new(0, 20, 0, 20)
- openButton.Text = "🖼 Открыть меню"
- openButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- openButton.TextColor3 = Color3.fromRGB(255,255,255)
- openButton.Parent = ScreenGui
- makeDraggable(openButton)
- -- GUI-меню
- local menu = Instance.new("Frame")
- menu.Size = UDim2.new(0, 320, 0, 160)
- menu.Position = UDim2.new(0, 20, 0, 80)
- menu.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- menu.Visible = false
- menu.Parent = ScreenGui
- makeDraggable(menu)
- -- Поле для ввода URL
- local input = Instance.new("TextBox")
- input.Size = UDim2.new(0, 280, 0, 30)
- input.Position = UDim2.new(0, 20, 0, 20)
- input.PlaceholderText = "Прямая ссылка на .jpg / .png"
- input.TextColor3 = Color3.new(1,1,1)
- input.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- input.ClearTextOnFocus = false
- input.Text = ""
- input.Parent = menu
- -- Кнопка "Рисовать"
- local drawBtn = Instance.new("TextButton")
- drawBtn.Size = UDim2.new(0, 120, 0, 40)
- drawBtn.Position = UDim2.new(0.5, -60, 0, 70)
- drawBtn.Text = "🎨 Нарисовать"
- drawBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
- drawBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
- drawBtn.Parent = menu
- -- Клик по кнопке меню
- openButton.MouseButton1Click:Connect(function()
- menu.Visible = not menu.Visible
- end)
- -- Нажатие на "Нарисовать"
- drawBtn.MouseButton1Click:Connect(function()
- local url = input.Text
- if not url or url == "" then
- warn("Ссылка пустая, брат.")
- return
- end
- if not (url:match("%.jpg$") or url:match("%.png$") or url:match("%.jpeg$")) then
- warn("Это не прямая ссылка на изображение.")
- return
- end
- -- Рисуем на простом Part’е с Decal
- local part = Instance.new("Part")
- part.Size = Vector3.new(10, 7, 0.2)
- part.Anchored = true
- part.Position = player.Character and (player.Character.HumanoidRootPart.Position + Vector3.new(0, 5, -10)) or Vector3.new(0, 5, 0)
- part.Parent = workspace
- part.Name = "ImageSurface"
- local decal = Instance.new("Decal")
- decal.Texture = url
- decal.Face = Enum.NormalId.Front
- decal.Parent = part
- print("Попытка загрузки изображения: ", url)
- end)
Advertisement
Add Comment
Please, Sign In to add comment