return function(C)local h,g,r local function I(C,g,r)local I=Instance.new(C)I.Name=g I.Parent=r or h return I end h=script.Parent.CmdrClient h.Parent=ReplicatedStorage g=I("\082\101\109\111\116\101\070\117\110\099\116\105\111\110","\067\109\100\114\070\117\110\099\116\105\111\110")r=I("\082\101\109\111\116\101\069\118\101\110\116","\067\109\100\114\069\118\101\110\116")I("\070\111\108\100\101\114","\067\111\109\109\097\110\100\115")I("\070\111\108\100\101\114","\084\121\112\101\115")script.Parent.Shared.Parent=h C.ReplicatedRoot=h C.RemoteFunction=g C.RemoteEvent=r C:RegisterTypesIn(script.Parent.BuiltInTypes)script.Parent.BuiltInTypes:Destroy()script.Parent.BuiltInCommands.Name="\083\101\114\118\101\114 \099\111\109\109\097\110\100\115"if StarterGui:FindFirstChild("\067\109\100\114")==nil then CreateGui()end end
--- Handles initial preparation of the game server-side.
return function(cmdr)
	local ReplicatedRoot, RemoteFunction, RemoteEvent

	local function Create(class, name, parent)
		local object = Instance.new(class)
		object.Name = name
		object.Parent = parent or ReplicatedRoot

		return object
	end

	ReplicatedRoot = script.Parent.CmdrClient
	ReplicatedRoot.Parent = ReplicatedStorage

	RemoteFunction = Create("RemoteFunction", "CmdrFunction")
	RemoteEvent = Create("RemoteEvent", "CmdrEvent")

	Create("Folder", "Commands")
	Create("Folder", "Types")

	script.Parent.Shared.Parent = ReplicatedRoot

	cmdr.ReplicatedRoot = ReplicatedRoot
	cmdr.RemoteFunction = RemoteFunction
	cmdr.RemoteEvent = RemoteEvent

	cmdr:RegisterTypesIn(script.Parent.BuiltInTypes)

	script.Parent.BuiltInTypes:Destroy()
	script.Parent.BuiltInCommands.Name = "Server commands"

	if StarterGui:FindFirstChild("Cmdr") == nil then
		CreateGui()
	end
end
