ErrX realease 1i
Key RequiredUniversal

ErrX realease 1i

Universal Scriptdiecrafterdiecrafter 757 views 659 executesUpdated Oct 29, 2025
5.0/ 5(1 votes)
10100% Positive
Lua Script•1799 lines (64444 chars)
local Players = game:GetService("Players")
local HttpService = game:GetService("HttpService")
local PathfindingService = game:GetService("PathfindingService")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Workspace = game:GetService("Workspace")

local LOCAL = Players.LocalPlayer
local PlayerGui = LOCAL:WaitForChild("PlayerGui")

local GUI_NAME = "XErr_BETA_X2_0"

local months = {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"}
local function formatMonthYearFromISO(iso)
	if not iso then return "Unknown" end
	local y, m = iso:match("^(%d+)%-(%d+)%-%d+T")
	if not y or not m then return "Unknown" end
	local mi = tonumber(m) or 1
	mi = math.clamp(mi,1,12)
	return string.format("%s %s", months[mi], tostring(y))
end
local function estimateFromAccountAge(days)
	local now = os.time()
	local createdTime = now - (tonumber(days) or 0) * 24 * 60 * 60
	local t = os.date("!*t", createdTime)
	local m = math.clamp(t.month,1,12)
	return string.format("%s %d", months[m], t.year)
end
local function estimateJoinFromUserId(userId)
	local anchors = {
		{ id = 1, year = 2006 },
		{ id = 1000000, year = 2010 },
		{ id = 5000000, year = 2013 },
		{ id = 20000000, year = 2016 },
		{ id = 50000000, year = 2018 },
		{ id = 100000000, year = 2020 },
		{ id = 200000000, year = 2022 },
		{ id = 350000000, year = 2024 },
	}
	if userId <= anchors[1].id then
		local month = (userId % 12) + 1
		return formatMonthYearFromISO(string.format("%04d-%02d-01T00:00:00.000Z", anchors[1].year, month))
	end
	local last = anchors[1]
	for i = 2, #anchors do
		local a = anchors[i]
		if userId <= a.id then
			local t = (userId - last.id) / math.max(1, (a.id - last.id))
			local year = last.year + t * (a.year - last.year)
			local month = (userId % 12) + 1
			return formatMonthYearFromISO(string.format("%04d-%02d-01T00:00:00.000Z", math.floor(year+0.5), month))
		end
		last = a
	end
	local a = anchors[#anchors]
	local t = (userId - a.id) / math.max(1, a.id)
	local year = a.year + math.floor(t * 1.5)
	local month = (userId % 12) + 1
	return formatMonthYearFromISO(string.format("%04d-%02d-01T00:00:00.000Z", math.floor(year+0.5), month))
end
local function fakeAgeFromUserId(userId)
	local v = (userId % 16) + 5
	return tostring(v) .. " years"
end

local joinTimes = {}
Players.PlayerAdded:Connect(function(p) joinTimes[p.UserId] = os.time() end)
for _,p in ipairs(Players:GetPlayers()) do
	if not joinTimes[p.UserId] then joinTimes[p.UserId] = os.time() end
end

if PlayerGui:FindFirstChild(GUI_NAME) then
	pcall(function() PlayerGui[GUI_NAME]:Destroy() end)
end

local pendingFolder = ReplicatedStorage:FindFirstChild("XErr_PendingScripts")
if not pendingFolder then
	pendingFolder = Instance.new("Folder")
	pendingFolder.Name = "XErr_PendingScripts"
	pendingFolder.Parent = ReplicatedStorage
end

local screenGui = Instance.new("ScreenGui")
screenGui.Name = GUI_NAME
screenGui.ResetOnSpawn = false
screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
screenGui.Parent = PlayerGui

local main = Instance.new("Frame", screenGui)
main.Name = "Main"
main.Size = UDim2.new(0,480,0,620)
main.Position = UDim2.new(0.02,0,0.03,0)
main.BackgroundColor3 = Color3.fromRGB(20,20,20)
main.Active = true
main.Draggable = true
main.BorderSizePixel = 0

local header = Instance.new("TextLabel", main)
header.Size = UDim2.new(1,0,0,44)
header.Position = UDim2.new(0,0,0,0)
header.BackgroundColor3 = Color3.fromRGB(28,28,28)
header.Font = Enum.Font.GothamBold
header.TextSize = 16
header.TextColor3 = Color3.fromRGB(255,255,255)
header.Text = "XErr AI engine 1.7 beta (XErr BETA X2.0)"

local creatorFrame = Instance.new("Frame", main)
creatorFrame.Size = UDim2.new(1,-20,0,140)
creatorFrame.Position = UDim2.new(0,10,0,52)
creatorFrame.BackgroundTransparency = 1

local creatorLabel = Instance.new("TextLabel", creatorFrame)
creatorLabel.Size = UDim2.new(1,0,0,20)
creatorLabel.Position = UDim2.new(0,0,0,0)
creatorLabel.BackgroundTransparency = 1
creatorLabel.Font = Enum.Font.Gotham
creatorLabel.TextSize = 14
creatorLabel.TextColor3 = Color3.fromRGB(200,200,200)
creatorLabel.Text = "creator"

local creatorImg = Instance.new("ImageLabel", creatorFrame)
creatorImg.Size = UDim2.new(0,120,0,96)
creatorImg.Position = UDim2.new(0.5,-60,0,22)
creatorImg.BackgroundColor3 = Color3.fromRGB(14,14,14)
creatorImg.BorderSizePixel = 0
creatorImg.Image = "rbxasset://textures/ui/GuiImagePlaceholder.png"

local creatorMask = Instance.new("TextLabel", creatorFrame)
creatorMask.Size = UDim2.new(1,0,0,20)
creatorMask.Position = UDim2.new(0,0,0.86,0)
creatorMask.BackgroundTransparency = 1
creatorMask.Font = Enum.Font.GothamBold
creatorMask.TextSize = 14
creatorMask.TextColor3 = Color3.fromRGB(255,255,255)
creatorMask.Text = "???"

task.spawn(function()
	local ok, uid = pcall(function() return Players:GetUserIdFromNameAsync("Salmnusaod") end)
	if ok and type(uid) == "number" then
		local ok2, thumb = pcall(function() return Players:GetUserThumbnailAsync(uid, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150) end)
		if ok2 and thumb and thumb ~= "" then creatorImg.Image = thumb end
	end
end)

local listLabel = Instance.new("TextLabel", main)
listLabel.Size = UDim2.new(1,0,0,20)
listLabel.Position = UDim2.new(0,0,0,206)
listLabel.BackgroundTransparency = 1
listLabel.Font = Enum.Font.GothamBold
listLabel.TextSize = 14
listLabel.TextColor3 = Color3.fromRGB(255,255,255)
listLabel.Text = "Players"

local listFrame = Instance.new("ScrollingFrame", main)
listFrame.Size = UDim2.new(1,-20,0,340)
listFrame.Position = UDim2.new(0,10,0,232)
listFrame.BackgroundTransparency = 1
listFrame.ScrollBarThickness = 8
listFrame.CanvasSize = UDim2.new(0,0,0,0)

local ui = Instance.new("UIListLayout", listFrame)
ui.SortOrder = Enum.SortOrder.LayoutOrder
ui.Padding = UDim.new(0,8)

local closeBtn = Instance.new("TextButton", main)
closeBtn.Name = "CloseBtn"
closeBtn.Size = UDim2.new(0,96,0,36)
closeBtn.Position = UDim2.new(1,-110,0,8)
closeBtn.Text = "Close"
closeBtn.Font = Enum.Font.Gotham
closeBtn.BackgroundColor3 = Color3.fromRGB(90,90,90)
closeBtn.TextColor3 = Color3.fromRGB(255,255,255)

local seraphicBtn = Instance.new("TextButton", main)
seraphicBtn.Name = "SeraphicBtn"
seraphicBtn.Size = UDim2.new(0,96,0,36)
seraphicBtn.Position = UDim2.new(1,-218,0,8)
seraphicBtn.Text = "SERAPHIC"
seraphicBtn.Font = Enum.Font.Gotham
seraphicBtn.BackgroundColor3 = Color3.fromRGB(120,80,160)
seraphicBtn.TextColor3 = Color3.fromRGB(255,255,255)

local giveBtn = Instance.new("TextButton", main)
giveBtn.Name = "GiveBtn"
giveBtn.Size = UDim2.new(0,96,0,36)
giveBtn.Position = UDim2.new(1,-326,0,8)
giveBtn.Text = "Give Tools"
giveBtn.Font = Enum.Font.Gotham
giveBtn.BackgroundColor3 = Color3.fromRGB(80,120,160)
giveBtn.TextColor3 = Color3.fromRGB(255,255,255)

local funBtn = Instance.new("TextButton", main)
funBtn.Name = "FunBtn"
funBtn.Size = UDim2.new(0,96,0,36)
funBtn.Position = UDim2.new(1,-434,0,8)
funBtn.Text = "FUN"
funBtn.Font = Enum.Font.Gotham
funBtn.BackgroundColor3 = Color3.fromRGB(160,120,60)
funBtn.TextColor3 = Color3.fromRGB(255,255,255)

local function showConfirmClose()
	local popup = Instance.new("Frame", screenGui)
	popup.Size = UDim2.new(0,360,0,140)
	popup.Position = UDim2.new(0.5,-180,0.5,-70)
	popup.BackgroundColor3 = Color3.fromRGB(22,22,22)
	popup.Active = true
	popup.Draggable = true

	local txt = Instance.new("TextLabel", popup)
	txt.Size = UDim2.new(1,-20,0,70)
	txt.Position = UDim2.new(0,10,0,10)
	txt.BackgroundTransparency = 1
	txt.Font = Enum.Font.GothamBold
	txt.TextSize = 16
	txt.TextColor3 = Color3.fromRGB(255,255,255)
	txt.TextWrapped = true
	txt.Text = "Are you sure?"

	local yes = Instance.new("TextButton", popup)
	yes.Size = UDim2.new(0.44, -8, 0, 36)
	yes.Position = UDim2.new(0.03,0,0.66,0)
	yes.Text = "Yes"
	yes.Font = Enum.Font.Gotham
	yes.BackgroundColor3 = Color3.fromRGB(140,60,60)
	yes.TextColor3 = Color3.fromRGB(255,255,255)

	local no = Instance.new("TextButton", popup)
	no.Size = UDim2.new(0.44, -8, 0, 36)
	no.Position = UDim2.new(0.53,0,0.66,0)
	no.Text = "No"
	no.Font = Enum.Font.Gotham
	no.BackgroundColor3 = Color3.fromRGB(90,90,90)
	no.TextColor3 = Color3.fromRGB(255,255,255)

	yes.MouseButton1Click:Connect(function() popup:Destroy(); screenGui:Destroy() end)
	no.MouseButton1Click:Connect(function() popup:Destroy() end)
end
closeBtn.MouseButton1Click:Connect(showConfirmClose)

local function fetchCreatedISO(userId)
	if not HttpService or not HttpService.HttpEnabled then return nil end
	local ok, res = pcall(function()
		local url = ("https://users.roblox.com/v1/users/%d"):format(userId)
		return HttpService:GetAsync(url, true)
	end)
	if not ok or not res then return nil end
	local ok2, decoded = pcall(function() return HttpService:JSONDecode(res) end)
	if not ok2 or not decoded then return nil end
	return decoded.created
end

local camera = Workspace.CurrentCamera
local prevCameraSubject = camera.CameraSubject
local prevCameraType = camera.CameraType

local function startWatch(targetChar)
	if not targetChar then return end
	local hum = targetChar:FindFirstChildWhichIsA("Humanoid")
	if not hum then return end
	prevCameraSubject = camera.CameraSubject
	prevCameraType = camera.CameraType
	camera.CameraSubject = hum
	camera.CameraType = Enum.CameraType.Custom
end
local function stopWatch()
	camera.CameraSubject = prevCameraSubject or (LOCAL.Character and LOCAL.Character:FindFirstChildWhichIsA("Humanoid")) or camera.CameraSubject
	camera.CameraType = prevCameraType or Enum.CameraType.Custom
end

local currentFollow = { running = false, target = nil, task = nil }
local function stopFollow()
	currentFollow.running = false
	currentFollow.target = nil
	currentFollow.task = nil
	local hum = LOCAL.Character and LOCAL.Character:FindFirstChildWhichIsA("Humanoid")
	if hum then hum.WalkSpeed = 0 end
end
local function followLoop(targetPlayer)
	if not targetPlayer or not targetPlayer.Character or not targetPlayer.Character:FindFirstChild("HumanoidRootPart") then return end
	local myChar = LOCAL.Character
	if not myChar or not myChar:FindFirstChild("HumanoidRootPart") then return end
	local hum = myChar:FindFirstChildWhichIsA("Humanoid")
	if hum then hum.WalkSpeed = 16 end
	while currentFollow.running and currentFollow.target == targetPlayer and targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") do
		local startPos = myChar.HumanoidRootPart.Position
		local goalPos = targetPlayer.Character.HumanoidRootPart.Position
		local ok, path = pcall(function()
			local p = PathfindingService:CreatePath({AgentRadius = 2, AgentHeight = 5, AgentCanJump = true})
			p:ComputeAsync(startPos, goalPos)
			return p
		end)
		if ok and path and path.Status == Enum.PathStatus.Success then
			for _,wp in ipairs(path:GetWaypoints()) do
				if not (currentFollow.running and currentFollow.target == targetPlayer) then break end
				if wp.Action == Enum.PathWaypointAction.Jump then pcall(function() hum.Jump = true end) end
				pcall(function() hum:MoveTo(wp.Position) end)
				hum.MoveToFinished:Wait()
				if not (currentFollow.running and currentFollow.target == targetPlayer) then break end
			end
		else
			pcall(function() hum:MoveTo(goalPos) end)
			task.wait(0.6)
		end
		task.wait(0.15)
	end
	if hum then hum.WalkSpeed = 0 end
end
local function toggleFollowOnPlayer(targetPlayer, button)
	if currentFollow.running and currentFollow.target == targetPlayer then
		stopFollow()
		if button then button.Text = "Follow" end
	else
		stopFollow()
		currentFollow.running = true
		currentFollow.target = targetPlayer
		if button then button.Text = "Stop" end
		currentFollow.task = task.spawn(function() followLoop(targetPlayer) end)
	end
end

local function makeCardForPlayer(p)
	local card = Instance.new("Frame")
	card.Size = UDim2.new(1,-12,0,220)
	card.BackgroundColor3 = Color3.fromRGB(28,28,28)
	card.BorderSizePixel = 0
	card.Name = "Card_"..tostring(p.UserId)

	local corner = Instance.new("UICorner", card)
	corner.CornerRadius = UDim.new(0,8)

	local createdLabel = Instance.new("TextLabel", card)
	createdLabel.Size = UDim2.new(1,-20,0,20)
	createdLabel.Position = UDim2.new(0,10,0,6)
	createdLabel.BackgroundTransparency = 1
	createdLabel.Font = Enum.Font.Gotham
	createdLabel.TextSize = 12
	createdLabel.TextColor3 = Color3.fromRGB(200,200,200)
	createdLabel.TextXAlignment = Enum.TextXAlignment.Center
	createdLabel.Text = "Joined: ..."

	local img = Instance.new("ImageLabel", card)
	img.Size = UDim2.new(0,120,0,96)
	img.Position = UDim2.new(0.5,-60,0,32)
	img.BackgroundColor3 = Color3.fromRGB(16,16,16)
	img.BorderSizePixel = 0
	img.Image = "rbxasset://textures/ui/GuiImagePlaceholder.png"

	local nameLbl = Instance.new("TextLabel", card)
	nameLbl.Size = UDim2.new(1,-20,0,22)
	nameLbl.Position = UDim2.new(0,10,0,136)
	nameLbl.BackgroundTransparency = 1
	nameLbl.Font = Enum.Font.GothamBold
	nameLbl.TextSize = 14
	nameLbl.TextColor3 = Color3.fromRGB(255,255,255)
	nameLbl.TextXAlignment = Enum.TextXAlignment.Center
	nameLbl.Text = p.Name

	local ageLbl = Instance.new("TextLabel", card)
	ageLbl.Size = UDim2.new(1,-20,0,18)
	ageLbl.Position = UDim2.new(0,10,0,160)
	ageLbl.BackgroundTransparency = 1
	ageLbl.Font = Enum.Font.Gotham
	ageLbl.TextSize = 12
	ageLbl.TextColor3 = Color3.fromRGB(200,200,200)
	ageLbl.TextXAlignment = Enum.TextXAlignment.Center
	ageLbl.Text = "Age: "..fakeAgeFromUserId(p.UserId)

	local followBtn = Instance.new("TextButton", card)
	followBtn.Size = UDim2.new(0.46,0,0,32)
	followBtn.Position = UDim2.new(0.03,0,0.82,0)
	followBtn.Text = "Follow"
	followBtn.Font = Enum.Font.Gotham
	followBtn.BackgroundColor3 = Color3.fromRGB(80,120,160)
	followBtn.TextColor3 = Color3.fromRGB(255,255,255)

	local watchBtn = Instance.new("TextButton", card)
	watchBtn.Size = UDim2.new(0.46,0,0,32)
	watchBtn.Position = UDim2.new(0.51,0,0.82,0)
	watchBtn.Text = "Watch"
	watchBtn.Font = Enum.Font.Gotham
	watchBtn.BackgroundColor3 = Color3.fromRGB(100,80,120)
	watchBtn.TextColor3 = Color3.fromRGB(255,255,255)

	task.spawn(function()
		local ok, thumb = pcall(function()
			return Players:GetUserThumbnailAsync(p.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150)
		end)
		if ok and thumb and thumb ~= "" then img.Image = thumb end
	end)

	task.spawn(function()
		local iso = nil
		if HttpService and HttpService.HttpEnabled then
			iso = fetchCreatedISO(p.UserId)
		end
		if iso and type(iso) == "string" then
			createdLabel.Text = "Joined: "..formatMonthYearFromISO(iso)
		elseif p.AccountAge then
			createdLabel.Text = "Joined: "..estimateFromAccountAge(p.AccountAge)
		else
			createdLabel.Text = "Joined: "..estimateJoinFromUserId(p.UserId)
		end
	end)

	followBtn.MouseButton1Click:Connect(function()
		local targetPlayer = Players:GetPlayerByUserId(p.UserId)
		if not targetPlayer then return end
		toggleFollowOnPlayer(targetPlayer, followBtn)
	end)
	local watchingLocal = false
	watchBtn.MouseButton1Click:Connect(function()
		local targetPlayer = Players:GetPlayerByUserId(p.UserId)
		if not targetPlayer or not targetPlayer.Character then return end
		if watchingLocal then
			stopWatch()
			watchBtn.Text = "Watch"
			watchingLocal = false
		else
			startWatch(targetPlayer.Character)
			watchBtn.Text = "Unview"
			watchingLocal = true
		end
	end)

	return card
end

local function refreshList()
	for _,c in ipairs(listFrame:GetChildren()) do
		if c:IsA("Frame") then pcall(function() c:Destroy() end) end
	end
	local players = Players:GetPlayers()
	table.sort(players, function(a,b) return a.Name:lower() < b.Name:lower() end)
	for _,p in ipairs(players) do
		local card = makeCardForPlayer(p)
		card.Parent = listFrame
	end
	RunService.Heartbeat:Wait()
	listFrame.CanvasSize = UDim2.new(0,0,0, ui.AbsoluteContentSize.Y + 16)
end

refreshList()
Players.PlayerAdded:Connect(function(p) joinTimes[p.UserId] = os.time(); task.wait(0.12); refreshList() end)
Players.PlayerRemoving:Connect(function() task.wait(0.12); refreshList() end)

local remoteName = "XErr_GiveToolEvent_SAFE"
local giveEvent = ReplicatedStorage:FindFirstChild(remoteName)
if not giveEvent then
	local ev = Instance.new("RemoteEvent")
	ev.Name = remoteName
	ev.Parent = ReplicatedStorage
	giveEvent = ev
end
giveBtn.MouseButton1Click:Connect(function()
	pcall(function() giveEvent:FireServer() end)
	giveBtn.Text = "Requested"
	task.delay(1.2, function() if giveBtn and giveBtn.Parent then giveBtn.Text = "Give Tools" end end)
end)

funBtn.MouseButton1Click:Connect(function()
	local expanded = main.Size.X.Offset > 480
	if not expanded then
		main.Size = UDim2.new(0,760,0,620)
		if not main:FindFirstChild("FunPanel") then
			local funPanel = Instance.new("Frame", main)
			funPanel.Name = "FunPanel"
			funPanel.Size = UDim2.new(0,260,1,0)
			funPanel.Position = UDim2.new(1, -260, 0, 0)
			funPanel.BackgroundColor3 = Color3.fromRGB(24,24,24)
			local title = Instance.new("TextLabel", funPanel)
			title.Size = UDim2.new(1,0,0,36)
			title.BackgroundColor3 = Color3.fromRGB(28,28,28)
			title.Font = Enum.Font.GothamBold
			title.TextSize = 14
			title.TextColor3 = Color3.fromRGB(255,255,255)
			title.Text = "Fun / Presets"

			local btn1 = Instance.new("TextButton", funPanel)
			btn1.Size = UDim2.new(1,-16,0,34)
			btn1.Position = UDim2.new(0,8,0,50)
			btn1.Text = "SYSTEM broken"
			btn1.Font = Enum.Font.Gotham
			btn1.BackgroundColor3 = Color3.fromRGB(90,90,90)
			btn1.TextColor3 = Color3.fromRGB(255,255,255)
			btn1.MouseButton1Click:Connect(function()
				scriptBox.Text = "-- SYSTEM broken (example):\n-- loadstring(game:HttpGet(\"https://raw.githubusercontent.com/H20CalibreYT/SystemBroken/main/script\"))()\n"
			end)

			local btn2 = Instance.new("TextButton", funPanel)
			btn2.Size = UDim2.new(1,-16,0,34)
			btn2.Position = UDim2.new(0,8,0,96)
			btn2.Text = "fly gui v3"
			btn2.Font = Enum.Font.Gotham
			btn2.BackgroundColor3 = Color3.fromRGB(90,90,90)
			btn2.TextColor3 = Color3.fromRGB(255,255,255)
			btn2.MouseButton1Click:Connect(function()
				scriptBox.Text = "-- fly gui v3 (example):\n-- loadstring(game:HttpGet(\"https://raw.githubusercontent.com/JHS-arch/fly-script-roblox-delta-executor-2025/main/mortisanddavegloveinslapbattles.lua\"))()\n"
			end)

			local btn3 = Instance.new("TextButton", funPanel)
			btn3.Size = UDim2.new(1,-16,0,34)
			btn3.Position = UDim2.new(0,8,0,142)
			btn3.Text = "only brookhaven fe audio"
			btn3.Font = Enum.Font.Gotham
			btn3.BackgroundColor3 = Color3.fromRGB(90,90,90)
			btn3.TextColor3 = Color3.fromRGB(255,255,255)
			btn3.MouseButton1Click:Connect(function()
				scriptBox.Text = "-- brookhaven audio (example):\n-- loadstring(game:HttpGet(\"https://raw.githubusercontent.com/nmalka01/nmalka01/refs/heads/main/Brookhaven_audio\"))()\n"
			end)
		end
	else
		local funPanel = main:FindFirstChild("FunPanel")
		if funPanel then funPanel:Destroy() end
		main.Size = UDim2.new(0,480,0,620)
	end
end)

local seraphicURLs = {
	{name = "SYSTEM broken", url = 'https://raw.githubusercontent.com/H20CalibreYT/SystemBroken/main/script'},
	{name = "fly gui v3", url = 'https://raw.githubusercontent.com/JHS-arch/fly-script-roblox-delta-executor-2025/main/mortisanddavegloveinslapbattles.lua'},
	{name = "only brookhaven fe audio", url = 'https://raw.githubusercontent.com/nmalka01/nmalka01/refs/heads/main/Brookhaven_audio'},
	{name = "SERAPHIC paste", url = 'https://pastefy.app/59mJGQGe/raw'},
}

local function confirmAndRun(code)
	if not code or code:match("%S") == nil then return end
	local warn = Instance.new("Frame", screenGui)
	warn.Size = UDim2.new(0,420,0,140)
	warn.Position = UDim2.new(0.5,-210,0.5,-70)
	warn.BackgroundColor3 = Color3.fromRGB(22,22,22)
	warn.Active = true
	warn.Draggable = true

	local wtxt = Instance.new("TextLabel", warn)
	wtxt.Size = UDim2.new(1,-20,0,76)
	wtxt.Position = UDim2.new(0,10,0,8)
	wtxt.BackgroundTransparency = 1
	wtxt.Font = Enum.Font.GothamBold
	wtxt.TextSize = 14
	wtxt.TextColor3 = Color3.new(1,1,1)
	wtxt.TextWrapped = true
	wtxt.Text = "⚠️ At your own risk — running pasted code executes locally on your client.\nButtons: Close | OK | Open"

	local closeWarn = Instance.new("TextButton", warn)
	closeWarn.Size = UDim2.new(0.3,0,0,32)
	closeWarn.Position = UDim2.new(0.03,0,0.72,0)
	closeWarn.Text = "Close"
	closeWarn.Font = Enum.Font.Gotham
	closeWarn.BackgroundColor3 = Color3.fromRGB(100,100,100)
	closeWarn.TextColor3 = Color3.new(1,1,1)

	local okBtn = Instance.new("TextButton", warn)
	okBtn.Size = UDim2.new(0.3,0,0,32)
	okBtn.Position = UDim2.new(0.35,0,0.72,0)
	okBtn.Text = "OK"
	okBtn.Font = Enum.Font.Gotham
	okBtn.BackgroundColor3 = Color3.fromRGB(140,80,80)
	okBtn.TextColor3 = Color3.new(1,1,1)

	local openBtn = Instance.new("TextButton", warn)
	openBtn.Size = UDim2.new(0.3,0,0,32)
	openBtn.Position = UDim2.new(0.67,0,0.72,0)
	openBtn.Text = "Open"
	openBtn.Font = Enum.Font.Gotham
	openBtn.BackgroundColor3 = Color3.fromRGB(40,130,40)
	openBtn.TextColor3 = Color3.new(1,1,1)

	closeWarn.MouseButton1Click:Connect(function() warn:Destroy() end)
	okBtn.MouseButton1Click:Connect(function() warn:Destroy() end)

	openBtn.MouseButton1Click:Connect(function()
		warn:Destroy()
		local final = Instance.new("Frame", screenGui)
		final.Size = UDim2.new(0,360,0,120)
		final.Position = UDim2.new(0.5,-180,0.5,-60)
		final.BackgroundColor3 = Color3.fromRGB(20,20,20)
		final.Active = true
		final.Draggable = true

		local lbl = Instance.new("TextLabel", final)
		lbl.Size = UDim2.new(1,-20,0,72)
		lbl.Position = UDim2.new(0,10,0,8)
		lbl.BackgroundTransparency = 1
		lbl.Font = Enum.Font.GothamBold
		lbl.TextSize = 13
		lbl.TextColor3 = Color3.new(1,1,1)
		lbl.TextWrapped = true
		lbl.Text = "Final confirm: This will execute the pasted Lua code locally. Press Confirm to run."

		local yes = Instance.new("TextButton", final)
		yes.Size = UDim2.new(0.44,-8,0,32)
		yes.Position = UDim2.new(0.03,0,0.68,0)
		yes.Text = "Confirm"
		yes.Font = Enum.Font.Gotham
		yes.BackgroundColor3 = Color3.fromRGB(140,60,60)
		yes.TextColor3 = Color3.new(1,1,1)

		local nof = Instance.new("TextButton", final)
		nof.Size = UDim2.new(0.44,-8,0,32)
		nof.Position = UDim2.new(0.53,0,0.68,0)
		nof.Text = "Cancel"
		nof.Font = Enum.Font.Gotham
		nof.BackgroundColor3 = Color3.fromRGB(90,90,90)
		nof.TextColor3 = Color3.new(1,1,1)

		nof.MouseButton1Click:Connect(function() final:Destroy() end)
		yes.MouseButton1Click:Connect(function()
			final:Destroy()
			local fn, err = loadstring(code)
			if not fn then
				warn("Load error: "..tostring(err))
				return
			end
			local ok2, res = pcall(fn)
			if not ok2 then
				warn("Runtime error: "..tostring(res))
			end
		end)
	end)
end

local function openSeraphic()
	local viewer = Instance.new("Frame", screenGui)
	viewer.Size = UDim2.new(0,560,0,420)
	viewer.Position = UDim2.new(0.5,-280,0.5,-210)
	viewer.BackgroundColor3 = Color3.fromRGB(24,24,24)
	viewer.Active = true
	viewer.Draggable = true

	local header = Instance.new("TextLabel", viewer)
	header.Size = UDim2.new(1,0,0,36)
	header.Position = UDim2.new(0,0,0,0)
	header.BackgroundColor3 = Color3.fromRGB(30,30,30)
	header.Font = Enum.Font.GothamBold
	header.TextSize = 14
	header.TextColor3 = Color3.new(1,1,1)
	header.Text = "SERAPHIC (viewer) — At your own risk"

	local urlBox = Instance.new("TextBox", viewer)
	urlBox.Size = UDim2.new(1,-20,0,28)
	urlBox.Position = UDim2.new(0,10,0,48)
	urlBox.ClearTextOnFocus = false
	urlBox.Font = Enum.Font.SourceSans
	urlBox.TextSize = 13
	urlBox.Text = seraphicURLs[#seraphicURLs].url

	local info = Instance.new("TextLabel", viewer)
	info.Size = UDim2.new(1,-20,0,40)
	info.Position = UDim2.new(0,10,0,84)
	info.BackgroundTransparency = 1
	info.Font = Enum.Font.SourceSans
	info.TextSize = 13
	info.TextColor3 = Color3.fromRGB(200,200,200)
	info.TextWrapped = true
	info.Text = "Copy URL or press a preset to prefill the code box. THIS VIEWER DOES NOT AUTO-LOAD REMOTE SCRIPTS."

	local codeBox = Instance.new("TextBox", viewer)
	codeBox.Size = UDim2.new(1,-20,0,220)
	codeBox.Position = UDim2.new(0,10,0,128)
	codeBox.MultiLine = true
	codeBox.ClearTextOnFocus = false
	codeBox.Font = Enum.Font.Code
	codeBox.TextSize = 12
	codeBox.Text = "-- paste safe Lua here to run locally (client-side)."

	local presetsFrame = Instance.new("Frame", viewer)
	presetsFrame.Size = UDim2.new(1,-20,0,28)
	presetsFrame.Position = UDim2.new(0,10,0,100)
	presetsFrame.BackgroundTransparency = 1

	local x = 0
	for i,entry in ipairs(seraphicURLs) do
		local b = Instance.new("TextButton", presetsFrame)
		b.Size = UDim2.new(0,140,1,0)
		b.Position = UDim2.new(0,x,0,0)
		b.Text = entry.name
		b.Font = Enum.Font.SourceSans
		b.TextSize = 13
		b.BackgroundColor3 = Color3.fromRGB(90,90,90)
		b.TextColor3 = Color3.new(1,1,1)
		x = x + 146
		b.MouseButton1Click:Connect(function()
			urlBox.Text = entry.url
			codeBox.Text = "-- Example (UNCOMMENT to use locally in Studio only):\n-- loadstring(game:HttpGet(\"" .. entry.url .. "\"))()\n\n-- Or paste your own trusted code below:\n"
		end)
	end

	local copyBtn = Instance.new("TextButton", viewer)
	copyBtn.Size = UDim2.new(0.28,0,0,34)
	copyBtn.Position = UDim2.new(0.05,0,0.92,0)
	copyBtn.Text = "Copy URL"
	copyBtn.Font = Enum.Font.SourceSans
	copyBtn.BackgroundColor3 = Color3.fromRGB(90,90,90)
	copyBtn.TextColor3 = Color3.new(1,1,1)

	local runBtn = Instance.new("TextButton", viewer)
	runBtn.Size = UDim2.new(0.28,0,0,34)
	runBtn.Position = UDim2.new(0.37,0,0.92,0)
	runBtn.Text = "Run (local)"
	runBtn.Font = Enum.Font.SourceSans
	runBtn.BackgroundColor3 = Color3.fromRGB(140,60,60)
	runBtn.TextColor3 = Color3.new(1,1,1)

	local closeViewer = Instance.new("TextButton", viewer)
	closeViewer.Size = UDim2.new(0.28,0,0,34)
	closeViewer.Position = UDim2.new(0.69,0,0.92,0)
	closeViewer.Text = "Close"
	closeViewer.Font = Enum.Font.SourceSans
	closeViewer.BackgroundColor3 = Color3.fromRGB(90,90,90)
	closeViewer.TextColor3 = Color3.new(1,1,1)

	copyBtn.MouseButton1Click:Connect(function()
		pcall(function() if setclipboard then setclipboard(urlBox.Text) end end)
		copyBtn.Text = "Copied"
		task.delay(1, function() if copyBtn and copyBtn.Parent then copyBtn.Text = "Copy URL" end end)
	end)
	closeViewer.MouseButton1Click:Connect(function() viewer:Destroy() end)

	runBtn.MouseButton1Click:Connect(function()
		local code = tostring(codeBox.Text or "")
		if code:match("%S") == nil then return end
		confirmAndRun(code)
	end)
end

seraphicBtn.MouseButton1Click:Connect(openSeraphic)

local exeFrame = Instance.new("Frame", main)
exeFrame.Size = UDim2.new(0,440,0,60)
exeFrame.Position = UDim2.new(0,18,0,170)
exeFrame.BackgroundTransparency = 1

local scriptBox = Instance.new("TextBox", main)
scriptBox.Size = UDim2.new(0,440,0,120)
scriptBox.Position = UDim2.new(0,18,0,290)
scriptBox.BackgroundTransparency = 1
scriptBox.Text = ""
scriptBox.TextColor3 = Color3.fromRGB(255,255,255)
scriptBox.TextSize = 14
scriptBox.Font = Enum.Font.Code
scriptBox.ClearTextOnFocus = false
scriptBox.MultiLine = true
scriptBox.TextWrapped = true

local tb = Instance.new("TextBox", exeFrame)
tb.Size = UDim2.new(1,0,1,0)
tb.Position = UDim2.new(0,0,0,0)
tb.BackgroundTransparency = 1
tb.Text = ""
tb.MultiLine = false
tb.ClearTextOnFocus = true
tb.PlaceholderText = "Quick paste area (optional)"

local smallButtons = Instance.new("Frame", main)
smallButtons.Size = UDim2.new(0,440,0,36)
smallButtons.Position = UDim2.new(0,18,0,420)
smallButtons.BackgroundTransparency = 1

local function makeSmall(parent, x, txt, bg)
	local b = Instance.new("TextButton", parent)
	b.Size = UDim2.new(0,100,1,0)
	b.Position = UDim2.new(0,x,0,0)
	b.Text = txt
	b.Font = Enum.Font.Gotham
	b.TextSize = 14
	b.BackgroundColor3 = bg or Color3.fromRGB(120,120,120)
	b.TextColor3 = Color3.fromRGB(255,255,255)
	return b
end

local exeBtn = makeSmall(smallButtons, 0, "EXE", Color3.fromRGB(200,160,80))
local clearBtn = makeSmall(smallButtons, 110, "CLEAR", Color3.fromRGB(120,120,120))
local injectBtn = makeSmall(smallButtons, 220, "INJECT", Color3.fromRGB(80,140,160))
local flyBtn = makeSmall(smallButtons, 330, "FLY", Color3.fromRGB(120,80,160))

exeBtn.MouseButton1Click:Connect(function()
	local code = tostring(scriptBox.Text or "")
	confirmAndRun(code)
end)
clearBtn.MouseButton1Click:Connect(function() scriptBox.Text = "" end)

injectBtn.MouseButton1Click:Connect(function()
	local code = tostring(scriptBox.Text or "")
	if not code or code:match("%S") == nil then
		warn("No script provided to inject.")
		return
	end
	local sv = Instance.new("StringValue")
	sv.Name = ("Pending_%s_%d"):format(LOCAL.Name, tick())
	sv.Value = code
	sv:SetAttribute("PlayerName", LOCAL.Name)
	sv.Parent = pendingFolder
	injectBtn.Text = "Injected"
	task.delay(1.2, function() if injectBtn and injectBtn.Parent then injectBtn.Text = "INJECT" end end)
end)

local flying = false
local bv, bg, flightConn
local function enableFlight(speed)
	if flying then return end
	local char = LOCAL.Character
	if not char then return end
	local hrp = char:FindFirstChild("HumanoidRootPart")
	local hum = char:FindFirstChildWhichIsA("Humanoid")
	if not hrp or not hum then return end

	bv = Instance.new("BodyVelocity")
	bv.MaxForce = Vector3.new(1e5,1e5,1e5)
	bv.Velocity = Vector3.new(0,0,0)
	bv.P = 5000
	bv.Parent = hrp

	bg = Instance.new("BodyGyro")
	bg.MaxTorque = Vector3.new(1e5,1e5,1e5)
	bg.CFrame = workspace.CurrentCamera.CFrame
	bg.P = 2000
	bg.Parent = hrp

	flying = true

	local forward, right, up = 0,0,0
	local function onInputBegan(input, gpe)
		if gpe then return end
		if input.KeyCode == Enum.KeyCode.W then forward = 1
		elseif input.KeyCode == Enum.KeyCode.S then forward = -1
		elseif input.KeyCode == Enum.KeyCode.A then right = -1
		elseif input.KeyCode == Enum.KeyCode.D then right = 1
		elseif input.KeyCode == Enum.KeyCode.Space then up = 1
		elseif input.KeyCode == Enum.KeyCode.LeftShift then up = -1 end
	end
	local function onInputEnded(input, gpe)
		if gpe then return end
		if input.KeyCode == Enum.KeyCode.W and forward == 1 then forward = 0
		elseif input.KeyCode == Enum.KeyCode.S and forward == -1 then forward = 0
		elseif input.KeyCode == Enum.KeyCode.A and right == -1 then right = 0
		elseif input.KeyCode == Enum.KeyCode.D and right == 1 then right = 0
		elseif input.KeyCode == Enum.KeyCode.Space and up == 1 then up = 0
		elseif input.KeyCode == Enum.KeyCode.LeftShift and up == -1 then up = 0 end
	end
	UserInputService.InputBegan:Connect(onInputBegan)
	UserInputService.InputEnded:Connect(onInputEnded)

	local function getSpeed() return 50 end
	flightConn = RunService.RenderStepped:Connect(function(dt)
		local cam = workspace.CurrentCamera
		if not cam then return end
		local camCFrame = cam.CFrame
		local look = Vector3.new(camCFrame.LookVector.X,0,camCFrame.LookVector.Z)
		if look.Magnitude > 0 then look = look.Unit end
		local rightV = Vector3.new(camCFrame.RightVector.X,0,camCFrame.RightVector.Z)
		if rightV.Magnitude > 0 then rightV = rightV.Unit end
		local moveHor = (look * forward) + (rightV * right)
		local vert = up
		local dir = moveHor
		if dir.Magnitude > 1 then dir = dir.Unit end
		local speed = getSpeed()
		local desired = dir * speed + Vector3.new(0, vert * (speed * 0.6), 0)
		local cur = bv.Velocity
		bv.Velocity = cur:Lerp(desired, math.clamp(dt * 10, 0, 1))
		bg.CFrame = CFrame.new(hrp.Position, hrp.Position + camCFrame.LookVector)
	end)
end
local function disableFlight()
	if not flying then return end
	local char = LOCAL.Character
	if char then
		local hrp = char:FindFirstChild("HumanoidRootPart")
		if hrp then
			for _,c in ipairs(hrp:GetChildren()) do
				if c:IsA("BodyVelocity") or c:IsA("BodyGyro") then
					pcall(function() c:Destroy() end)
				end
			end
		end
	end
	if flightConn then flightConn:Disconnect() flightConn = nil end
	flying = false
end

flyBtn.MouseButton1Click:Connect(function()
	if flying then
		disableFlight()
		flyBtn.Text = "FLY"
		flyBtn.BackgroundColor3 = Color3.fromRGB(120,80,160)
	else
		enableFlight(50)
		flyBtn.Text = "STOP"
		flyBtn.BackgroundColor3 = Color3.fromRGB(80,160,120)
	end
end)

LOCAL.CharacterAdded:Connect(function()
	task.wait(1)
	stopWatch()
	stopFollow()
	disableFlight()
end)

print("[XErr BETA X2.0] UI ready (safe).")local Players = game:GetService("Players")
local HttpService = game:GetService("HttpService")
local PathfindingService = game:GetService("PathfindingService")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Workspace = game:GetService("Workspace")

local LOCAL = Players.LocalPlayer
local PlayerGui = LOCAL:WaitForChild("PlayerGui")

local GUI_NAME = "XErr_BETA_X2_0"

local months = {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"}
local function formatMonthYearFromISO(iso)
	if not iso then return "Unknown" end
	local y, m = iso:match("^(%d+)%-(%d+)%-%d+T")
	if not y or not m then return "Unknown" end
	local mi = tonumber(m) or 1
	mi = math.clamp(mi,1,12)
	return string.format("%s %s", months[mi], tostring(y))
end
local function estimateFromAccountAge(days)
	local now = os.time()
	local createdTime = now - (tonumber(days) or 0) * 24 * 60 * 60
	local t = os.date("!*t", createdTime)
	local m = math.clamp(t.month,1,12)
	return string.format("%s %d", months[m], t.year)
end
local function estimateJoinFromUserId(userId)
	local anchors = {
		{ id = 1, year = 2006 },
		{ id = 1000000, year = 2010 },
		{ id = 5000000, year = 2013 },
		{ id = 20000000, year = 2016 },
		{ id = 50000000, year = 2018 },
		{ id = 100000000, year = 2020 },
		{ id = 200000000, year = 2022 },
		{ id = 350000000, year = 2024 },
	}
	if userId <= anchors[1].id then
		local month = (userId % 12) + 1
		return formatMonthYearFromISO(string.format("%04d-%02d-01T00:00:00.000Z", anchors[1].year, month))
	end
	local last = anchors[1]
	for i = 2, #anchors do
		local a = anchors[i]
		if userId <= a.id then
			local t = (userId - last.id) / math.max(1, (a.id - last.id))
			local year = last.year + t * (a.year - last.year)
			local month = (userId % 12) + 1
			return formatMonthYearFromISO(string.format("%04d-%02d-01T00:00:00.000Z", math.floor(year+0.5), month))
		end
		last = a
	end
	local a = anchors[#anchors]
	local t = (userId - a.id) / math.max(1, a.id)
	local year = a.year + math.floor(t * 1.5)
	local month = (userId % 12) + 1
	return formatMonthYearFromISO(string.format("%04d-%02d-01T00:00:00.000Z", math.floor(year+0.5), month))
end
local function fakeAgeFromUserId(userId)
	local v = (userId % 16) + 5
	return tostring(v) .. " years"
end

local joinTimes = {}
Players.PlayerAdded:Connect(function(p) joinTimes[p.UserId] = os.time() end)
for _,p in ipairs(Players:GetPlayers()) do
	if not joinTimes[p.UserId] then joinTimes[p.UserId] = os.time() end
end

if PlayerGui:FindFirstChild(GUI_NAME) then
	pcall(function() PlayerGui[GUI_NAME]:Destroy() end)
end

local pendingFolder = ReplicatedStorage:FindFirstChild("XErr_PendingScripts")
if not pendingFolder then
	pendingFolder = Instance.new("Folder")
	pendingFolder.Name = "XErr_PendingScripts"
	pendingFolder.Parent = ReplicatedStorage
end

local screenGui = Instance.new("ScreenGui")
screenGui.Name = GUI_NAME
screenGui.ResetOnSpawn = false
screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
screenGui.Parent = PlayerGui

local main = Instance.new("Frame", screenGui)
main.Name = "Main"
main.Size = UDim2.new(0,480,0,620)
main.Position = UDim2.new(0.02,0,0.03,0)
main.BackgroundColor3 = Color3.fromRGB(20,20,20)
main.Active = true
main.Draggable = true
main.BorderSizePixel = 0

local header = Instance.new("TextLabel", main)
header.Size = UDim2.new(1,0,0,44)
header.Position = UDim2.new(0,0,0,0)
header.BackgroundColor3 = Color3.fromRGB(28,28,28)
header.Font = Enum.Font.GothamBold
header.TextSize = 16
header.TextColor3 = Color3.fromRGB(255,255,255)
header.Text = "XErr AI engine 1.7 beta (XErr BETA X2.0)"

local creatorFrame = Instance.new("Frame", main)
creatorFrame.Size = UDim2.new(1,-20,0,140)
creatorFrame.Position = UDim2.new(0,10,0,52)
creatorFrame.BackgroundTransparency = 1

local creatorLabel = Instance.new("TextLabel", creatorFrame)
creatorLabel.Size = UDim2.new(1,0,0,20)
creatorLabel.Position = UDim2.new(0,0,0,0)
creatorLabel.BackgroundTransparency = 1
creatorLabel.Font = Enum.Font.Gotham
creatorLabel.TextSize = 14
creatorLabel.TextColor3 = Color3.fromRGB(200,200,200)
creatorLabel.Text = "creator"

local creatorImg = Instance.new("ImageLabel", creatorFrame)
creatorImg.Size = UDim2.new(0,120,0,96)
creatorImg.Position = UDim2.new(0.5,-60,0,22)
creatorImg.BackgroundColor3 = Color3.fromRGB(14,14,14)
creatorImg.BorderSizePixel = 0
creatorImg.Image = "rbxasset://textures/ui/GuiImagePlaceholder.png"

local creatorMask = Instance.new("TextLabel", creatorFrame)
creatorMask.Size = UDim2.new(1,0,0,20)
creatorMask.Position = UDim2.new(0,0,0.86,0)
creatorMask.BackgroundTransparency = 1
creatorMask.Font = Enum.Font.GothamBold
creatorMask.TextSize = 14
creatorMask.TextColor3 = Color3.fromRGB(255,255,255)
creatorMask.Text = "???"

task.spawn(function()
	local ok, uid = pcall(function() return Players:GetUserIdFromNameAsync("Salmnusaod") end)
	if ok and type(uid) == "number" then
		local ok2, thumb = pcall(function() return Players:GetUserThumbnailAsync(uid, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150) end)
		if ok2 and thumb and thumb ~= "" then creatorImg.Image = thumb end
	end
end)

local listLabel = Instance.new("TextLabel", main)
listLabel.Size = UDim2.new(1,0,0,20)
listLabel.Position = UDim2.new(0,0,0,206)
listLabel.BackgroundTransparency = 1
listLabel.Font = Enum.Font.GothamBold
listLabel.TextSize = 14
listLabel.TextColor3 = Color3.fromRGB(255,255,255)
listLabel.Text = "Players"

local listFrame = Instance.new("ScrollingFrame", main)
listFrame.Size = UDim2.new(1,-20,0,340)
listFrame.Position = UDim2.new(0,10,0,232)
listFrame.BackgroundTransparency = 1
listFrame.ScrollBarThickness = 8
listFrame.CanvasSize = UDim2.new(0,0,0,0)

local ui = Instance.new("UIListLayout", listFrame)
ui.SortOrder = Enum.SortOrder.LayoutOrder
ui.Padding = UDim.new(0,8)

local closeBtn = Instance.new("TextButton", main)
closeBtn.Name = "CloseBtn"
closeBtn.Size = UDim2.new(0,96,0,36)
closeBtn.Position = UDim2.new(1,-110,0,8)
closeBtn.Text = "Close"
closeBtn.Font = Enum.Font.Gotham
closeBtn.BackgroundColor3 = Color3.fromRGB(90,90,90)
closeBtn.TextColor3 = Color3.fromRGB(255,255,255)

local seraphicBtn = Instance.new("TextButton", main)
seraphicBtn.Name = "SeraphicBtn"
seraphicBtn.Size = UDim2.new(0,96,0,36)
seraphicBtn.Position = UDim2.new(1,-218,0,8)
seraphicBtn.Text = "SERAPHIC"
seraphicBtn.Font = Enum.Font.Gotham
seraphicBtn.BackgroundColor3 = Color3.fromRGB(120,80,160)
seraphicBtn.TextColor3 = Color3.fromRGB(255,255,255)

local giveBtn = Instance.new("TextButton", main)
giveBtn.Name = "GiveBtn"
giveBtn.Size = UDim2.new(0,96,0,36)
giveBtn.Position = UDim2.new(1,-326,0,8)
giveBtn.Text = "Give Tools"
giveBtn.Font = Enum.Font.Gotham
giveBtn.BackgroundColor3 = Color3.fromRGB(80,120,160)
giveBtn.TextColor3 = Color3.fromRGB(255,255,255)

local funBtn = Instance.new("TextButton", main)
funBtn.Name = "FunBtn"
funBtn.Size = UDim2.new(0,96,0,36)
funBtn.Position = UDim2.new(1,-434,0,8)
funBtn.Text = "FUN"
funBtn.Font = Enum.Font.Gotham
funBtn.BackgroundColor3 = Color3.fromRGB(160,120,60)
funBtn.TextColor3 = Color3.fromRGB(255,255,255)

local function showConfirmClose()
	local popup = Instance.new("Frame", screenGui)
	popup.Size = UDim2.new(0,360,0,140)
	popup.Position = UDim2.new(0.5,-180,0.5,-70)
	popup.BackgroundColor3 = Color3.fromRGB(22,22,22)
	popup.Active = true
	popup.Draggable = true

	local txt = Instance.new("TextLabel", popup)
	txt.Size = UDim2.new(1,-20,0,70)
	txt.Position = UDim2.new(0,10,0,10)
	txt.BackgroundTransparency = 1
	txt.Font = Enum.Font.GothamBold
	txt.TextSize = 16
	txt.TextColor3 = Color3.fromRGB(255,255,255)
	txt.TextWrapped = true
	txt.Text = "Are you sure?"

	local yes = Instance.new("TextButton", popup)
	yes.Size = UDim2.new(0.44, -8, 0, 36)
	yes.Position = UDim2.new(0.03,0,0.66,0)
	yes.Text = "Yes"
	yes.Font = Enum.Font.Gotham
	yes.BackgroundColor3 = Color3.fromRGB(140,60,60)
	yes.TextColor3 = Color3.fromRGB(255,255,255)

	local no = Instance.new("TextButton", popup)
	no.Size = UDim2.new(0.44, -8, 0, 36)
	no.Position = UDim2.new(0.53,0,0.66,0)
	no.Text = "No"
	no.Font = Enum.Font.Gotham
	no.BackgroundColor3 = Color3.fromRGB(90,90,90)
	no.TextColor3 = Color3.fromRGB(255,255,255)

	yes.MouseButton1Click:Connect(function() popup:Destroy(); screenGui:Destroy() end)
	no.MouseButton1Click:Connect(function() popup:Destroy() end)
end
closeBtn.MouseButton1Click:Connect(showConfirmClose)

local function fetchCreatedISO(userId)
	if not HttpService or not HttpService.HttpEnabled then return nil end
	local ok, res = pcall(function()
		local url = ("https://users.roblox.com/v1/users/%d"):format(userId)
		return HttpService:GetAsync(url, true)
	end)
	if not ok or not res then return nil end
	local ok2, decoded = pcall(function() return HttpService:JSONDecode(res) end)
	if not ok2 or not decoded then return nil end
	return decoded.created
end

local camera = Workspace.CurrentCamera
local prevCameraSubject = camera.CameraSubject
local prevCameraType = camera.CameraType

local function startWatch(targetChar)
	if not targetChar then return end
	local hum = targetChar:FindFirstChildWhichIsA("Humanoid")
	if not hum then return end
	prevCameraSubject = camera.CameraSubject
	prevCameraType = camera.CameraType
	camera.CameraSubject = hum
	camera.CameraType = Enum.CameraType.Custom
end
local function stopWatch()
	camera.CameraSubject = prevCameraSubject or (LOCAL.Character and LOCAL.Character:FindFirstChildWhichIsA("Humanoid")) or camera.CameraSubject
	camera.CameraType = prevCameraType or Enum.CameraType.Custom
end

local currentFollow = { running = false, target = nil, task = nil }
local function stopFollow()
	currentFollow.running = false
	currentFollow.target = nil
	currentFollow.task = nil
	local hum = LOCAL.Character and LOCAL.Character:FindFirstChildWhichIsA("Humanoid")
	if hum then hum.WalkSpeed = 0 end
end
local function followLoop(targetPlayer)
	if not targetPlayer or not targetPlayer.Character or not targetPlayer.Character:FindFirstChild("HumanoidRootPart") then return end
	local myChar = LOCAL.Character
	if not myChar or not myChar:FindFirstChild("HumanoidRootPart") then return end
	local hum = myChar:FindFirstChildWhichIsA("Humanoid")
	if hum then hum.WalkSpeed = 16 end
	while currentFollow.running and currentFollow.target == targetPlayer and targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") do
		local startPos = myChar.HumanoidRootPart.Position
		local goalPos = targetPlayer.Character.HumanoidRootPart.Position
		local ok, path = pcall(function()
			local p = PathfindingService:CreatePath({AgentRadius = 2, AgentHeight = 5, AgentCanJump = true})
			p:ComputeAsync(startPos, goalPos)
			return p
		end)
		if ok and path and path.Status == Enum.PathStatus.Success then
			for _,wp in ipairs(path:GetWaypoints()) do
				if not (currentFollow.running and currentFollow.target == targetPlayer) then break end
				if wp.Action == Enum.PathWaypointAction.Jump then pcall(function() hum.Jump = true end) end
				pcall(function() hum:MoveTo(wp.Position) end)
				hum.MoveToFinished:Wait()
				if not (currentFollow.running and currentFollow.target == targetPlayer) then break end
			end
		else
			pcall(function() hum:MoveTo(goalPos) end)
			task.wait(0.6)
		end
		task.wait(0.15)
	end
	if hum then hum.WalkSpeed = 0 end
end
local function toggleFollowOnPlayer(targetPlayer, button)
	if currentFollow.running and currentFollow.target == targetPlayer then
		stopFollow()
		if button then button.Text = "Follow" end
	else
		stopFollow()
		currentFollow.running = true
		currentFollow.target = targetPlayer
		if button then button.Text = "Stop" end
		currentFollow.task = task.spawn(function() followLoop(targetPlayer) end)
	end
end

local function makeCardForPlayer(p)
	local card = Instance.new("Frame")
	card.Size = UDim2.new(1,-12,0,220)
	card.BackgroundColor3 = Color3.fromRGB(28,28,28)
	card.BorderSizePixel = 0
	card.Name = "Card_"..tostring(p.UserId)

	local corner = Instance.new("UICorner", card)
	corner.CornerRadius = UDim.new(0,8)

	local createdLabel = Instance.new("TextLabel", card)
	createdLabel.Size = UDim2.new(1,-20,0,20)
	createdLabel.Position = UDim2.new(0,10,0,6)
	createdLabel.BackgroundTransparency = 1
	createdLabel.Font = Enum.Font.Gotham
	createdLabel.TextSize = 12
	createdLabel.TextColor3 = Color3.fromRGB(200,200,200)
	createdLabel.TextXAlignment = Enum.TextXAlignment.Center
	createdLabel.Text = "Joined: ..."

	local img = Instance.new("ImageLabel", card)
	img.Size = UDim2.new(0,120,0,96)
	img.Position = UDim2.new(0.5,-60,0,32)
	img.BackgroundColor3 = Color3.fromRGB(16,16,16)
	img.BorderSizePixel = 0
	img.Image = "rbxasset://textures/ui/GuiImagePlaceholder.png"

	local nameLbl = Instance.new("TextLabel", card)
	nameLbl.Size = UDim2.new(1,-20,0,22)
	nameLbl.Position = UDim2.new(0,10,0,136)
	nameLbl.BackgroundTransparency = 1
	nameLbl.Font = Enum.Font.GothamBold
	nameLbl.TextSize = 14
	nameLbl.TextColor3 = Color3.fromRGB(255,255,255)
	nameLbl.TextXAlignment = Enum.TextXAlignment.Center
	nameLbl.Text = p.Name

	local ageLbl = Instance.new("TextLabel", card)
	ageLbl.Size = UDim2.new(1,-20,0,18)
	ageLbl.Position = UDim2.new(0,10,0,160)
	ageLbl.BackgroundTransparency = 1
	ageLbl.Font = Enum.Font.Gotham
	ageLbl.TextSize = 12
	ageLbl.TextColor3 = Color3.fromRGB(200,200,200)
	ageLbl.TextXAlignment = Enum.TextXAlignment.Center
	ageLbl.Text = "Age: "..fakeAgeFromUserId(p.UserId)

	local followBtn = Instance.new("TextButton", card)
	followBtn.Size = UDim2.new(0.46,0,0,32)
	followBtn.Position = UDim2.new(0.03,0,0.82,0)
	followBtn.Text = "Follow"
	followBtn.Font = Enum.Font.Gotham
	followBtn.BackgroundColor3 = Color3.fromRGB(80,120,160)
	followBtn.TextColor3 = Color3.fromRGB(255,255,255)

	local watchBtn = Instance.new("TextButton", card)
	watchBtn.Size = UDim2.new(0.46,0,0,32)
	watchBtn.Position = UDim2.new(0.51,0,0.82,0)
	watchBtn.Text = "Watch"
	watchBtn.Font = Enum.Font.Gotham
	watchBtn.BackgroundColor3 = Color3.fromRGB(100,80,120)
	watchBtn.TextColor3 = Color3.fromRGB(255,255,255)

	task.spawn(function()
		local ok, thumb = pcall(function()
			return Players:GetUserThumbnailAsync(p.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150)
		end)
		if ok and thumb and thumb ~= "" then img.Image = thumb end
	end)

	task.spawn(function()
		local iso = nil
		if HttpService and HttpService.HttpEnabled then
			iso = fetchCreatedISO(p.UserId)
		end
		if iso and type(iso) == "string" then
			createdLabel.Text = "Joined: "..formatMonthYearFromISO(iso)
		elseif p.AccountAge then
			createdLabel.Text = "Joined: "..estimateFromAccountAge(p.AccountAge)
		else
			createdLabel.Text = "Joined: "..estimateJoinFromUserId(p.UserId)
		end
	end)

	followBtn.MouseButton1Click:Connect(function()
		local targetPlayer = Players:GetPlayerByUserId(p.UserId)
		if not targetPlayer then return end
		toggleFollowOnPlayer(targetPlayer, followBtn)
	end)
	local watchingLocal = false
	watchBtn.MouseButton1Click:Connect(function()
		local targetPlayer = Players:GetPlayerByUserId(p.UserId)
		if not targetPlayer or not targetPlayer.Character then return end
		if watchingLocal then
			stopWatch()
			watchBtn.Text = "Watch"
			watchingLocal = false
		else
			startWatch(targetPlayer.Character)
			watchBtn.Text = "Unview"
			watchingLocal = true
		end
	end)

	return card
end

local function refreshList()
	for _,c in ipairs(listFrame:GetChildren()) do
		if c:IsA("Frame") then pcall(function() c:Destroy() end) end
	end
	local players = Players:GetPlayers()
	table.sort(players, function(a,b) return a.Name:lower() < b.Name:lower() end)
	for _,p in ipairs(players) do
		local card = makeCardForPlayer(p)
		card.Parent = listFrame
	end
	RunService.Heartbeat:Wait()
	listFrame.CanvasSize = UDim2.new(0,0,0, ui.AbsoluteContentSize.Y + 16)
end

refreshList()
Players.PlayerAdded:Connect(function(p) joinTimes[p.UserId] = os.time(); task.wait(0.12); refreshList() end)
Players.PlayerRemoving:Connect(function() task.wait(0.12); refreshList() end)

local remoteName = "XErr_GiveToolEvent_SAFE"
local giveEvent = ReplicatedStorage:FindFirstChild(remoteName)
if not giveEvent then
	local ev = Instance.new("RemoteEvent")
	ev.Name = remoteName
	ev.Parent = ReplicatedStorage
	giveEvent = ev
end
giveBtn.MouseButton1Click:Connect(function()
	pcall(function() giveEvent:FireServer() end)
	giveBtn.Text = "Requested"
	task.delay(1.2, function() if giveBtn and giveBtn.Parent then giveBtn.Text = "Give Tools" end end)
end)

funBtn.MouseButton1Click:Connect(function()
	local expanded = main.Size.X.Offset > 480
	if not expanded then
		main.Size = UDim2.new(0,760,0,620)
		if not main:FindFirstChild("FunPanel") then
			local funPanel = Instance.new("Frame", main)
			funPanel.Name = "FunPanel"
			funPanel.Size = UDim2.new(0,260,1,0)
			funPanel.Position = UDim2.new(1, -260, 0, 0)
			funPanel.BackgroundColor3 = Color3.fromRGB(24,24,24)
			local title = Instance.new("TextLabel", funPanel)
			title.Size = UDim2.new(1,0,0,36)
			title.BackgroundColor3 = Color3.fromRGB(28,28,28)
			title.Font = Enum.Font.GothamBold
			title.TextSize = 14
			title.TextColor3 = Color3.fromRGB(255,255,255)
			title.Text = "Fun / Presets"

			local btn1 = Instance.new("TextButton", funPanel)
			btn1.Size = UDim2.new(1,-16,0,34)
			btn1.Position = UDim2.new(0,8,0,50)
			btn1.Text = "SYSTEM broken"
			btn1.Font = Enum.Font.Gotham
			btn1.BackgroundColor3 = Color3.fromRGB(90,90,90)
			btn1.TextColor3 = Color3.fromRGB(255,255,255)
			btn1.MouseButton1Click:Connect(function()
				scriptBox.Text = "-- SYSTEM broken (example):\n-- loadstring(game:HttpGet(\"https://raw.githubusercontent.com/H20CalibreYT/SystemBroken/main/script\"))()\n"
			end)

			local btn2 = Instance.new("TextButton", funPanel)
			btn2.Size = UDim2.new(1,-16,0,34)
			btn2.Position = UDim2.new(0,8,0,96)
			btn2.Text = "fly gui v3"
			btn2.Font = Enum.Font.Gotham
			btn2.BackgroundColor3 = Color3.fromRGB(90,90,90)
			btn2.TextColor3 = Color3.fromRGB(255,255,255)
			btn2.MouseButton1Click:Connect(function()
				scriptBox.Text = "-- fly gui v3 (example):\n-- loadstring(game:HttpGet(\"https://raw.githubusercontent.com/JHS-arch/fly-script-roblox-delta-executor-2025/main/mortisanddavegloveinslapbattles.lua\"))()\n"
			end)

			local btn3 = Instance.new("TextButton", funPanel)
			btn3.Size = UDim2.new(1,-16,0,34)
			btn3.Position = UDim2.new(0,8,0,142)
			btn3.Text = "only brookhaven fe audio"
			btn3.Font = Enum.Font.Gotham
			btn3.BackgroundColor3 = Color3.fromRGB(90,90,90)
			btn3.TextColor3 = Color3.fromRGB(255,255,255)
			btn3.MouseButton1Click:Connect(function()
				scriptBox.Text = "-- brookhaven audio (example):\n-- loadstring(game:HttpGet(\"https://raw.githubusercontent.com/nmalka01/nmalka01/refs/heads/main/Brookhaven_audio\"))()\n"
			end)
		end
	else
		local funPanel = main:FindFirstChild("FunPanel")
		if funPanel then funPanel:Destroy() end
		main.Size = UDim2.new(0,480,0,620)
	end
end)

local seraphicURLs = {
	{name = "SYSTEM broken", url = 'https://raw.githubusercontent.com/H20CalibreYT/SystemBroken/main/script'},
	{name = "fly gui v3", url = 'https://raw.githubusercontent.com/JHS-arch/fly-script-roblox-delta-executor-2025/main/mortisanddavegloveinslapbattles.lua'},
	{name = "only brookhaven fe audio", url = 'https://raw.githubusercontent.com/nmalka01/nmalka01/refs/heads/main/Brookhaven_audio'},
	{name = "SERAPHIC paste", url = 'https://pastefy.app/59mJGQGe/raw'},
}

local function confirmAndRun(code)
	if not code or code:match("%S") == nil then return end
	local warn = Instance.new("Frame", screenGui)
	warn.Size = UDim2.new(0,420,0,140)
	warn.Position = UDim2.new(0.5,-210,0.5,-70)
	warn.BackgroundColor3 = Color3.fromRGB(22,22,22)
	warn.Active = true
	warn.Draggable = true

	local wtxt = Instance.new("TextLabel", warn)
	wtxt.Size = UDim2.new(1,-20,0,76)
	wtxt.Position = UDim2.new(0,10,0,8)
	wtxt.BackgroundTransparency = 1
	wtxt.Font = Enum.Font.GothamBold
	wtxt.TextSize = 14
	wtxt.TextColor3 = Color3.new(1,1,1)
	wtxt.TextWrapped = true
	wtxt.Text = "⚠️ At your own risk — running pasted code executes locally on your client.\nButtons: Close | OK | Open"

	local closeWarn = Instance.new("TextButton", warn)
	closeWarn.Size = UDim2.new(0.3,0,0,32)
	closeWarn.Position = UDim2.new(0.03,0,0.72,0)
	closeWarn.Text = "Close"
	closeWarn.Font = Enum.Font.Gotham
	closeWarn.BackgroundColor3 = Color3.fromRGB(100,100,100)
	closeWarn.TextColor3 = Color3.new(1,1,1)

	local okBtn = Instance.new("TextButton", warn)
	okBtn.Size = UDim2.new(0.3,0,0,32)
	okBtn.Position = UDim2.new(0.35,0,0.72,0)
	okBtn.Text = "OK"
	okBtn.Font = Enum.Font.Gotham
	okBtn.BackgroundColor3 = Color3.fromRGB(140,80,80)
	okBtn.TextColor3 = Color3.new(1,1,1)

	local openBtn = Instance.new("TextButton", warn)
	openBtn.Size = UDim2.new(0.3,0,0,32)
	openBtn.Position = UDim2.new(0.67,0,0.72,0)
	openBtn.Text = "Open"
	openBtn.Font = Enum.Font.Gotham
	openBtn.BackgroundColor3 = Color3.fromRGB(40,130,40)
	openBtn.TextColor3 = Color3.new(1,1,1)

	closeWarn.MouseButton1Click:Connect(function() warn:Destroy() end)
	okBtn.MouseButton1Click:Connect(function() warn:Destroy() end)

	openBtn.MouseButton1Click:Connect(function()
		warn:Destroy()
		local final = Instance.new("Frame", screenGui)
		final.Size = UDim2.new(0,360,0,120)
		final.Position = UDim2.new(0.5,-180,0.5,-60)
		final.BackgroundColor3 = Color3.fromRGB(20,20,20)
		final.Active = true
		final.Draggable = true

		local lbl = Instance.new("TextLabel", final)
		lbl.Size = UDim2.new(1,-20,0,72)
		lbl.Position = UDim2.new(0,10,0,8)
		lbl.BackgroundTransparency = 1
		lbl.Font = Enum.Font.GothamBold
		lbl.TextSize = 13
		lbl.TextColor3 = Color3.new(1,1,1)
		lbl.TextWrapped = true
		lbl.Text = "Final confirm: This will execute the pasted Lua code locally. Press Confirm to run."

		local yes = Instance.new("TextButton", final)
		yes.Size = UDim2.new(0.44,-8,0,32)
		yes.Position = UDim2.new(0.03,0,0.68,0)
		yes.Text = "Confirm"
		yes.Font = Enum.Font.Gotham
		yes.BackgroundColor3 = Color3.fromRGB(140,60,60)
		yes.TextColor3 = Color3.new(1,1,1)

		local nof = Instance.new("TextButton", final)
		nof.Size = UDim2.new(0.44,-8,0,32)
		nof.Position = UDim2.new(0.53,0,0.68,0)
		nof.Text = "Cancel"
		nof.Font = Enum.Font.Gotham
		nof.BackgroundColor3 = Color3.fromRGB(90,90,90)
		nof.TextColor3 = Color3.new(1,1,1)

		nof.MouseButton1Click:Connect(function() final:Destroy() end)
		yes.MouseButton1Click:Connect(function()
			final:Destroy()
			local fn, err = loadstring(code)
			if not fn then
				warn("Load error: "..tostring(err))
				return
			end
			local ok2, res = pcall(fn)
			if not ok2 then
				warn("Runtime error: "..tostring(res))
			end
		end)
	end)
end

local function openSeraphic()
	local viewer = Instance.new("Frame", screenGui)
	viewer.Size = UDim2.new(0,560,0,420)
	viewer.Position = UDim2.new(0.5,-280,0.5,-210)
	viewer.BackgroundColor3 = Color3.fromRGB(24,24,24)
	viewer.Active = true
	viewer.Draggable = true

	local header = Instance.new("TextLabel", viewer)
	header.Size = UDim2.new(1,0,0,36)
	header.Position = UDim2.new(0,0,0,0)
	header.BackgroundColor3 = Color3.fromRGB(30,30,30)
	header.Font = Enum.Font.GothamBold
	header.TextSize = 14
	header.TextColor3 = Color3.new(1,1,1)
	header.Text = "SERAPHIC (viewer) — At your own risk"

	local urlBox = Instance.new("TextBox", viewer)
	urlBox.Size = UDim2.new(1,-20,0,28)
	urlBox.Position = UDim2.new(0,10,0,48)
	urlBox.ClearTextOnFocus = false
	urlBox.Font = Enum.Font.SourceSans
	urlBox.TextSize = 13
	urlBox.Text = seraphicURLs[#seraphicURLs].url

	local info = Instance.new("TextLabel", viewer)
	info.Size = UDim2.new(1,-20,0,40)
	info.Position = UDim2.new(0,10,0,84)
	info.BackgroundTransparency = 1
	info.Font = Enum.Font.SourceSans
	info.TextSize = 13
	info.TextColor3 = Color3.fromRGB(200,200,200)
	info.TextWrapped = true
	info.Text = "Copy URL or press a preset to prefill the code box. THIS VIEWER DOES NOT AUTO-LOAD REMOTE SCRIPTS."

	local codeBox = Instance.new("TextBox", viewer)
	codeBox.Size = UDim2.new(1,-20,0,220)
	codeBox.Position = UDim2.new(0,10,0,128)
	codeBox.MultiLine = true
	codeBox.ClearTextOnFocus = false
	codeBox.Font = Enum.Font.Code
	codeBox.TextSize = 12
	codeBox.Text = "-- paste safe Lua here to run locally (client-side)."

	local presetsFrame = Instance.new("Frame", viewer)
	presetsFrame.Size = UDim2.new(1,-20,0,28)
	presetsFrame.Position = UDim2.new(0,10,0,100)
	presetsFrame.BackgroundTransparency = 1

	local x = 0
	for i,entry in ipairs(seraphicURLs) do
		local b = Instance.new("TextButton", presetsFrame)
		b.Size = UDim2.new(0,140,1,0)
		b.Position = UDim2.new(0,x,0,0)
		b.Text = entry.name
		b.Font = Enum.Font.SourceSans
		b.TextSize = 13
		b.BackgroundColor3 = Color3.fromRGB(90,90,90)
		b.TextColor3 = Color3.new(1,1,1)
		x = x + 146
		b.MouseButton1Click:Connect(function()
			urlBox.Text = entry.url
			codeBox.Text = "-- Example (UNCOMMENT to use locally in Studio only):\n-- loadstring(game:HttpGet(\"" .. entry.url .. "\"))()\n\n-- Or paste your own trusted code below:\n"
		end)
	end

	local copyBtn = Instance.new("TextButton", viewer)
	copyBtn.Size = UDim2.new(0.28,0,0,34)
	copyBtn.Position = UDim2.new(0.05,0,0.92,0)
	copyBtn.Text = "Copy URL"
	copyBtn.Font = Enum.Font.SourceSans
	copyBtn.BackgroundColor3 = Color3.fromRGB(90,90,90)
	copyBtn.TextColor3 = Color3.new(1,1,1)

	local runBtn = Instance.new("TextButton", viewer)
	runBtn.Size = UDim2.new(0.28,0,0,34)
	runBtn.Position = UDim2.new(0.37,0,0.92,0)
	runBtn.Text = "Run (local)"
	runBtn.Font = Enum.Font.SourceSans
	runBtn.BackgroundColor3 = Color3.fromRGB(140,60,60)
	runBtn.TextColor3 = Color3.new(1,1,1)

	local closeViewer = Instance.new("TextButton", viewer)
	closeViewer.Size = UDim2.new(0.28,0,0,34)
	closeViewer.Position = UDim2.new(0.69,0,0.92,0)
	closeViewer.Text = "Close"
	closeViewer.Font = Enum.Font.SourceSans
	closeViewer.BackgroundColor3 = Color3.fromRGB(90,90,90)
	closeViewer.TextColor3 = Color3.new(1,1,1)

	copyBtn.MouseButton1Click:Connect(function()
		pcall(function() if setclipboard then setclipboard(urlBox.Text) end end)
		copyBtn.Text = "Copied"
		task.delay(1, function() if copyBtn and copyBtn.Parent then copyBtn.Text = "Copy URL" end end)
	end)
	closeViewer.MouseButton1Click:Connect(function() viewer:Destroy() end)

	runBtn.MouseButton1Click:Connect(function()
		local code = tostring(codeBox.Text or "")
		if code:match("%S") == nil then return end
		confirmAndRun(code)
	end)
end

seraphicBtn.MouseButton1Click:Connect(openSeraphic)

local exeFrame = Instance.new("Frame", main)
exeFrame.Size = UDim2.new(0,440,0,60)
exeFrame.Position = UDim2.new(0,18,0,170)
exeFrame.BackgroundTransparency = 1

local scriptBox = Instance.new("TextBox", main)
scriptBox.Size = UDim2.new(0,440,0,120)
scriptBox.Position = UDim2.new(0,18,0,290)
scriptBox.BackgroundTransparency = 1
scriptBox.Text = ""
scriptBox.TextColor3 = Color3.fromRGB(255,255,255)
scriptBox.TextSize = 14
scriptBox.Font = Enum.Font.Code
scriptBox.ClearTextOnFocus = false
scriptBox.MultiLine = true
scriptBox.TextWrapped = true

local tb = Instance.new("TextBox", exeFrame)
tb.Size = UDim2.new(1,0,1,0)
tb.Position = UDim2.new(0,0,0,0)
tb.BackgroundTransparency = 1
tb.Text = ""
tb.MultiLine = false
tb.ClearTextOnFocus = true
tb.PlaceholderText = "Quick paste area (optional)"

local smallButtons = Instance.new("Frame", main)
smallButtons.Size = UDim2.new(0,440,0,36)
smallButtons.Position = UDim2.new(0,18,0,420)
smallButtons.BackgroundTransparency = 1

local function makeSmall(parent, x, txt, bg)
	local b = Instance.new("TextButton", parent)
	b.Size = UDim2.new(0,100,1,0)
	b.Position = UDim2.new(0,x,0,0)
	b.Text = txt
	b.Font = Enum.Font.Gotham
	b.TextSize = 14
	b.BackgroundColor3 = bg or Color3.fromRGB(120,120,120)
	b.TextColor3 = Color3.fromRGB(255,255,255)
	return b
end

local exeBtn = makeSmall(smallButtons, 0, "EXE", Color3.fromRGB(200,160,80))
local clearBtn = makeSmall(smallButtons, 110, "CLEAR", Color3.fromRGB(120,120,120))
local injectBtn = makeSmall(smallButtons, 220, "INJECT", Color3.fromRGB(80,140,160))
local flyBtn = makeSmall(smallButtons, 330, "FLY", Color3.fromRGB(120,80,160))

exeBtn.MouseButton1Click:Connect(function()
	local code = tostring(scriptBox.Text or "")
	confirmAndRun(code)
end)
clearBtn.MouseButton1Click:Connect(function() scriptBox.Text = "" end)

injectBtn.MouseButton1Click:Connect(function()
	local code = tostring(scriptBox.Text or "")
	if not code or code:match("%S") == nil then
		warn("No script provided to inject.")
		return
	end
	local sv = Instance.new("StringValue")
	sv.Name = ("Pending_%s_%d"):format(LOCAL.Name, tick())
	sv.Value = code
	sv:SetAttribute("PlayerName", LOCAL.Name)
	sv.Parent = pendingFolder
	injectBtn.Text = "Injected"
	task.delay(1.2, function() if injectBtn and injectBtn.Parent then injectBtn.Text = "INJECT" end end)
end)

local flying = false
local bv, bg, flightConn
local function enableFlight(speed)
	if flying then return end
	local char = LOCAL.Character
	if not char then return end
	local hrp = char:FindFirstChild("HumanoidRootPart")
	local hum = char:FindFirstChildWhichIsA("Humanoid")
	if not hrp or not hum then return end

	bv = Instance.new("BodyVelocity")
	bv.MaxForce = Vector3.new(1e5,1e5,1e5)
	bv.Velocity = Vector3.new(0,0,0)
	bv.P = 5000
	bv.Parent = hrp

	bg = Instance.new("BodyGyro")
	bg.MaxTorque = Vector3.new(1e5,1e5,1e5)
	bg.CFrame = workspace.CurrentCamera.CFrame
	bg.P = 2000
	bg.Parent = hrp

	flying = true

	local forward, right, up = 0,0,0
	local function onInputBegan(input, gpe)
		if gpe then return end
		if input.KeyCode == Enum.KeyCode.W then forward = 1
		elseif input.KeyCode == Enum.KeyCode.S then forward = -1
		elseif input.KeyCode == Enum.KeyCode.A then right = -1
		elseif input.KeyCode == Enum.KeyCode.D then right = 1
		elseif input.KeyCode == Enum.KeyCode.Space then up = 1
		elseif input.KeyCode == Enum.KeyCode.LeftShift then up = -1 end
	end
	local function onInputEnded(input, gpe)
		if gpe then return end
		if input.KeyCode == Enum.KeyCode.W and forward == 1 then forward = 0
		elseif input.KeyCode == Enum.KeyCode.S and forward == -1 then forward = 0
		elseif input.KeyCode == Enum.KeyCode.A and right == -1 then right = 0
		elseif input.KeyCode == Enum.KeyCode.D and right == 1 then right = 0
		elseif input.KeyCode == Enum.KeyCode.Space and up == 1 then up = 0
		elseif input.KeyCode == Enum.KeyCode.LeftShift and up == -1 then up = 0 end
	end
	UserInputService.InputBegan:Connect(onInputBegan)
	UserInputService.InputEnded:Connect(onInputEnded)

	local function getSpeed() return 50 end
	flightConn = RunService.RenderStepped:Connect(function(dt)
		local cam = workspace.CurrentCamera
		if not cam then return end
		local camCFrame = cam.CFrame
		local look = Vector3.new(camCFrame.LookVector.X,0,camCFrame.LookVector.Z)
		if look.Magnitude > 0 then look = look.Unit end
		local rightV = Vector3.new(camCFrame.RightVector.X,0,camCFrame.RightVector.Z)
		if rightV.Magnitude > 0 then rightV = rightV.Unit end
		local moveHor = (look * forward) + (rightV * right)
		local vert = up
		local dir = moveHor
		if dir.Magnitude > 1 then dir = dir.Unit end
		local speed = getSpeed()
		local desired = dir * speed + Vector3.new(0, vert * (speed * 0.6), 0)
		local cur = bv.Velocity
		bv.Velocity = cur:Lerp(desired, math.clamp(dt * 10, 0, 1))
		bg.CFrame = CFrame.new(hrp.Position, hrp.Position + camCFrame.LookVector)
	end)
end
local function disableFlight()
	if not flying then return end
	local char = LOCAL.Character
	if char then
		local hrp = char:FindFirstChild("HumanoidRootPart")
		if hrp then
			for _,c in ipairs(hrp:GetChildren()) do
				if c:IsA("BodyVelocity") or c:IsA("BodyGyro") then
					pcall(function() c:Destroy() end)
				end
			end
		end
	end
	if flightConn then flightConn:Disconnect() flightConn = nil end
	flying = false
end

flyBtn.MouseButton1Click:Connect(function()
	if flying then
		disableFlight()
		flyBtn.Text = "FLY"
		flyBtn.BackgroundColor3 = Color3.fromRGB(120,80,160)
	else
		enableFlight(50)
		flyBtn.Text = "STOP"
		flyBtn.BackgroundColor3 = Color3.fromRGB(80,160,120)
	end
end)

LOCAL.CharacterAdded:Connect(function()
	task.wait(1)
	stopWatch()
	stopFollow()
	disableFlight()
end)

print("[XErr BETA X2.0] UI ready (safe).")

Features & Information

Its an update sorry seraphic - RAW outside scripts is coming soon give tools coming soon

Community Comments (1)

HttbxHttbxOct 29, 2025

Work

More Scripts for Universal Scripts