Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local UserInputService = game:GetService("UserInputService")
- local player = Players.LocalPlayer
- local gui = Instance.new("ScreenGui")
- gui.Name = "ScriptExecutorGUI"
- gui.ResetOnSpawn = false
- gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- gui.Parent = player:WaitForChild("PlayerGui")
- -- Основной фрейм
- local mainFrame = Instance.new("Frame")
- mainFrame.Name = "MainFrame"
- mainFrame.Size = UDim2.new(0, 400, 0, 350)
- mainFrame.Position = UDim2.new(0.5, -200, 0.5, -175)
- mainFrame.AnchorPoint = Vector2.new(0.5, 0.5)
- mainFrame.BackgroundColor3 = Color3.fromRGB(18, 18, 18)
- mainFrame.BorderColor3 = Color3.fromRGB(75, 0, 130)
- mainFrame.BorderSizePixel = 2
- mainFrame.Parent = gui
- -- Заголовок
- local title = Instance.new("TextLabel")
- title.Name = "Title"
- title.Size = UDim2.new(1, 0, 0, 40)
- title.Position = UDim2.new(0, 0, 0, 0)
- title.BackgroundColor3 = Color3.fromRGB(30, 0, 50)
- title.BorderSizePixel = 0
- title.Text = "SCRIPT EXECUTOR"
- title.TextColor3 = Color3.fromRGB(200, 180, 255)
- title.Font = Enum.Font.GothamBold
- title.TextSize = 18
- title.Parent = mainFrame
- -- Поле для ввода скрипта
- local scriptBox = Instance.new("TextBox")
- scriptBox.Name = "ScriptBox"
- scriptBox.Size = UDim2.new(0.9, 0, 0, 220)
- scriptBox.Position = UDim2.new(0.05, 0, 0.15, 0)
- scriptBox.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
- scriptBox.BorderColor3 = Color3.fromRGB(80, 0, 120)
- scriptBox.TextColor3 = Color3.fromRGB(220, 220, 220)
- scriptBox.TextXAlignment = Enum.TextXAlignment.Left
- scriptBox.TextYAlignment = Enum.TextYAlignment.Top
- scriptBox.PlaceholderText = "Введите ваш Lua скрипт здесь..."
- scriptBox.Font = Enum.Font.Code
- scriptBox.TextSize = 14
- scriptBox.MultiLine = true
- scriptBox.TextWrapped = true
- scriptBox.ClearTextOnFocus = false
- scriptBox.Parent = mainFrame
- -- Кнопка запуска
- local executeButton = Instance.new("TextButton")
- executeButton.Name = "ExecuteButton"
- executeButton.Size = UDim2.new(0.4, 0, 0, 35)
- executeButton.Position = UDim2.new(0.05, 0, 0.85, 0)
- executeButton.BackgroundColor3 = Color3.fromRGB(80, 0, 120)
- executeButton.BorderSizePixel = 0
- executeButton.Text = "ЗАПУСТИТЬ"
- executeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- executeButton.Font = Enum.Font.GothamBold
- executeButton.TextSize = 14
- executeButton.Parent = mainFrame
- -- Эффект при наведении на кнопку
- executeButton.MouseEnter:Connect(function()
- executeButton.BackgroundColor3 = Color3.fromRGB(120, 0, 180)
- end)
- executeButton.MouseLeave:Connect(function()
- executeButton.BackgroundColor3 = Color3.fromRGB(80, 0, 120)
- end)
- -- Кнопка очистки
- local clearButton = Instance.new("TextButton")
- clearButton.Name = "ClearButton"
- clearButton.Size = UDim2.new(0.4, 0, 0, 35)
- clearButton.Position = UDim2.new(0.55, 0, 0.85, 0)
- clearButton.BackgroundColor3 = Color3.fromRGB(50, 0, 80)
- clearButton.BorderSizePixel = 0
- clearButton.Text = "ОЧИСТИТЬ"
- clearButton.TextColor3 = Color3.fromRGB(200, 180, 255)
- clearButton.Font = Enum.Font.GothamBold
- clearButton.TextSize = 14
- clearButton.Parent = mainFrame
- -- Эффект при наведении на кнопку
- clearButton.MouseEnter:Connect(function()
- clearButton.BackgroundColor3 = Color3.fromRGB(80, 0, 130)
- end)
- clearButton.MouseLeave:Connect(function()
- clearButton.BackgroundColor3 = Color3.fromRGB(50, 0, 80)
- end)
- -- Кнопка закрытия
- local closeButton = Instance.new("TextButton")
- closeButton.Name = "CloseButton"
- closeButton.Size = UDim2.new(0, 30, 0, 30)
- closeButton.Position = UDim2.new(1, -35, 0, 5)
- closeButton.BackgroundColor3 = Color3.fromRGB(200, 0, 0)
- closeButton.BorderSizePixel = 0
- closeButton.Text = "X"
- closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- closeButton.Font = Enum.Font.GothamBold
- closeButton.TextSize = 16
- closeButton.Parent = mainFrame
- -- Эффект при наведении на кнопку
- closeButton.MouseEnter:Connect(function()
- closeButton.BackgroundColor3 = Color3.fromRGB(255, 50, 50)
- end)
- closeButton.MouseLeave:Connect(function()
- closeButton.BackgroundColor3 = Color3.fromRGB(200, 0, 0)
- end)
- -- Функционал кнопок
- executeButton.MouseButton1Click:Connect(function()
- local scriptText = scriptBox.Text
- if scriptText == "" then
- game:GetService("StarterGui"):SetCore("SendNotification", {
- Title = "Ошибка",
- Text = "Введите скрипт для выполнения!",
- Duration = 3
- })
- return
- end
- -- Защита от потенциально опасных операций
- local protectedScript = scriptText:gsub("shutdown()", "-- blocked")
- protectedScript = protectedScript:gsub("game:Destroy()", "-- blocked")
- protectedScript = protectedScript:gsub("while true do", "-- blocked")
- -- Выполнение скрипта
- local success, err = pcall(function()
- local func, compileError = loadstring(protectedScript)
- if func then
- func()
- else
- error(compileError)
- end
- end)
- if not success then
- game:GetService("StarterGui"):SetCore("SendNotification", {
- Title = "Ошибка выполнения",
- Text = tostring(err),
- Duration = 5
- })
- else
- game:GetService("StarterGui"):SetCore("SendNotification", {
- Title = "Успешно",
- Text = "Скрипт выполнен!",
- Duration = 3
- })
- end
- end)
- clearButton.MouseButton1Click:Connect(function()
- scriptBox.Text = ""
- end)
- closeButton.MouseButton1Click:Connect(function()
- gui:Destroy()
- end)
- -- Функционал перемещения окна
- local dragging
- local dragInput
- local dragStart
- local startPos
- local function update(input)
- local delta = input.Position - dragStart
- mainFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- title.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- dragStart = input.Position
- startPos = mainFrame.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- title.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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement