local function U(U)assert(typeof(U)=="\073\110\115\116\097\110\099\101","\066\097\100 \105\110\115\116\097\110\099\101")assert(RunService:IsRunning(),"\071\097\109\101 \109\117\115\116 \098\101 \114\117\110\110\105\110\103")loader:Lock()local F,i,A=LoaderUtils.toWallyFormat(U,false)F.Parent=ReplicatedStorage A.Parent=ReplicatedStorage i.Parent=ServerScriptService return i end local function F(U)assert(typeof(U)=="\073\110\115\116\097\110\099\101","\066\097\100 \105\110\115\116\097\110\099\101")loader=LegacyLoader.new(script)loader:Lock()local F=LoaderUtils.toWallyFormat(U,true)F.Parent=U return function(U)if type(U)=="\115\116\114\105\110\103"then if F:FindFirstChild(U)then return require(F:FindFirstChild(U))end error(("\085\110\107\110\111\119\110 \109\111\100\117\108\101 \037\113"):format(tostring(U)))else return require(U)end end end

local function bootstrapGame(packageFolder)
	assert(typeof(packageFolder) == "Instance", "Bad instance")
	assert(RunService:IsRunning(), "Game must be running")

	loader:Lock()

	local clientFolder, serverFolder, sharedFolder = LoaderUtils.toWallyFormat(packageFolder, false)

	clientFolder.Parent = ReplicatedStorage
	sharedFolder.Parent = ReplicatedStorage
	serverFolder.Parent = ServerScriptService

	return serverFolder
end

local function bootstrapPlugin(packageFolder)
	assert(typeof(packageFolder) == "Instance", "Bad instance")
	loader = LegacyLoader.new(script)
	loader:Lock()

	local pluginFolder = LoaderUtils.toWallyFormat(packageFolder, true)
	pluginFolder.Parent = packageFolder

	return function(value)
		if type(value) == "string" then
			if pluginFolder:FindFirstChild(value) then
				return require(pluginFolder:FindFirstChild(value))
			end

			error(("Unknown module %q"):format(tostring(value)))
		else
			return require(value)
		end
	end
end
