1
0
Files
mirrorhack/scripts/loader.lua
T
2026-08-01 01:53:42 +00:00

71 lines
3.0 KiB
Lua

--[[
_ _ _
__ | |___ _ __ __| |__ _ ___ __ _ __ _(_) ___ __ _
\ \| |__ \| '_ \ / _` |__` |/ _ |__` |__` | |/ _ ' _` |
> |__) | |_) | | | | | | (_) | | | | | | | | | | |
/_/|_|___/|_.__/|_| |_| |_|\___/ |_| |_|_|_| |_| |_|
mirrorhack | loader
]]
-- > variables
local local_player = game:GetService("Players").LocalPlayer
local functions = {}
-- > functions
functions.functions = function()
local missing = {}
for _, name in ipairs({"loadstring","getgenv","getrenv","getgc","newcclosure","hookfunction","hookmetamethod","getnamecallmethod","gethui","getcustomasset","setfflag","readfile","writefile","isfile","isfolder","makefolder","listfiles","delfile"}) do
if type(getfenv()[name]) ~= "function" then table.insert(missing, name) end
end
if not (game.HttpGet or game.HttpGetAsync) then table.insert(missing, "game:HttpGet") end
if #missing > 0 then local_player:Kick("executor is missing: " .. table.concat(missing, ", ")) return false end
return true
end
functions.actors = function()
if type(run_on_actor) ~= "function" then local_player:Kick("executor is missing: run_on_actor") return false end
local actor = local_player:FindFirstChildWhichIsA("Actor", true)
if not actor then local_player:Kick("executor is not supported: no actor found on character") return false end
local relay = Instance.new("Configuration", workspace)
relay.Name = "mh_actor_test"
local sent = pcall(run_on_actor, actor, [[
pcall(task.synchronize)
pcall(function() workspace.mh_actor_test:SetAttribute("ok", type(hookfunction) == "function") end)
]])
if not sent then relay:Destroy() local_player:Kick("executor is missing: run_on_actor") return false end
local ok, done = nil, false
relay:GetAttributeChangedSignal("ok"):Once(function() ok = relay:GetAttribute("ok") done = true end)
task.delay(3, function() done = true end)
repeat task.wait() until done
relay:Destroy()
if not ok then local_player:Kick("executor is missing: run_on_actor") return false end
return true
end
functions.load = function(file)
local success, src = pcall(game.HttpGet, game, "https://git.nfa.re/tul/mirrorhack/raw/branch/main/games/" .. file)
if not success or not src or #src == 0 then local_player:Kick("failed to fetch " .. file) return end
loadstring(src)()
end
-- > redirect
do
if game.GameId == 4827308727 then
if not functions.functions() then return end
functions.load("havoc.lua")
elseif game.GameId == 5091490171 then
if not functions.functions() then return end
functions.load("jailbird.lua")
elseif game.GameId == 8307114974 then
if not functions.functions() then return end
if not functions.actors() then return end
functions.load("operation-one.lua")
else
local_player:Kick("mirrorhack does not support this game")
end
end