-- Place this script inside a LocalScript in StarterGui local Players = game:GetService("Players") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") -- Create ScreenGui local screenGui = Instance.new("ScreenGui") screenGui.Name = "ScriptExecutorGui" screenGui.Parent = playerGui -- Create a Frame to hold the UI local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 300, 0, 200) frame.Position = UDim2.new(0.5, -150, 0.5, -100) frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50) frame.Parent = screenGui -- Create a multiline TextBox for script input local textBox = Instance.new("TextBox") textBox.Size = UDim2.new(1, -20, 0, 120) textBox.Position = UDim2.new(0, 10, 0, 10) textBox.Text = "-- Type your script here" textBox.TextWrapped = true textBox.ClearTextOnFocus = false textBox.MultiLine = true textBox.Font = Enum.Font.SourceSans textBox.TextSize = 14 textBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255) textBox.Parent = frame -- Create an Execute Button local executeButton = Instance.new("TextButton") executeButton.Size = UDim2.new(0, 100, 0, 30) executeButton.Position = UDim2.new(0.5, -50, 1, -40) executeButton.Text = "Execute" executeButton.Font = Enum.Font.SourceSansBold executeButton.TextSize = 14 executeButton.BackgroundColor3 = Color3.fromRGB(0, 170, 0) executeButton.TextColor3 = Color3.new(1, 1, 1) executeButton.Parent = frame -- Warning label local warningLabel = Instance.new("TextLabel") warningLabel.Size = UDim2.new(1, -20, 0, 20) warningLabel.Position = UDim2.new(0, 10, 0, 140) warningLabel.Text = "Use with caution!" warningLabel.TextColor3 = Color3.new(1, 0, 0) warningLabel.BackgroundTransparency = 1 warningLabel.Font = Enum.Font.SourceSans warningLabel.TextSize = 12 warningLabel.Parent = frame -- Function to execute the script executeButton.MouseButton1Click:Connect(function() local scriptCode = textBox.Text -- Attempt to load and run the code local func, err = loadstring(scriptCode) if func then -- pcall to safely run the code local success, result = pcall(func) if not success then warn("Error executing script: " .. tostring(result)) end else warn("Failed to compile script: " .. tostring(err)) end end)