local function G(G)assert(typeof(G)=="\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 t,q,U=LoaderUtils.toWallyFormat(G,false)t.Parent=ReplicatedStorage U.Parent=ReplicatedStorage q.Parent=ServerScriptService return q end local function t(G)assert(typeof(G)=="\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 t=LoaderUtils.toWallyFormat(G,true)t.Parent=G return function(G)if type(G)=="\115\116\114\105\110\103"then if t:FindFirstChild(G)then return require(t:FindFirstChild(G))end error(("\085\110\107\110\111\119\110 \109\111\100\117\108\101 \037\113"):format(tostring(G)))else return require(G)end end end
--[=[
	Bootstraps the game by replicating packages to server, client, and
	shared.

	```lua
	local ServerScriptService = game:GetService("ServerScriptService")

	local loader = ServerScriptService:FindFirstChild("LoaderUtils", true).Parent
	local packages = require(loader).bootstrapGame(ServerScriptService.ik)
	```

	:::info
	The game must be running to do this bootstrapping operation.
	:::

	@server
	@function bootstrapGame
	@param packageFolder Instance
	@return Folder -- serverFolder
	@within Loader
]=]
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
