local G=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local r=game:GetService("\083\116\097\114\116\101\114\071\117\105")local m=require(script.Parent.CreateGui)return function(U)local u,b,i local function h(G,r,m)local U=Instance.new(G)U.Name=r U.Parent=m or u return U end u=script.Parent.CmdrClient u.Parent=G b=h("\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")i=h("\082\101\109\111\116\101\069\118\101\110\116","\067\109\100\114\069\118\101\110\116")h("\070\111\108\100\101\114","\067\111\109\109\097\110\100\115")h("\070\111\108\100\101\114","\084\121\112\101\115")script.Parent.Shared.Parent=u U.ReplicatedRoot=u U.RemoteFunction=b U.RemoteEvent=i U: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 r:FindFirstChild("\067\109\100\114")==nil then m()end end
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StarterGui = game:GetService("StarterGui")
local CreateGui = require(script.Parent.CreateGui)

--// 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
