-- ▄▄▄ Script Executor GUI (Forced CoreGui, Always on Top, Minimize, Close) ▄▄▄ local userInputService = game:GetService("UserInputService") -- Create ScreenGui in CoreGui local screenGui = Instance.new("ScreenGui") screenGui.Name = "ScriptExecutorGui" screenGui.Parent = game:GetService("CoreGui") -- 🔥 CoreGui screenGui.ResetOnSpawn = false screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling screenGui.DisplayOrder = 99999999999999 -- Main Frame local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 300, 0, 220) frame.Position = UDim2.new(0.5, -150, 0.5, -110) frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) frame.BorderSizePixel = 0 frame.Active = true frame.Draggable = true frame.Parent = screenGui frame.ZIndex = 10 -- TopBar local topBar = Instance.new("Frame") topBar.Size = UDim2.new(1, 0, 0, 30) topBar.Position = UDim2.new(0, 0, 0, 0) topBar.BackgroundColor3 = Color3.fromRGB(30, 30, 30) topBar.BorderSizePixel = 0 topBar.Parent = frame topBar.ZIndex = 11 -- Title Text local title = Instance.new("TextLabel") title.Size = UDim2.new(1, -70, 1, 0) title.Position = UDim2.new(0, 10, 0, 0) title.Text = "Script Executor" title.TextColor3 = Color3.fromRGB(255, 255, 255) title.BackgroundTransparency = 1 title.Font = Enum.Font.SourceSansBold title.TextXAlignment = Enum.TextXAlignment.Left title.TextSize = 18 title.Parent = topBar title.ZIndex = 12 -- Close Button local closeButton = Instance.new("TextButton") closeButton.Size = UDim2.new(0, 30, 1, 0) closeButton.Position = UDim2.new(1, -30, 0, 0) closeButton.Text = "X" closeButton.TextColor3 = Color3.fromRGB(255, 255, 255) closeButton.BackgroundColor3 = Color3.fromRGB(170, 0, 0) closeButton.Parent = topBar closeButton.ZIndex = 12 -- Minimize Button local minimizeButton = Instance.new("TextButton") minimizeButton.Size = UDim2.new(0, 30, 1, 0) minimizeButton.Position = UDim2.new(1, -60, 0, 0) minimizeButton.Text = "▁" minimizeButton.TextColor3 = Color3.fromRGB(255, 255, 255) minimizeButton.BackgroundColor3 = Color3.fromRGB(100, 100, 0) minimizeButton.Parent = topBar minimizeButton.ZIndex = 12 -- TextBox local textBox = Instance.new("TextBox") textBox.Size = UDim2.new(1, -20, 1, -90) textBox.Position = UDim2.new(0, 10, 0, 40) textBox.Text = "-- Type your script here" textBox.MultiLine = true textBox.TextWrapped = true textBox.TextXAlignment = Enum.TextXAlignment.Left textBox.TextYAlignment = Enum.TextYAlignment.Top textBox.ClearTextOnFocus = false textBox.TextColor3 = Color3.fromRGB(255, 255, 255) textBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50) textBox.Parent = frame textBox.ZIndex = 10 -- Execute Button local executeButton = Instance.new("TextButton") executeButton.Size = UDim2.new(1, -20, 0, 40) executeButton.Position = UDim2.new(0, 10, 1, -45) executeButton.Text = "Execute" executeButton.TextColor3 = Color3.fromRGB(255, 255, 255) executeButton.BackgroundColor3 = Color3.fromRGB(0, 120, 0) executeButton.Parent = frame executeButton.ZIndex = 10 -- Minimize logic local originalSize = frame.Size local minimizedSize = UDim2.new(originalSize.X.Scale, originalSize.X.Offset, 0, 30) local isMinimized = false minimizeButton.MouseButton1Click:Connect(function() isMinimized = not isMinimized if isMinimized then frame.Size = minimizedSize textBox.Visible = false executeButton.Visible = false else frame.Size = originalSize textBox.Visible = true executeButton.Visible = true end end) -- Close button closeButton.MouseButton1Click:Connect(function() frame.Visible = false end) -- Hotkey (E) to toggle GUI visibility userInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.KeyCode == Enum.KeyCode.E then frame.Visible = not frame.Visible end end) -- Execute code executeButton.MouseButton1Click:Connect(function() local code = textBox.Text local success, result = pcall(function() local func = loadstring(code) if func then func() end end) if success then warn("Script executed successfully.") else warn("Script execution failed:", result) end end)