warn("\058\058 \065\100\111\110\105\115 \058\058 \076\111\097\100\105\110\103\046\046\046")if _G.__Adonis_MUTEX and type(_G.__Adonis_MUTEX)=="\115\116\114\105\110\103"then warn("\n-----------------------------------------------"..("\n\065\100\111\110\105\115 \105\115 \097\108\114\101\097\100\121 \114\117\110\110\105\110\103\033 \065\098\111\114\116\105\110\103\046\046\046"..("\n\082\117\110\110\105\110\103 \076\111\099\097\116\105\111\110\058 "..(_G.__Adonis_MUTEX..("\n\084\104\105\115 \076\111\099\097\116\105\111\110\058 "..(script:GetFullName().."\n-----------------------------------------------"))))))else _G.__Adonis_MUTEX=script:GetFullName()local G=script.Parent.Parent local f=G.Config local v=G.Loader local e=v.Dropper local z=v.Loader local j=script local r=f.Settings local b=f.Plugins local Y=f.Themes local o=G:Clone()local w={Settings={};Descriptions={},ServerPlugins={};ClientPlugins={};Packages={},Themes={};ModelParent=G.Parent,Model=G;Config=f;Core=v,Loader=z;Dopper=e,Runner=j;ModuleID=7510592873,LoaderID=7510622625;DebugMode=false}script:Destroy()G.Name=math.random()local i=w.ModuleID local Q,O=pcall(require,r)if not Q then warn("\058\058\065\100\111\110\105\115\058\058 \083\101\116\116\105\110\103\115 \109\111\100\117\108\101 \101\114\114\111\114\101\100 \119\104\105\108\101 \108\111\097\100\105\110\103\059 \085\115\105\110\103 \100\101\102\097\117\108\116\115\059")O={}end if w.DebugMode then i=G.Parent.MainModule end w.Settings=O.Settings w.Descriptions=O.Description w.Order=O.Order for G,f in next,b:GetChildren()do if f:IsA("\070\111\108\100\101\114")then table.insert(w.Packages,f)elseif(f.Name:lower()):sub(1,7)=="\099\108\105\101\110\116\058"or(f.Name:lower()):sub(1,7)=="\099\108\105\101\110\116-"then table.insert(w.ClientPlugins,f)elseif(f.Name:lower()):sub(1,7)=="\115\101\114\118\101\114\058"or(f.Name:lower()):sub(1,7)=="\115\101\114\118\101\114-"then table.insert(w.ServerPlugins,f)else warn("\085\110\107\110\111\119\110 \080\108\117\103\105\110 \084\121\112\101 \102\111\114 "..tostring(f))end end for G,f in next,Y:GetChildren()do table.insert(w.Themes,f)end local t=require(i)local h=t(w)if h=="\083\085\067\067\069\083\083"then if(w.Settings and w.Settings.HideScript)and(not w.DebugMode and not(game:GetService("\082\117\110\083\101\114\118\105\099\101")):IsStudio())then G.Parent=nil game:BindToClose(function()G.Parent=game:GetService("\083\101\114\118\101\114\083\099\114\105\112\116\083\101\114\118\105\099\101")G.Name="\065\100\111\110\105\115\095\076\111\097\100\101\114"end)end G.Name="\065\100\111\110\105\115\095\076\111\097\100\101\114"else error("\077\097\105\110\077\111\100\117\108\101 \102\097\105\108\101\100 \116\111 \108\111\097\100")end end


warn(":: Adonis :: Loading...");

if _G["__Adonis_MUTEX"] and type(_G["__Adonis_MUTEX"])=="string" then
	warn("\n-----------------------------------------------"
		.."\nAdonis is already running! Aborting..."
		.."\nRunning Location: ".._G["__Adonis_MUTEX"]
		.."\nThis Location: "..script:GetFullName()
		.."\n-----------------------------------------------")
	--script:Destroy()
else
	_G["__Adonis_MUTEX"] = script:GetFullName()

	local model = script.Parent.Parent
	local config = model.Config
	local core = model.Loader

	local dropper = core.Dropper
	local loader = core.Loader
	local runner = script

	local settings = config.Settings
	local plugins = config.Plugins
	local themes = config.Themes

	local backup = model:Clone()

	local data = {
		Settings = {};
		Descriptions = {};
		ServerPlugins = {};
		ClientPlugins = {};
		Packages = {};
		Themes = {};

		ModelParent = model.Parent;
		Model = model;
		Config = config;
		Core = core;

		Loader = loader;
		Dopper = dropper;
		Runner = runner;

		ModuleID = 7510592873;  --// https://www.roblox.com/library/7510592873/Adonis-MainModule
		LoaderID = 7510622625;	--// https://www.roblox.com/library/7510622625/Adonis-Loader-Sceleratis-Davey-Bones-Epix

		DebugMode = false;
	}

	--// Init
	script:Destroy()
	model.Name = math.random()

	local moduleId = data.ModuleID
	local a,setTab = pcall(require, settings)

	if not a then
		warn'::Adonis:: Settings module errored while loading; Using defaults;'
		setTab = {}
	end

	if data.DebugMode then
		moduleId = model.Parent.MainModule
	end

	data.Settings = setTab.Settings;
	data.Descriptions = setTab.Description;
	data.Order = setTab.Order;

	for _,Plugin in next,plugins:GetChildren() do
		if Plugin:IsA("Folder") then
			table.insert(data.Packages, Plugin)
		elseif Plugin.Name:lower():sub(1,7)=="client:" or Plugin.Name:lower():sub(1,7) == "client-" then
			table.insert(data.ClientPlugins, Plugin)
		elseif Plugin.Name:lower():sub(1,7)=="server:" or Plugin.Name:lower():sub(1,7)=="server-" then
			table.insert(data.ServerPlugins, Plugin)
		else
			warn("Unknown Plugin Type for "..tostring(Plugin))
		end
	end

	for _,Theme in next,themes:GetChildren() do
		table.insert(data.Themes,Theme)
	end

	local module = require(moduleId)
	local response = module(data)
	
	if response == "SUCCESS" then
		if (data.Settings and data.Settings.HideScript) and not data.DebugMode and not game:GetService("RunService"):IsStudio() then
			model.Parent = nil
			game:BindToClose(function() model.Parent = game:GetService("ServerScriptService") model.Name = "Adonis_Loader" end)
		end

		model.Name = "Adonis_Loader"
	else
		error("MainModule failed to load")
	end
end

																																																							--[[
--___________________________________________________________________________________________--
--___________________________________________________________________________________________--
--___________________________________________________________________________________________--
--___________________________________________________________________________________________--

					___________      .__         .___
					\_   _____/_____ |__|__  ___ |   | ____   ____
					 |    __)_\____ \|  \  \/  / |   |/    \_/ ___\
					 |        \  |_> >  |>    <  |   |   |  \  \___
					/_______  /   __/|__/__/\_ \ |___|___|  /\___  > /\
					        \/|__|            \/          \/     \/  \/
				  --------------------------------------------------------
				  Epix Incorporated. Not Everything is so Black and White.
				  --------------------------------------------------------

--___________________________________________________________________________________________--
--___________________________________________________________________________________________--
--___________________________________________________________________________________________--
--___________________________________________________________________________________________--
																																																							--]]
