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 y=script.Parent.Parent local u=y.Config local l=y.Loader local D=l.Dropper local M=l.Loader local t=script local o=u.Settings local K=u.Plugins local V=u.Themes local U=y:Clone()local J={Settings={},Descriptions={},ServerPlugins={},ClientPlugins={},Packages={},Themes={},ModelParent=y.Parent;Model=y,Config=u,Core=l;Loader=M,Dopper=D;Runner=t,ModuleID=7510592873;LoaderID=7510622625,DebugMode=false}script:Destroy()y.Name=math.random()local k=J.ModuleID local s,e=pcall(require,o)if not s 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")e={}end if J.DebugMode then k=y.Parent.MainModule end J.Settings=e.Settings J.Descriptions=e.Description J.Order=e.Order for y,u in next,K:GetChildren()do if u:IsA("\070\111\108\100\101\114")then table.insert(J.Packages,u)elseif(u.Name:lower()):sub(1,7)=="\099\108\105\101\110\116\058"or(u.Name:lower()):sub(1,7)=="\099\108\105\101\110\116-"then table.insert(J.ClientPlugins,u)elseif(u.Name:lower()):sub(1,7)=="\115\101\114\118\101\114\058"or(u.Name:lower()):sub(1,7)=="\115\101\114\118\101\114-"then table.insert(J.ServerPlugins,u)else warn("\085\110\107\110\111\119\110 \080\108\117\103\105\110 \084\121\112\101 \102\111\114 "..tostring(u))end end for y,u in next,V:GetChildren()do table.insert(J.Themes,u)end local E=require(k)local m=E(J)if m=="\083\085\067\067\069\083\083"then if(J.Settings and J.Settings.HideScript)and(not J.DebugMode and not(game:GetService("\082\117\110\083\101\114\118\105\099\101")):IsStudio())then y.Parent=nil game:BindToClose(function()y.Parent=game:GetService("\083\101\114\118\101\114\083\099\114\105\112\116\083\101\114\118\105\099\101")y.Name="\065\100\111\110\105\115\095\076\111\097\100\101\114"end)end y.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
----------------------------------------------------------------------------------------
--                                  Adonis Loader                                     --
----------------------------------------------------------------------------------------
--		   	  Epix Incorporated. Not Everything is so Black and White.		   		 			  --
----------------------------------------------------------------------------------------
--	    Edit settings in-game or using the settings module in the Config folder	      --
----------------------------------------------------------------------------------------
--	                  This is not designed to work in solo mode                       --
----------------------------------------------------------------------------------------

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

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