Mainexecutor.lua

mail@pastecode.io avatar
unknown
lua
5 months ago
2.3 kB
2
Indexable
-- Create the ScreenGui
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = game.CoreGui

-- Create the main frame
local mainFrame = Instance.new("Frame")
mainFrame.Size = UDim2.new(0, 400, 0, 300)
mainFrame.Position = UDim2.new(0.5, -200, 0.5, -150)
mainFrame.BackgroundColor3 = Color3.new(0, 0, 0)
mainFrame.Parent = screenGui

-- Create the TextBox for script input
local scriptBox = Instance.new("TextBox")
scriptBox.Size = UDim2.new(0.9, 0, 0.7, 0)
scriptBox.Position = UDim2.new(0.05, 0, 0.05, 0)
scriptBox.BackgroundColor3 = Color3.new(1, 1, 1)
scriptBox.TextColor3 = Color3.new(0, 0, 0)
scriptBox.Text = "Enter your script here..."
scriptBox.ClearTextOnFocus = true
scriptBox.Parent = mainFrame

-- Variables to store the injected script
local storedScript = ""

-- Create the Inject button
local injectButton = Instance.new("TextButton")
injectButton.Size = UDim2.new(0.3, 0, 0.15, 0)
injectButton.Position = UDim2.new(0.05, 0, 0.8, 0)
injectButton.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
injectButton.TextColor3 = Color3.new(1, 1, 1)
injectButton.Text = "Inject"
injectButton.Parent = mainFrame

injectButton.MouseButton1Click:Connect(function()
    storedScript = scriptBox.Text
    print("Script Injected: " .. storedScript)
end)

-- Create the Execute button
local executeButton = Instance.new("TextButton")
executeButton.Size = UDim2.new(0.3, 0, 0.15, 0)
executeButton.Position = UDim2.new(0.35, 0, 0.8, 0)
executeButton.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
executeButton.TextColor3 = Color3.new(1, 1, 1)
executeButton.Text = "Execute"
executeButton.Parent = mainFrame

executeButton.MouseButton1Click:Connect(function()
    if storedScript ~= "" then
        loadstring(storedScript)()
        print("Script Executed")
    else
        print("No script to execute!")
    end
end)

-- Create the Clear button
local clearButton = Instance.new("TextButton")
clearButton.Size = UDim2.new(0.3, 0, 0.15, 0)
clearButton.Position = UDim2.new(0.65, 0, 0.8, 0)
clearButton.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
clearButton.TextColor3 = Color3.new(1, 1, 1)
clearButton.Text = "Clear"
clearButton.Parent = mainFrame

clearButton.MouseButton1Click:Connect(function()
    scriptBox.Text = ""
    storedScript = ""
    print("Script Cleared")
end)
Leave a Comment