Lua Script Executor
Key RequiredUniversal

Lua Script Executor

Universal ScriptH7O_H7O_ 855 views 116 executesUpdated Mar 3, 2026
5.0/ 5(1 votes)
10100% Positive
Lua Script•148 lines (3776 chars)
local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")

local player = Players.LocalPlayer

if player:WaitForChild("PlayerGui"):FindFirstChild("SimpleExecutor") then
	player.PlayerGui.SimpleExecutor:Destroy()
end

local gui = Instance.new("ScreenGui")
gui.Name = "SimpleExecutor"
gui.ResetOnSpawn = false
gui.Parent = player.PlayerGui

local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 500, 0, 350)
frame.Position = UDim2.new(0.5, -250, 0.5, -175)
frame.BackgroundColor3 = Color3.fromRGB(25,25,25)
frame.BorderSizePixel = 0
frame.Parent = gui

local title = Instance.new("TextLabel")
title.Size = UDim2.new(1, 0, 0, 30)
title.BackgroundColor3 = Color3.fromRGB(18,18,18)
title.Text = "Lua Executor"
title.TextColor3 = Color3.new(1,1,1)
title.Font = Enum.Font.SourceSansBold
title.TextSize = 18
title.Parent = frame

local dragging = false
local dragStart, startPos

title.InputBegan:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		dragging = true
		dragStart = input.Position
		startPos = frame.Position
	end
end)

UIS.InputChanged:Connect(function(input)
	if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
		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
end)

UIS.InputEnded:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		dragging = false
	end
end)

local scroll = Instance.new("ScrollingFrame")
scroll.Size = UDim2.new(1, -20, 1, -100)
scroll.Position = UDim2.new(0, 10, 0, 40)
scroll.CanvasSize = UDim2.new(2, 0, 2, 0)
scroll.ScrollBarImageColor3 = Color3.fromRGB(120,120,120)
scroll.BackgroundColor3 = Color3.fromRGB(35,35,35)
scroll.BorderSizePixel = 0
scroll.Parent = frame

local textbox = Instance.new("TextBox")
textbox.Size = UDim2.new(2, 0, 2, 0)
textbox.BackgroundTransparency = 1
textbox.TextColor3 = Color3.new(1,1,1)
textbox.TextXAlignment = Enum.TextXAlignment.Left
textbox.TextYAlignment = Enum.TextYAlignment.Top
textbox.ClearTextOnFocus = false
textbox.MultiLine = true
textbox.TextWrapped = false
textbox.Font = Enum.Font.Code
textbox.TextSize = 16
textbox.Text = "Put Lua script here"
textbox.Parent = scroll

local function createButton(text, posX)
	local btn = Instance.new("TextButton")
	btn.Size = UDim2.new(0, 200, 0, 35)
	btn.Position = UDim2.new(0, posX, 1, -45)
	btn.BackgroundColor3 = Color3.fromRGB(55,55,55)
	btn.TextColor3 = Color3.new(1,1,1)
	btn.Font = Enum.Font.SourceSansBold
	btn.TextSize = 16
	btn.Text = text
	btn.Parent = frame
	return btn
end

local clearBtn = createButton("Clear", 40)
local execBtn = createButton("Execute", 260)

local commonWords = {
	prnt = "print",
	gmae = "game",
	wokrspace = "workspace",
	instnace = "Instance",
	strng = "string",
	mth = "math"
}

local function suggestWord(errorMsg)
	for wrong, correct in pairs(commonWords) do
		if string.find(errorMsg:lower(), wrong) then
			return correct
		end
	end
	return nil
end

clearBtn.MouseButton1Click:Connect(function()
	textbox.Text = ""
end)

execBtn.MouseButton1Click:Connect(function()

	local scriptText = textbox.Text

	if string.find(string.lower(scriptText), "loadstring") then
		textbox.Text = "Loadstring Not Supported."
		return
	end

	local func, compileError = loadstring(scriptText)

	if not func then
		textbox.Text = "Compile Error:\n"..compileError
		return
	end

	local success, runtimeError = pcall(func)

	if not success then
		local suggestion = suggestWord(runtimeError)
		if suggestion then
			textbox.Text = runtimeError .. "\n\nDid you mean: "..suggestion.." ?"
		else
			textbox.Text = "Runtime Error:\n"..runtimeError
		end
	end

end)

Features & Information

execute Lua script without looking if it has a loadstring. this executor rejects scripts with loadstring things. enjoy.

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts