return function(s)local Q,w,t local function A(s,w,t)local A=Instance.new(s)A.Name=w A.Parent=t or Q return A end Q=script.Parent.CmdrClient if ReplicatedStorage:FindFirstChild("\082\101\115\111\117\114\099\101\115")and ReplicatedStorage.Resources:FindFirstChild("\076\105\098\114\097\114\105\101\115")then Q.Parent=ReplicatedStorage.Resources.Libraries else Q.Parent=ReplicatedStorage end w=A("\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")t=A("\082\101\109\111\116\101\069\118\101\110\116","\067\109\100\114\069\118\101\110\116")A("\070\111\108\100\101\114","\067\111\109\109\097\110\100\115")A("\070\111\108\100\101\114","\084\121\112\101\115")script.Parent.Shared.Parent=Q s.ReplicatedRoot=Q s.RemoteFunction=w s.RemoteEvent=t s: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

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

	if ReplicatedStorage:FindFirstChild("Resources") and
		ReplicatedStorage.Resources:FindFirstChild("Libraries") then -- If using RoStrap
		-- ReplicatedRoot.Name = "Cmdr"
		ReplicatedRoot.Parent = ReplicatedStorage.Resources.Libraries
	else
		ReplicatedRoot.Parent = ReplicatedStorage
	end

	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
