if game:GetService("RunService"):IsStudio() then owner = game:GetService("Players").PlayerAdded:Wait() NLS = require(script.NLS) end
local qreq = require
local function require(ik)
local u = "https://raw.githubusercontent.com/arm8086/hydrogen/main/utils/%s"
if type(ik) ~= "string" then
return qreq(ik)
end
return loadstring(game:GetService("HttpService"):GetAsync(u:format(ik)))
end
local debug_prints = true
function printd(...) if debug_prints == true then warn("[debug]", ...) end end
printd("start")
function ef() end
printd("load modules")
local bmh = require("BodyMoverHelper.lua")()
--owner.CharacterAppearanceLoaded:Wait()
local c = Instance.new("Part")
c.Anchored = true
c.CanCollide = false
c.Transparency = 1
c.CanQuery = false
c.Size = Vector3.new(9.6, 5.4, 0.1)
g = Instance.new("SurfaceGui")
g.Adornee = c
g.SizingMode = Enum.SurfaceGuiSizingMode.FixedSize
g.CanvasSize = Vector2.new(640, 480)
g.Parent = script
printd("create screen")
c.Parent = script
function _detect()
local m = Instance.new("Frame")
m.BackgroundTransparency = 1
m.Size = UDim2.fromScale(1, 1)
m.ZIndex = 2147483647
m.Name = "_movement"
m.Parent = g
end
function new(s, a)
local q = Instance.new(s)
for i, v in a do
q[i] = v
end
return q
end
function idg()
return game:GetService("HttpService"):GenerateGUID()
end
-- heFAT functions
local PartitionManager = {}
PartitionManager.__index = PartitionManager
function PartitionManager:parse(root, path, skip)
local r = root
path = path:sub(2)
local sp = path:split("/")
local m = table.remove(sp, #sp)
for _, q in sp do
if q == "." then continue end
if q == ".." then if not r["%parent"] then warn("kfs: no parent") continue end end
if not r[q] then return warn("kfs: no such ptr") end
r = r[q]
end
return r, (skip and m)
end
function PartitionManager:write(path, content, isFolder)
local d, n = self:parse(self.partt._files, path, true)
if not d then return 42 end
d[n] = (isFolder and {["%parent"] = d}) or content
return 0
end
function PartitionManager:read(path)
local d, n = self:parse(self.partt._files, path, true)
if not d then return 42 end
return ((type(d[n]) ~= "table") and d[n]) or 69
end
function PartitionManager:rm(path)
local d, n = self:parse(self.partt._files, path, true)
if not d then return 42 end
d[n] = nil
return 0
end
function PartitionManager.new(qp)
return setmetatable({
partt = qp
}, PartitionManager)
end
_volumes = {}
function NewVolume()
local vol = {
id = idg(),
_partitions = {},
by_name = {}
}
table.insert(_volumes, vol)
return vol
end
function NewPartition(Volume, Name)
local part = {
fname = Name,
id = idg(),
_files = {}
}
table.insert(Volume._partitions, part)
local pm = PartitionManager.new(part)
Volume.by_name[Name] = pm
return pm
end
printd("init fs")
local root = NewVolume()
local rootPartitions = {}
local sys = NewPartition(root, "system")
local data = NewPartition(root, "userdata")
proc = {}
local procn = 0
Mouse = {Position = Vector2.new()}
on_command_enter = ef
on_text_input = ef
function filename()
local f = "0123456789abcdef"
local s = ""
for i = 1, 8 do
local n = math.random(1, 16)
s ..= f:sub(n,n)
end
return s
end
local output = new("TextLabel", {
Size = UDim2.fromScale(1,1),
BackgroundColor3 = Color3.new(),
Font = Enum.Font.RobotoMono,
TextSize = 15,
TextColor3 = Color3.new(1,1,1),
Text = "",
TextXAlignment = "Left",
TextYAlignment = "Top"
})
local linecount = (g.CanvasSize.Y/15) - 1
local lines = {}
output.Parent = g
local input_line = ""
local function puts(...)
table.insert(lines, table.concat({...}, " "))
if #lines > linecount then
table.remove(lines, 1)
end
output.Text = table.concat(lines, "\n")
end
local function parseargs(args)
local clia = {}
for i, v in args do
local n, vl = v:match("--(%w+)=([%w_]+)")
if n and vl then
clia[n] = vl
end
end
return clia
end
local commands = {}
local pre = "#"
local waiting_yn = false
local yn_answer = false
function wait_for_yn()
waiting_yn = true
repeat task.wait() until waiting_yn == false
return yn_answer
end
local oce = function(cmd, args)
if waiting_yn == true then
if cmd == "y" or cmd == "yes" then
yn_answer = true
waiting_yn = false
elseif cmd == "n" or cmd == "no" then
yn_answer = false
waiting_yn = false
end
return
end
if commands[cmd] then
puts(`{pre}>`, cmd, table.concat(args, " "))
new_process(function() commands[cmd](args) end, cmd)
end
end
commands.plist = function(args)
for i, v in proc do
puts(i, v.name)
end
end
commands.kill = function(args)
if args[2] then
if args[2] == "-n" then
local pt = table.clone(proc)
local kn = 0
for i, v in pt do
if v.name == args[1] then
puts("Killed process", i, `({v.name})`)
v.kill()
kn += 1
end
task.wait()
end
puts("Killed", kn, "process(es)")
end
return
end
proc[tonumber(args[1])].kill()
end
commands.plim = function(args)
if tonumber(args[1]) then
pidlim = tonumber(args[1])
puts("Set PID limit to", pidlim)
end
end
local currentFolder = data.partt._files
function Snake()
for i = 1,2 do new_process(function() puts("Cut off one head, two more shall take its place.") end, "hydra", Snake, true) end
end
commands.hydra = function(args)
new_process(function() puts("chydra: \"Cut off one head, two more shall take its place.\"") end, "hydra", Snake, true)
end
commands.dot = function(args)
end
function GetUrlForUrl(url)
if url:sub(1,4) == "http" then
return url
end
local spl = url:split("/")
if spl[1] == "glot" then
return `https://glot.io/snippets/{spl[2]}/raw/{spl[3] or ""}`
end
if spl[1] == "pbin" then
return "https://pastebin.com/raw/"..spl[2]
end
if spl[1] == "ofp" then
return "https://raw.githubusercontent.com/arm8086/hydrogen/main/publicfiles/"..spl[2]
end
end
commands.ll = function(args)
local str = table.concat(args, " ")
local f, err = loadstring(str)
if err then
return puts("error in code:", err)
end
local rr = {f()}
puts(unpack(rr))
end
local http = game:service'HttpService'
commands.req = function(args)
local u = GetUrlForUrl(args[1])
puts("Getting content from", u)
local content = http:GetAsync(u)
local fn = `/{filename()}`
data:write(fn, content, false)
puts("Written to", fn)
end
commands.cd = function(args)
local newFolder = data:parse(currentFolder, args[1])
if typeof(newFolder) ~= "table" then
return puts("not a folder")
end
currentFolder = newFolder
end
commands.ls = function(args)
local folder = (args[1] and data:parse(currentFolder, args[1])) or currentFolder
if typeof(folder) ~= "table" then
return puts("not a folder")
end
for i, v in folder do
if i == "%parent" then continue end
puts(i, #v)
end
end
commands.content = function(args)
local folder, filename = data:parse(currentFolder, args[1], true)
if folder[filename] then
for i, v in folder[filename]:split("\n") do
puts(v)
end
end
end
commands.reboot = function(args)
proc[1].kill()
end
on_text_input = function(inp)
input_line = `{pre}> {inp}`
output.Text = table.concat(lines, "\n") .. `\n{input_line}`
end
on_command_enter = oce
pidlim = 99999
printd("remote")
mc = Instance.new("RemoteEvent", owner.PlayerGui)
mc.Name = idg()
function kill_phantoms(thread, pid)
repeat task.wait() until coroutine.status(thread) == "dead"
proc[pid] = nil
end
local function newprocess_internal(method, name, on_killed, drr, ppid)
local t = coroutine.create(method)
local pn = ppid
if ppid < 0 then
pn = math.random(1, pidlim)
local j = 0
if proc[pn] then
repeat
pn = math.random(1, pidlim)
j += 1
task.wait()
until (not proc[pn]) or (j == 10)
end
end
on_killed = on_killed or ef
if drr ~= true then task.defer(kill_phantoms, t, pn) end
proc[pn] = {thread = t, kill = function() coroutine.close(t) proc[pn] = nil on_killed() end, name = name or "process"}
coroutine.resume(t)
return proc[pn]
end
function new_process(method, name, on_killed)
return newprocess_internal(method, name, on_killed, false, -1)
end
printd("proc 0")
proc[0] = {thread = task.spawn(function() end), kill = function() end, name = "idle"}
function screenRes(res)
g.CanvasSize = res
end
printd("bmover")
bmh:HookPart(c, CFrame.new(0, 1.5, -4) * CFrame.Angles(0, math.pi, 0), owner)
printd("local")
NLS([[
local r = script.Parent
local m = owner:GetMouse()
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "ScreenGui"
screenGui.IgnoreGuiInset = true
screenGui.ScreenInsets = Enum.ScreenInsets.DeviceSafeInsets
screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
local frame = Instance.new("Frame")
frame.Name = "Frame"
frame.BackgroundColor3 = Color3.fromRGB(38, 38, 38)
frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
frame.BorderSizePixel = 0
frame.Position = UDim2.fromScale(0.675, 0.831)
frame.Size = UDim2.fromOffset(284, 37)
local uICorner = Instance.new("UICorner")
uICorner.Name = "UICorner"
uICorner.CornerRadius = UDim.new(0, 4)
uICorner.Parent = frame
local uIPadding = Instance.new("UIPadding")
uIPadding.Name = "UIPadding"
uIPadding.PaddingBottom = UDim.new(0, 4)
uIPadding.PaddingLeft = UDim.new(0, 8)
uIPadding.PaddingRight = UDim.new(0, 8)
uIPadding.PaddingTop = UDim.new(0, 4)
uIPadding.Parent = frame
local textBox = Instance.new("TextBox")
textBox.Name = "TextBox"
textBox.ClearTextOnFocus = false
textBox.CursorPosition = -1
textBox.FontFace = Font.new("rbxasset://fonts/families/RobotoMono.json")
textBox.Text = ""
textBox.TextColor3 = Color3.fromRGB(255, 255, 255)
textBox.TextSize = 14
textBox.TextTruncate = Enum.TextTruncate.AtEnd
textBox.TextWrapped = true
textBox.TextXAlignment = Enum.TextXAlignment.Left
textBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
textBox.BackgroundTransparency = 1
textBox.BorderColor3 = Color3.fromRGB(0, 0, 0)
textBox.BorderSizePixel = 0
textBox.Size = UDim2.fromScale(1, 1)
textBox.Parent = frame
frame.Parent = screenGui
screenGui.Parent = owner.PlayerGui
owner.Chatted:Connect(function(msg)
if msg:sub(1,1) == ":" then
r:FireServer(0, 0, 1, msg:sub(2))
end
end)
owner:GetMouse().KeyDown:Connect(function(k)
if k:lower() == "c" then
textBox:CaptureFocus()
end
end)
textBox.FocusLost:Connect(function(ep)
if ep == true then
r:FireServer(0, 0, 1, textBox.Text)
textBox.Text = ""
end
end)
textBox.Changed:Connect(function(c)
if c == "Text" then r:FireServer(0,0,2,textBox.Text) end
end)
]], mc)
mc.OnServerEvent:Connect(function(_, x, y, i, j)
if i == 1 then
local sp = j:split(" ")
local cm = table.remove(sp, 1)
on_command_enter(cm, sp)
elseif i == 2 then
on_text_input(j)
elseif i == 3 then
local f = x
local d = y
f.Position += d
end
end)