return function(l,s)local L=s(nil,{script=script})setfenv(1,L)local Q=l.Server local H=l.Service local t,h,b,k,z,P,v,V,S,e,M local g,a,G local function r(l)t=Q.Functions h=Q.Admin b=Q.Anti k=Q.Core z=Q.HTTP P=Q.Logs v=Q.Remote V=Q.Process S=Q.Variables e=Q.Settings M=Q.Deps g=P.AddLog a=H.Queue G=H.TrackTask k.Themes=l.Themes or{}k.Plugins=l.Plugins or{}k.ModuleID=l.ModuleID or 7510592873 k.LoaderID=l.LoaderID or 7510622625 k.DebugMode=l.DebugMode or false k.Name=Q.Functions:GetRandom()k.LoadstringObj=k.GetLoadstring()k.Loadstring=require(k.LoadstringObj)disableAllGUIs(Q.Client.UI)k.Init=nil g("\083\099\114\105\112\116","\067\111\114\101 \077\111\100\117\108\101 \073\110\105\116\105\097\108\105\122\101\100")end local function j(l)k.MakeEvent()local s=H.ReplicatedStorage s.ChildRemoved:Connect(function(l)if Q.Core.RemoteEvent and(not Q.Core.FixingEvent and(function()for s,L in pairs(Q.Core.RemoteEvent)do if l==L then return true end end end)())then wait()Q.Core.MakeEvent()end end)k.DataStore=Q.Core.GetDataStore()if k.DataStore then G("\084\104\114\101\097\100\058 \068\083\076\111\097\100\065\110\100\072\111\111\107",function()pcall(Q.Core.LoadData)end)end game:BindToClose(function()k.GAME_CLOSING=true k.SaveAllPlayerData()end)if H.NetworkServer then G("\084\104\114\101\097\100\058 \065\080\073 \077\097\110\097\103\101\114",k.StartAPI)end H.StartLoop("\083\097\118\101\065\108\108\080\108\097\121\101\114\068\097\116\097",k.DS_AllPlayerDataSaveInterval,k.SaveAllPlayerData,true)k.RunAfterPlugins=nil g("\083\099\114\105\112\116","\067\111\114\101 \077\111\100\117\108\101 \082\117\110\065\102\116\101\114\080\108\117\103\105\110\115 \070\105\110\105\115\104\101\100")end Q.Core={Init=r;RunAfterPlugins=j,DataQueue={},DataCache={};PlayerData={};CrossServerCommands={};CrossServer=function(...)return false end,ExecuteScripts={};LastDataSave=0,FixingEvent=false;ScriptCache={};Connections={},BytecodeCache={};LastEventValue=1,Variables={TimeBans={}},DS_WriteQueueDelay=1;DS_ReadQueueDelay=.5;DS_AllPlayerDataSaveInterval=30;DS_AllPlayerDataSaveQueueDelay=.5,DS_RESET_SALTS={SavedSettings="\051\050\075\053\106\052",SavedTables="\051\050\075\053\106\052"},DS_BLACKLIST={Trello_Enabled=true,Trello_Primary=true,Trello_Secondary=true,Trello_Token=true,Trello_AppKey=true,DataStore=true,DataStoreKey=true;DataStoreEnabled=true;Creators=true,Permissions=true;G_API=true,G_Access=true,G_Access_Key=true,G_Access_Perms=true;Allowed_API_Calls=true,["\083\101\116\116\105\110\103\115\046\082\097\110\107\115\046\067\114\101\097\116\111\114\115\046\085\115\101\114\115"]=true;["\065\100\109\105\110\046\083\112\101\099\105\097\108\076\101\118\101\108\115"]=true;OnStartup=true;OnSpawn=true;OnJoin=true;CustomRanks=true;Ranks=true,DS_BLACKLIST=true};PlayerDataKeyBlacklist={AdminRank=true;AdminLevel=true;LastLevelUpdate=true},DisconnectEvent=function()if k.RemoteEvent and not k.FixingEvent then k.FixingEvent=true for l,s in pairs(k.RemoteEvent.Events)do s:Disconnect()end pcall(function()H.Delete(k.RemoteEvent.Object)end)pcall(function()H.Delete(k.RemoteEvent.Function)end)k.FixingEvent=false k.RemoteEvent=nil end end;MakeEvent=function()local l=H.ReplicatedStorage local s,L=pcall(function()if Q.Running then local s={}local L=H.New("\082\101\109\111\116\101\069\118\101\110\116",{Name=k.Name;Archivable=false},true,true)local Q=H.New("\082\101\109\111\116\101\070\117\110\099\116\105\111\110",{Name="\095\095\070\085\078\067\084\073\079\078";Parent=L},true,true)local t=true local h=math.random()local function b(l,L,H)return l.Changed:Connect(function()if k.RemoteEvent==s and not t then if l==Q then Q.OnServerInvoke=V.Remote end if l.Name~=L then l.Name=L elseif l.Parent~=H then t=true k.DisconnectEvent()k.MakeEvent()end end end)end k.DisconnectEvent()k.TripDet=h s.Events={}s.Object=L s.Function=Q s.Events.Security=b(L,L.Name,l)s.Events.FuncSec=b(Q,Q.Name,L)Q.OnServerInvoke=V.Remote s.Events.ProcessEvent=H.RbxEvent(L.OnServerEvent,V.Remote)k.RemoteEvent=s L.Parent=l t=false g(P.Script,{Text="\067\114\101\097\116\101\100 \082\101\109\111\116\101\069\118\101\110\116";Desc="\082\101\109\111\116\101\069\118\101\110\116 \119\097\115 \115\117\099\099\101\115\115\102\117\108\108\121 \099\114\101\097\116\101\100"})end end)if L then warn(L)end end;UpdateConnections=function()if H.NetworkServer then for l,s in ipairs(H.NetworkServer:GetChildren())do if s:IsA("\078\101\116\119\111\114\107\082\101\112\108\105\099\097\116\111\114")then k.Connections[s]=s:GetPlayer()end end end end;UpdateConnection=function(l)if H.NetworkServer then for s,L in ipairs(H.NetworkServer:GetChildren())do if L:IsA("\078\101\116\119\111\114\107\082\101\112\108\105\099\097\116\111\114")and L:GetPlayer()==l then k.Connections[L]=l end end end end,GetNetworkClient=function(l)if H.NetworkServer then for s,L in ipairs(H.NetworkServer:GetChildren())do if L:IsA("\078\101\116\119\111\114\107\082\101\112\108\105\099\097\116\111\114")and L:GetPlayer()==l then return L end end end end,MakeClient=function(l)if not l and k.ClientLoader then local l=k.ClientLoader l.Removing=true for l,s in pairs(l.Events)do s:Disconnect()end l.Object:Destroy()end local s=t:GetRandom()local L=Q.Client:Clone()local h=Q.Deps.ClientMover:Clone()local b=L.Client local z=l or H.StarterPlayer:FindFirstChildOfClass("\083\116\097\114\116\101\114\080\108\097\121\101\114\083\099\114\105\112\116\115")local P={Removing=false}k.MockClientKeys=k.MockClientKeys or{Special=s,Module=b}local v=k.MockClientKeys.Special local V=H.New("\083\116\114\105\110\103\086\097\108\117\101")V.Value=k.Name..("\092"..v)V.Name="\083\112\101\099\105\097\108"V.Parent=L h.Parent=L h.Disabled=false L.Archivable=false L.Name=v L.Parent=z if not l then local l=L.Name P.Object=L P.Events={}P.Events[L]=L.Changed:Connect(function()if k.ClientLoader==P and not P.Removing then if L.Name~=l then L.Name=l elseif L.Parent~=z then P.Removing=true k.MakeClient()end end end)local function s(l)local s=l.Parent local L=l.Name P.Events[l.Changed]=l.Changed:Connect(function(L)if k.ClientLoader==P and not P.Removing then if l.Parent~=s or l==V then k.MakeClient()end end end)local Q=(l:GetPropertyChangedSignal("\078\097\109\101")):Connect(function()if k.ClientLoader==P and not P.Removing then l.Name=L end end)P.Events[Q]=Q P.Events[l.AncestryChanged]=l.AncestryChanged:Connect(function()if k.ClientLoader==P and not P.Removing then k.MakeClient()end end)end for l,L in ipairs(L:GetDescendants())do s(L)end L.DescendantAdded:Connect(function(l)if k.ClientLoader==P and not P.Removing then k.MakeClient()end end)L.DescendantRemoving:Connect(function(l)if k.ClientLoader==P and not P.Removing then k.MakeClient()end end)k.ClientLoader=P end local S,e=pcall(function()L.Parent=z end)P.Removing=false g("\083\099\114\105\112\116","\067\114\101\097\116\101\100 \099\108\105\101\110\116")end,HookClient=function(l)local s=tostring(l.UserId)local L=v.Clients[s]if L then local s=t:GetRandom()local h=t:GetRandom()local b=Q.Client:Clone()local z=Q.Deps.ClientMover:Clone()local P=b.Client local v="\080\108\097\121\101\114\071\117\105"local V=l:FindFirstChildOfClass(v)or l:WaitForChild(v,600)if not l.Parent then return false elseif not V then l:Kick("\n\091\067\076\073-\049\048\050\052\057\053\093 \076\111\097\100\105\110\103 \069\114\114\111\114 \n\080\108\097\121\101\114\071\117\105 \077\105\115\115\105\110\103 \040\087\097\105\116\101\100 \049\048 \077\105\110\117\116\101\115\041")return false end local S=H.New("\083\099\114\101\101\110\071\117\105")S.ResetOnSpawn=false S.Enabled=false S.Name="\000"local e=H.New("\083\116\114\105\110\103\086\097\108\117\101")e.Value=k.Name..("\092"..s)e.Name="\083\112\101\099\105\097\108"e.Parent=b L.Special=s L.EventName=h L.Module=P z.Parent=b z.Disabled=false b.Name="\065\100\111\110\105\115\095\067\108\105\101\110\116"b.Parent=S local M M=H.Events.ClientLoaded:Connect(function(s)if l==s and S.Parent==V then S.Parent=nil l.AncestryChanged:Connect(function()if l.Parent==nil then pcall(function()S:Destroy()end)end end)M:Disconnect()end end)local g,a=pcall(function()S.Parent=V end)if not g then l:Kick("\n\091\067\076\073-\049\057\050\051\056\053\093 \076\111\097\100\105\110\103 \069\114\114\111\114 \n\091\072\111\111\107\067\108\105\101\110\116 \069\114\114\111\114\058 "..(tostring(a).."\093"))return false else return true end else if l and l.Parent then l:Kick("\n\091\067\076\073-\053\054\057\049\050\056\051\093 \076\111\097\100\105\110\103 \069\114\114\111\114 \n\091\072\111\111\107\067\108\105\101\110\116\058 \075\101\121\115 \077\105\115\115\105\110\103\093")end end end,LoadClientLoader=function(l)local s=M.ClientLoader:Clone()s.Name=t.GetRandom()s.Parent=l:WaitForChild("\080\108\097\121\101\114\071\117\105",60)or l:WaitForChild("\066\097\099\107\112\097\099\107")s.Disabled=false end;LoadExistingPlayer=function(l)warn("\076\111\097\100\105\110\103 \101\120\105\115\116\105\110\103 \112\108\097\121\101\114\058 "..tostring(l))G("\084\104\114\101\097\100\058 \083\101\116\117\112 \069\120\105\115\116\105\110\103 \080\108\097\121\101\114\058 "..tostring(l),function()V.PlayerAdded(l)end)end,ExecutePermission=function(l,s,L)local Q=H.UnWrap(l)for l,t in pairs(k.ExecuteScripts)do if not L or L and t.Type=="\076\111\099\097\108\083\099\114\105\112\116"then if(H.UnWrap(t.Script)==Q or s==t.Code)and(not t.runLimit or t.runLimit~=nil and t.Executions<=t.runLimit)then t.Executions=t.Executions+1 return{Source=t.Source,noCache=t.noCache;runLimit=t.runLimit;Executions=t.Executions}end end end end,GetScript=function(l,s)for L,Q in pairs(k.ExecuteScripts)do if Q.Script==l or s==Q.Code then return Q,L end end end,UnRegisterScript=function(l)for s,L in pairs(k.ExecuteScripts)do if L.Script==l or L==l then table.remove(k.ExecuteScripts,s)return L end end end,RegisterScript=function(l)l.Executions=0 l.Time=os.time()l.Type=l.Script.ClassName l.Wrapped=H.Wrap(l.Script)l.Wrapped:SetSpecial("\067\108\111\110\101",function()return k.RegisterScript({Script=(H.UnWrap(l.Script)):Clone(),Code=l.Code;Source=l.Source;noCache=l.noCache;runLimit=l.runLimit})end)for s,L in pairs(k.ExecuteScripts)do if L.Script==l.Script then return L.Wrapped or L.Script end end if not l.Code then l.Code=t.GetRandom()end table.insert(k.ExecuteScripts,l)return l.Wrapped end;GetLoadstring=function()local l=M.Loadstring:Clone()local s=Q.Shared.FiOne:Clone()s.Parent=l return l end;Bytecode=function(l)if k.BytecodeCache[l]then return k.BytecodeCache[l]end local s,L=k.Loadstring(l)k.BytecodeCache[l]=L return L end,NewScript=function(l,s,L,Q,h)local b local z=t.GetRandom()if l=="\083\099\114\105\112\116"then b=M.ScriptBase:Clone()elseif l=="\076\111\099\097\108\083\099\114\105\112\116"then b=M.LocalScriptBase:Clone()end if b then b.Name="\091\065\100\111\110\105\115\093 "..l if L then H.New("\083\116\114\105\110\103\086\097\108\117\101",{Name="\069\120\101\099\117\116\101",Value=z;Parent=b})end local t=k.RegisterScript({Script=b,Code=z,Source=k.Bytecode(s),noCache=Q;runLimit=h})return t or b,b,z end end;SavePlayer=function(l,s)local L=tostring(l.UserId)k.PlayerData[L]=s end;DefaultPlayerData=function(l)return{Donor={Cape={Image="\048",Color="\087\104\105\116\101",Material="\078\101\111\110"},Enabled=false},Banned=false;TimeBan=false,AdminNotes={},Keybinds={};Aliases={},Client={},Warnings={};AdminPoints=0}end;GetPlayer=function(l)local s=tostring(l.UserId)if not k.PlayerData[s]then local L=k.DefaultPlayerData(l)k.PlayerData[s]=L if k.DataStore then local l=k.GetData(s)if l and type(l)=="\116\097\098\108\101"then l.AdminNotes=l.AdminNotes and t.DSKeyNormalize(l.AdminNotes,true)or{}l.Warnings=l.Warnings and t.DSKeyNormalize(l.Warnings,true)or{}local s=Q.Core.PlayerDataKeyBlacklist for l,Q in pairs(l)do if not s[l]then L[l]=Q end end end end return L else return k.PlayerData[s]end end,ClearPlayer=function(l)k.PlayerData[tostring(l.UserId)]=k.DefaultData(l)end,SavePlayerData=function(l,s)local L=tostring(l.UserId)local Q=s or k.PlayerData[L]if k.DataStore then if Q then local s=H.CloneTable(Q)s.LastChat=nil s.AdminRank=nil s.AdminLevel=nil s.LastLevelUpdate=nil s.LastDataSave=nil s.AdminNotes=t.DSKeyNormalize(s.AdminNotes)s.Warnings=t.DSKeyNormalize(s.Warnings)k.SetData(L,s)g(P.Script,{Text="\083\097\118\101\100 \100\097\116\097 \102\111\114 "..l.Name,Desc="\080\108\097\121\101\114 \100\097\116\097 \119\097\115 \115\097\118\101\100 \116\111 \116\104\101 \100\097\116\097\115\116\111\114\101"})Q.LastDataSave=os.time()end end end,SaveAllPlayerData=function(l)local s=H.TrackTask for l,L in pairs(k.PlayerData)do local Q=tonumber(l)local t=Q and H.Players:GetPlayerByUserId(Q)if t and(not L.LastDataSave or os.time()-L.LastDataSave>=k.DS_AllPlayerDataSaveInterval)then s(string.format("\083\097\118\101 \100\097\116\097 \102\111\114 \037\115",t.Name),k.SavePlayerData,t)end end end;GetDataStore=function()local l,s=pcall(function()return H.DataStoreService:GetDataStore(string.sub(e.DataStore,1,50),"\065\100\111\110\105\115")end)if l and(s and H.RunService:IsStudio())then local l,L=pcall(s.GetAsync,s,math.random())if not l and string.find(L,"\052\048\051",1,true)then return end end return l and s end;DataStoreEncode=function(l)if k.DS_RESET_SALTS[l]then l=k.DS_RESET_SALTS[l]..l end return t.Base64Encode(v.Encrypt(tostring(l),e.DataStoreKey))end,SaveData=function(...)return k.SetData(...)end,DS_GetRequestDelay=function(l)local s,L local Q=60+#H.Players:GetPlayers()*10 local t=60/Q if l=="\087\114\105\116\101"then s=Enum.DataStoreRequestType.SetIncrementAsync elseif l=="\082\101\097\100"then s=Enum.DataStoreRequestType.GetAsync elseif l=="\085\112\100\097\116\101"then s=Enum.DataStoreRequestType.UpdateAsync end repeat L=H.DataStoreService:GetRequestBudgetForRequestType(s)until L>0 and task.wait(1)return t+.5 end;DS_WriteLimiter=function(l,s,...)local L=table.pack(...)return a("\068\097\116\097\083\116\111\114\101\087\114\105\116\101\068\097\116\097\095"..tostring(l),function()local Q=k.DS_GetRequestDelay(l)s(unpack(L,1,L.n))task.wait(Q)end,120,true)end,RemoveData=function(l)local s=k.DataStore if s then local L,Q=a("\068\097\116\097\083\116\111\114\101\087\114\105\116\101\068\097\116\097"..tostring(l),function()local L,Q=k.DS_WriteLimiter("\087\114\105\116\101",s.RemoveAsync,s,k.DataStoreEncode(l))if L then k.DataCache[l]=nil else logError("\068\097\116\097\083\116\111\114\101 \082\101\109\111\118\101\065\115\121\110\099 \070\097\105\108\101\100\058 "..tostring(Q))end task.wait(6)end,120,true)if not L then warn("\068\097\116\097\083\116\111\114\101 \082\101\109\111\118\101\068\097\116\097 \070\097\105\108\101\100\058 "..tostring(Q))end end end,SetData=function(l,s,L)if L then warn("\082\101\116\114\121\105\110\103 \083\101\116\068\097\116\097 \114\101\113\117\101\115\116 \102\111\114 "..l)end local Q=k.DataStore if Q then if s==nil then return k.RemoveData(l)else local H,t=a("\068\097\116\097\083\116\111\114\101\087\114\105\116\101\068\097\116\097"..tostring(l),function()local L,H=k.DS_WriteLimiter("\087\114\105\116\101",Q.SetAsync,Q,k.DataStoreEncode(l),s)if L then k.DataCache[l]=s else logError("\068\097\116\097\083\116\111\114\101 \083\101\116\065\115\121\110\099 \070\097\105\108\101\100\058 "..tostring(H))end task.wait(6)end,120,true)if not H then logError("\068\097\116\097\083\116\111\114\101 \083\101\116\068\097\116\097 \070\097\105\108\101\100\058 "..tostring(t))task.wait(1)if not L then return k.SetData(l,s,3)elseif L>0 then return k.SetData(l,s,L-1)end end end end end,UpdateData=function(l,s,L)if L then warn("\082\101\116\114\121\105\110\103 \085\112\100\097\116\101\068\097\116\097 \114\101\113\117\101\115\116 \102\111\114 "..l)end local Q=k.DataStore if Q then local H=false local t,h=a("\068\097\116\097\083\116\111\114\101\087\114\105\116\101\068\097\116\097"..tostring(l),function()local L,t=k.DS_WriteLimiter("\085\112\100\097\116\101",Q.UpdateAsync,Q,k.DataStoreEncode(l),s)if not L then H=t logError("\068\097\116\097\083\116\111\114\101 \085\112\100\097\116\101\065\115\121\110\099 \070\097\105\108\101\100\058 "..tostring(t))return error(t)end wait(6)end,120,true)if not t then logError("\068\097\116\097\083\116\111\114\101 \085\112\100\097\116\101\068\097\116\097 \070\097\105\108\101\100\058 "..tostring(h))wait(1)if not L then return k.UpdateData(l,s,3)elseif L>0 then return k.UpdateData(l,s,L-1)end end return H end end;GetData=function(l,s)if s then warn("\082\101\116\114\121\105\110\103 \071\101\116\068\097\116\097 \114\101\113\117\101\115\116 \102\111\114 "..l)end local L=k.DataStore if L then local Q,H=a("\068\097\116\097\083\116\111\114\101\082\101\097\100\068\097\116\097",function()local s,Q=pcall(L.GetAsync,L,k.DataStoreEncode(l))if s then k.DataCache[l]=Q return Q else logError("\068\097\116\097\083\116\111\114\101 \071\101\116\065\115\121\110\099 \070\097\105\108\101\100\058 "..tostring(Q))if k.DataCache[l]then return k.DataCache[l]else error(Q)end end wait(k.DS_GetRequestDelay("\082\101\097\100"))end,120,true)if not Q then logError("\068\097\116\097\083\116\111\114\101 \071\101\116\068\097\116\097 \070\097\105\108\101\100\058 "..tostring(H))wait(1)if not s then return k.GetData(l,3)elseif s>0 then return k.GetData(l,s-1)end else return H end end end,IndexPathToTable=function(l)local s=k.DS_BLACKLIST if type(l)=="\115\116\114\105\110\103"and not s[l]then return Q.Settings[l],l elseif type(l)=="\116\097\098\108\101"then local L=Q local H="\083\101\114\118\101\114"for l,s in ipairs(l)do L=L[s]H=s if not L then return nil end end if H and(type(H)=="\115\116\114\105\110\103"and s[H])then return nil end return L,H end return nil end,ClearAllData=function()local l=k.GetData("\083\097\118\101\100\084\097\098\108\101\115")or{}for l,s in pairs(l)do if s.TableKey then k.RemoveData(s.TableKey)end end k.SetData("\083\097\118\101\100\083\101\116\116\105\110\103\115",{})k.SetData("\083\097\118\101\100\084\097\098\108\101\115",{})k.CrossServer("\076\111\097\100\068\097\116\097")end,GetTableKey=function(l)local s=k.GetData("\083\097\118\101\100\084\097\098\108\101\115")or{}local L,Q=k.IndexPathToTable(l)local H=nil for l,s in pairs(s)do if type(s)=="\116\097\098\108\101"and(s.TableName and s.TableName==Q)then H=s break end end if not H then H={TableName=Q,TableKey="\083\065\086\069\068\084\065\066\076\069\095"..Q}table.insert(s,H)k.SetData("\083\097\118\101\100\084\097\098\108\101\115",s)end if not k.GetData(H.TableKey)then k.SetData(H.TableKey,{})end return H.TableKey end;DoSave=function(l)local s=l.Type if s=="\067\108\101\097\114\083\101\116\116\105\110\103\115"then k.ClearAllData()elseif s=="\083\101\116\083\101\116\116\105\110\103"then local s=l.Setting local L=l.Value k.UpdateData("\083\097\118\101\100\083\101\116\116\105\110\103\115",function(l)l[s]=L return l end)k.CrossServer("\076\111\097\100\068\097\116\097","\083\097\118\101\100\083\101\116\116\105\110\103\115",{[s]=L})elseif s=="\084\097\098\108\101\082\101\109\111\118\101"then local s=k.GetTableKey(l.Table)local L=l.Table local Q=l.Value l.Action="\082\101\109\111\118\101"l.Time=os.time()local H=t.CheckMatch k.UpdateData(s,function(s)s=s or{}for l,t in pairs(s)do if H(L,t.Table)and H(t.Value,Q)then table.remove(s,l)end end table.insert(s,l)return s end)k.CrossServer("\076\111\097\100\068\097\116\097","\084\097\098\108\101\085\112\100\097\116\101",l)elseif s=="\084\097\098\108\101\065\100\100"then local s=k.GetTableKey(l.Table)local L=l.Table local Q=l.Value l.Action="\065\100\100"l.Time=os.time()local H=t.CheckMatch k.UpdateData(s,function(s)s=s or{}for l,t in pairs(s)do if H(L,t.Table)and H(t.Value,Q)then table.remove(s,l)end end table.insert(s,l)return s end)k.CrossServer("\076\111\097\100\068\097\116\097","\084\097\098\108\101\085\112\100\097\116\101",l)end g(P.Script,{Text="\083\097\118\101\100 \115\101\116\116\105\110\103 \099\104\097\110\103\101 \116\111 \100\097\116\097\115\116\111\114\101";Desc="\065 \115\101\116\116\105\110\103 \099\104\097\110\103\101 \119\097\115 \105\115\115\117\101\100 \097\110\100 \115\097\118\101\100"})end;LoadData=function(l,s,L)if L and L==game.JobId then return end local H=k.DS_BLACKLIST local h=t.CheckMatch if l=="\084\097\098\108\101\085\112\100\097\116\101"then local l=s local L=l.Table local Q={Owners={"\083\101\116\116\105\110\103\115";"\082\097\110\107\115","\072\101\097\100\065\100\109\105\110\115","\085\115\101\114\115"};Creators={"\083\101\116\116\105\110\103\115";"\082\097\110\107\115","\067\114\101\097\116\111\114\115";"\085\115\101\114\115"};HeadAdmins={"\083\101\116\116\105\110\103\115","\082\097\110\107\115","\072\101\097\100\065\100\109\105\110\115","\085\115\101\114\115"},Admins={"\083\101\116\116\105\110\103\115";"\082\097\110\107\115";"\065\100\109\105\110\115","\085\115\101\114\115"};Moderators={"\083\101\116\116\105\110\103\115","\082\097\110\107\115","\077\111\100\101\114\097\116\111\114\115";"\085\115\101\114\115"}}if type(L)=="\115\116\114\105\110\103"and Q[L]then L=Q[L]end local t,b=k.IndexPathToTable(L)local z=type(L)=="\116\097\098\108\101"and table.concat(L,"\046")or b if z and(type(z)=="\115\116\114\105\110\103"and H[z])then return end if t and l.Action=="\065\100\100"then for s,L in pairs(t)do if h(L,l.Value)then table.remove(t,s)end end g("\083\099\114\105\112\116",{Text="\065\100\100\101\100 \118\097\108\117\101 \116\111 "..z;Desc="\065\100\100\101\100 "..(tostring(l.Value)..(" \116\111 "..(z.." \102\114\111\109 \100\097\116\097\115\116\111\114\101")))})table.insert(t,l.Value)elseif t and l.Action=="\082\101\109\111\118\101"then for s,L in pairs(t)do if h(L,l.Value)then g("\083\099\114\105\112\116",{Text="\082\101\109\111\118\101\100 \118\097\108\117\101 \102\114\111\109 "..z,Desc="\082\101\109\111\118\101\100 "..(tostring(l.Value)..(" \102\114\111\109 "..(z.." \102\114\111\109 \100\097\116\097\115\116\111\114\101")))})table.remove(t,s)end end end else local L local t if k.DataStore and e.DataStoreEnabled then local h,b,z,v=k.GetData,k.LoadData,k.SaveData,k.DoSave if not l then L=h("\083\097\118\101\100\083\101\116\116\105\110\103\115")t=h("\083\097\118\101\100\084\097\098\108\101\115")elseif l and not s then if l=="\083\097\118\101\100\083\101\116\116\105\110\103\115"then L=h("\083\097\118\101\100\083\101\116\116\105\110\103\115")elseif l=="\083\097\118\101\100\084\097\098\108\101\115"then t=h("\083\097\118\101\100\084\097\098\108\101\115")end elseif l and s then if l=="\083\097\118\101\100\083\101\116\116\105\110\103\115"then L=s elseif l=="\083\097\118\101\100\084\097\098\108\101\115"then t=s end end if not l and not s then if not L then L={}z("\083\097\118\101\100\083\101\116\116\105\110\103\115",{})end if not t then t={}z("\083\097\118\101\100\084\097\098\108\101\115",{})end end if L then for l,s in pairs(L)do if not H[l]then if l=="\080\114\101\102\105\120"or l=="\065\110\121\080\114\101\102\105\120"or l=="\083\112\101\099\105\097\108\080\114\101\102\105\120"then local L=e[l]for l,Q in pairs(Q.Commands)do if Q.Prefix==L then Q.Prefix=s end end end e[l]=s end end end if t then for l,s in pairs(t)do if s.TableName and(s.TableKey and not H[s.tableName])then local l=h(s.TableKey)if l then for l,s in ipairs(l)do b("\084\097\098\108\101\085\112\100\097\116\101",s)end end elseif s.Table and s.Action then b("\084\097\098\108\101\085\112\100\097\116\101",s)end end if k.Variables.TimeBans then for l,s in pairs(k.Variables.TimeBans)do if s.EndTime-os.time()<=0 then table.remove(k.Variables.TimeBans,l)v({Type="\084\097\098\108\101\082\101\109\111\118\101",Table={"\067\111\114\101";"\086\097\114\105\097\098\108\101\115";"\084\105\109\101\066\097\110\115"},Value=s})end end end end g(P.Script,{Text="\076\111\097\100\101\100 \115\097\118\101\100 \100\097\116\097";Desc="\068\097\116\097 \119\097\115 \114\101\116\114\105\101\118\101\100 \102\114\111\109 \116\104\101 \100\097\116\097\115\116\111\114\101 \097\110\100 \108\111\097\100\101\100 \115\117\099\099\101\115\115\102\117\108\108\121"})end end end,StartAPI=function()local l=_G local s=setmetatable local L=rawset local b=rawget local z=type local V=error local S=print local M=warn local a=pairs local G=next local r=table local j=getfenv local N=setfenv local D=require local q=tostring local f=Q local u=H local d=Routine local R=cPcall local Z=u.MetaFunc local w=u.StartLoop local F={AddAdmin=e.Allowed_API_Calls.DataStore;RemoveAdmin=e.Allowed_API_Calls.DataStore;RunCommand=e.Allowed_API_Calls.Core,SaveTableAdd=e.Allowed_API_Calls.DataStore and e.Allowed_API_Calls.Settings;SaveTableRemove=e.Allowed_API_Calls.DataStore and e.Allowed_API_Calls.Settings;SaveSetSetting=e.Allowed_API_Calls.DataStore and e.Allowed_API_Calls.Settings;ClearSavedSettings=e.Allowed_API_Calls.DataStore and e.Allowed_API_Calls.Settings,SetSetting=e.Allowed_API_Calls.Settings}N(1,s({},{__metatable=getmetatable(j())}))local Y={API_Specific={Test=function()S("\087\101 \114\097\110 \116\104\101 \097\112\105 \115\112\101\099\105\102\105\099 \115\116\117\102\102")end},Settings=e;Service=u}local K={Access=Z(function(...)local l={...}local s=l[1]local L=l[2]local Q if Y[L]then Q=Y[L]elseif f[L]and e.Allowed_API_Calls[L]then Q=f[L]end if e.G_Access and(s==e.G_Access_Key and(Q and e.Allowed_API_Calls[L]==true))then if z(Q)=="\116\097\098\108\101"then return u.NewProxy({__index=function(l,s)if Q[s]~=nil and F[s]==nil or F[s]==true then g(P.Script,{Text="\065\099\099\101\115\115 \116\111 "..(q(s).." \119\097\115 \103\114\097\110\116\101\100");Desc="\065 \115\101\114\118\101\114 \115\099\114\105\112\116 \119\097\115 \103\114\097\110\116\101\100 \097\099\099\101\115\115 \116\111 "..q(s)})if Q[s]~=nil and(z(Q[s])=="\116\097\098\108\101"and e.G_Access_Perms=="\082\101\097\100")then return u.ReadOnly(Q[s])else return Q[s]end elseif F[s]==false then g(P.Script,{Text="\065\099\099\101\115\115 \116\111 "..(q(s).." \119\097\115 \100\101\110\105\101\100");Desc="\065 \115\101\114\118\101\114 \115\099\114\105\112\116 \097\116\116\101\109\112\116\101\100 \116\111 \097\099\099\101\115\115 "..(q(s).." \118\105\097 \095\071\046\065\100\111\110\105\115\046\065\099\099\101\115\115")})V("\065\099\099\101\115\115 \068\101\110\105\101\100\058 "..q(s))else V("\067\111\117\108\100 \110\111\116 \102\105\110\100 "..q(s))end end;__newindex=function(l,s,L)if e.G_Access_Perms=="\082\101\097\100"then V("\082\101\097\100-\111\110\108\121")elseif e.G_Access_Perms=="\087\114\105\116\101"then l[s]=L end end,__metatable=true})end else V("\073\110\099\111\114\114\101\099\116 \107\101\121 \111\114 \071\095\065\099\099\101\115\115 \105\115 \100\105\115\097\098\108\101\100")end end),Scripts=u.ReadOnly({ExecutePermission=Z(function(l,s)local L for s,Q in a(k.ScriptCache)do if Q.Script==l then L=Q end end if L and(L.noCache~=true and(not L.runLimit or L.runLimit and L.Executions<=L.runLimit))then L.Executions=L.Executions+1 return L.Source,L.Loadstring end local Q=k.ExecutePermission(l,s)if Q and Q.Source then local s if not L then s=D(f.Shared.FiOne:Clone())r.insert(k.ScriptCache,{Script=l;Source=Q.Source;Loadstring=s;noCache=Q.noCache;runLimit=Q.runLimit,Executions=Q.Executions})else s=L.Loadstring L.Source=Q.Source end return Q.Source,s end end)},nil,nil,true);CheckAdmin=Z(h.CheckAdmin);IsAdmin=Z(h.CheckAdmin);IsBanned=Z(h.CheckBan),IsMuted=Z(h.IsMuted);CheckDonor=Z(h.CheckDonor);GetLevel=Z(h.GetLevel);SetLighting=Z(t.SetLighting);SetPlayerLighting=Z(v.SetLighting),NewParticle=Z(t.NewParticle),RemoveParticle=Z(t.RemoveParticle),NewLocal=Z(v.NewLocal),MakeLocal=Z(v.MakeLocal),MoveLocal=Z(v.MoveLocal),RemoveLocal=Z(v.RemoveLocal),Hint=Z(t.Hint),Message=Z(t.Message);RunCommandAsNonAdmin=Z(h.RunCommandAsNonAdmin)}local y=u.NewProxy({__index=function(l,s)if e.G_API then return K[s]elseif s=="\083\099\114\105\112\116\115"then return K.Scripts else V("\095\071 \065\080\073 \105\115 \100\105\115\097\098\108\101\100")end end;__newindex=function()V("\082\101\097\100-\111\110\108\121")end;__metatable=true})if not b(l,"\065\100\111\110\105\115")then if r.isfrozen and not r.isfrozen(l)or not r.isfrozen then L(l,"\065\100\111\110\105\115",y)w("\065\080\073\067\104\101\099\107",1,function()if b(l,"\065\100\111\110\105\115")~=y then if r.isfrozen and not r.isfrozen(l)or not r.isfrozen then L(l,"\065\100\111\110\105\115",y)else M("\065\068\079\078\073\083 \067\082\073\084\073\067\065\076 \087\065\082\078\073\078\071\033 \077\065\076\073\067\073\079\085\083 \067\079\068\069 \073\083 \084\082\089\073\078\071 \084\079 \067\072\065\078\071\069 \084\072\069 \065\068\079\078\073\083 \095\071 \065\080\073 \065\078\068 \073\084 \067\065\078\'\084 \066\069 \083\069\084 \066\065\067\075\033 \080\076\069\065\083\069 \083\072\085\084\068\079\087\078 \084\072\069 \083\069\082\086\069\082 \065\078\068 \082\069\077\079\086\069 \084\072\069 \077\065\076\073\067\073\079\085\083 \067\079\068\069 \073\070 \080\079\083\083\073\066\076\069\033")end end end,true)else M("\084\104\101 \095\071 \116\097\098\108\101 \119\097\115 \108\111\099\107\101\100 \097\110\100 \116\104\101 \065\100\111\110\105\115 \095\071 \065\080\073 \099\111\117\108\100 \110\111\116 \098\101 \108\111\097\100\101\100")end end g(P.Script,{Text="\083\116\097\114\116\101\100 \095\071 \065\080\073";Desc="\095\071 \065\080\073 \119\097\115 \105\110\105\116\105\097\108\105\122\101\100 \097\110\100 \105\115 \114\101\097\100\121 \116\111 \117\115\101"})end}end

return function(Vargs, GetEnv)
	local env = GetEnv(nil, {script = script})
	setfenv(1, env)

	local server = Vargs.Server;
	local service = Vargs.Service;

	local Functions, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Settings, Deps;
	local AddLog, Queue, TrackTask
	local function Init(data)
		Functions = server.Functions;
		Admin = server.Admin;
		Anti = server.Anti;
		Core = server.Core;
		HTTP = server.HTTP;
		Logs = server.Logs;
		Remote = server.Remote;
		Process = server.Process;
		Variables = server.Variables;
		Settings = server.Settings;
		Deps = server.Deps;

		AddLog = Logs.AddLog;
		Queue = service.Queue;
		TrackTask = service.TrackTask;

		--// Core variables
		Core.Themes = data.Themes or {}
		Core.Plugins = data.Plugins or {}
		Core.ModuleID = data.ModuleID or 7510592873
		Core.LoaderID = data.LoaderID or 7510622625
		Core.DebugMode = data.DebugMode or false
		Core.Name = server.Functions:GetRandom()
		Core.LoadstringObj = Core.GetLoadstring()
		Core.Loadstring = require(Core.LoadstringObj)

		disableAllGUIs(server.Client.UI);

		Core.Init = nil;
		AddLog("Script", "Core Module Initialized")
	end;

	local function RunAfterPlugins(data)
		--// RemoteEvent Handling
		Core.MakeEvent()

		--// Prepare the client loader
		--local existingPlayers = service.Players:GetPlayers();
		--Core.MakeClient()

		local remoteParent = service.ReplicatedStorage;
		remoteParent.ChildRemoved:Connect(function(c)
			if server.Core.RemoteEvent and not server.Core.FixingEvent and (function() for i,v in pairs(server.Core.RemoteEvent) do if c == v then return true end end end)() then
				wait();
				server.Core.MakeEvent()
			end
		end)

		--// Load data
		Core.DataStore = server.Core.GetDataStore()
		if Core.DataStore then
			TrackTask("Thread: DSLoadAndHook", function()
				pcall(server.Core.LoadData)
			end)
		end

		--// Save all data on server shutdown & set GAME_CLOSING
		game:BindToClose(function()
			Core.GAME_CLOSING = true;
			Core.SaveAllPlayerData();
		end);

		--// Start API
		if service.NetworkServer then
			--service.Threads.RunTask("_G API Manager",server.Core.StartAPI)
			TrackTask("Thread: API Manager", Core.StartAPI)
		end

		--// Occasionally save all player data to the datastore to prevent data loss if the server abruptly crashes
		service.StartLoop("SaveAllPlayerData", Core.DS_AllPlayerDataSaveInterval, Core.SaveAllPlayerData, true)

		Core.RunAfterPlugins = nil;
		AddLog("Script", "Core Module RunAfterPlugins Finished");
	end

	server.Core = {
		Init = Init;
		RunAfterPlugins = RunAfterPlugins;
		DataQueue = {};
		DataCache = {};
		PlayerData = {};
		CrossServerCommands = {};
		CrossServer = function(...) return false end;
		ExecuteScripts = {};
		LastDataSave = 0;
		FixingEvent = false;
		ScriptCache = {};
		Connections = {};
		BytecodeCache = {};
		LastEventValue = 1;

		Variables = {
			TimeBans = {};
		};

		--// Datastore update/queue timers/delays
		DS_WriteQueueDelay = 1;
		DS_ReadQueueDelay = 0.5;
		DS_AllPlayerDataSaveInterval = 30;
		DS_AllPlayerDataSaveQueueDelay = 0.5;

		--// Used to change/"reset" specific datastore keys
		DS_RESET_SALTS = {
			SavedSettings = "32K5j4";
			SavedTables = 	"32K5j4";
		};

		DS_BLACKLIST = {
			Trello_Enabled = true;
			Trello_Primary = true;
			Trello_Secondary = true;
			Trello_Token = true;
			Trello_AppKey = true;

			DataStore = true;
			DataStoreKey = true;
			DataStoreEnabled = true;

			Creators = true;
			Permissions = true;

			G_API = true;
			G_Access = true;
			G_Access_Key = true;
			G_Access_Perms = true;
			Allowed_API_Calls = true;

			["Settings.Ranks.Creators.Users"] = true;
			["Admin.SpecialLevels"] = true;

			OnStartup = true;
			OnSpawn = true;
			OnJoin = true;

			CustomRanks = true;
			Ranks = true;

			--// Not gonna let malicious stuff set DS_Blacklist to {} or anything!
			DS_BLACKLIST = true;
		};

		--// Prevent certain keys from loading from the DataStore
		PlayerDataKeyBlacklist = {
			AdminRank = true;
			AdminLevel = true;
			LastLevelUpdate = true;
		};

		DisconnectEvent = function()
			if Core.RemoteEvent and not Core.FixingEvent then
				Core.FixingEvent = true;

				for name,event in pairs(Core.RemoteEvent.Events) do
					event:Disconnect()
				end

				pcall(function() service.Delete(Core.RemoteEvent.Object) end)
				pcall(function() service.Delete(Core.RemoteEvent.Function) end)

				Core.FixingEvent = false;
				Core.RemoteEvent = nil;
			end
		end;

		MakeEvent = function()
			local remoteParent = service.ReplicatedStorage;
			local ran, error = pcall(function()
				if server.Running then
					local rTable = {};
					local event = service.New("RemoteEvent", {Name = Core.Name, Archivable = false}, true, true)
					local func = service.New("RemoteFunction", {Name = "__FUNCTION", Parent = event}, true, true)
					local secureTriggered = true
					local tripDet = math.random()

					local function secure(ev, name, parent)
						return ev.Changed:Connect(function()
							if Core.RemoteEvent == rTable and not secureTriggered then
								if ev == func then
									func.OnServerInvoke = Process.Remote
								end

								if ev.Name ~= name then
									ev.Name = name
								elseif ev.Parent ~= parent then
									secureTriggered = true;
									Core.DisconnectEvent();
									Core.MakeEvent()
								end
							end
						end)
					end

					Core.DisconnectEvent();
					Core.TripDet = tripDet;

					rTable.Events = {};
					rTable.Object = event;
					rTable.Function = func;

					rTable.Events.Security = secure(event, event.Name, remoteParent);
					rTable.Events.FuncSec = secure(func, func.Name, event);

					func.OnServerInvoke = Process.Remote;
					rTable.Events.ProcessEvent = service.RbxEvent(event.OnServerEvent, Process.Remote);

					Core.RemoteEvent = rTable;
					event.Parent = remoteParent;
					secureTriggered = false;

					AddLog(Logs.Script,{
						Text = "Created RemoteEvent";
						Desc = "RemoteEvent was successfully created";
					})
				end
			end)

			if error then
				warn(error)
			end
		end;

		UpdateConnections = function()
			if service.NetworkServer then
				for i,cli in ipairs(service.NetworkServer:GetChildren()) do
					if cli:IsA("NetworkReplicator") then
						Core.Connections[cli] = cli:GetPlayer()
					end
				end
			end
		end;

		UpdateConnection = function(p)
			if service.NetworkServer then
				for i,cli in ipairs(service.NetworkServer:GetChildren()) do
					if cli:IsA("NetworkReplicator") and cli:GetPlayer() == p then
						Core.Connections[cli] = p
					end
				end
			end
		end;

		GetNetworkClient = function(p)
			if service.NetworkServer then
				for i,cli in ipairs(service.NetworkServer:GetChildren()) do
					if cli:IsA("NetworkReplicator") and cli:GetPlayer() == p then
						return cli
					end
				end
			end
		end;

	 	MakeClient = function(parent)
			if not parent and Core.ClientLoader then
				local loader = Core.ClientLoader;
				loader.Removing = true;

				for i,v in pairs(loader.Events) do
					v:Disconnect()
				end

				loader.Object:Destroy();
			end;

			local depsName = Functions:GetRandom()
			local folder = server.Client:Clone()
			local acli = server.Deps.ClientMover:Clone();
			local client = folder.Client
			local parentObj = parent or service.StarterPlayer:FindFirstChildOfClass("StarterPlayerScripts");
			local clientLoader = {
				Removing = false;
			};

			Core.MockClientKeys = Core.MockClientKeys or {
				Special = depsName;
				Module = client;
			}

			local depsName = Core.MockClientKeys.Special;
			local specialVal = service.New("StringValue")
			specialVal.Value = Core.Name.."\\"..depsName
			specialVal.Name = "Special"
			specialVal.Parent = folder

			acli.Parent = folder;
			acli.Disabled = false;

			folder.Archivable = false;
			folder.Name = depsName; --"Adonis_Client"
			folder.Parent = parentObj;

			if not parent then
				local oName = folder.Name;
				clientLoader.Object = folder;
				clientLoader.Events = {}

				clientLoader.Events[folder] = folder.Changed:Connect(function()
					if Core.ClientLoader == clientLoader and not clientLoader.Removing then
						if folder.Name ~= oName then
							folder.Name = oName;
						elseif folder.Parent ~= parentObj then
							clientLoader.Removing = true;
							Core.MakeClient();
						end
					end
				end)

				local function sec(child)
					local oParent = child.Parent;
					local oName = child.Name;

					clientLoader.Events[child.Changed] = child.Changed:Connect(function(c)
						if Core.ClientLoader == clientLoader and not clientLoader.Removing then
							if child.Parent ~= oParent or child == specialVal then
								Core.MakeClient();
							end
						end
					end)

					local nameEvent = child:GetPropertyChangedSignal("Name"):Connect(function()
						if Core.ClientLoader == clientLoader and not clientLoader.Removing then
							child.Name = oName;
						end
					end)

					clientLoader.Events[nameEvent] = nameEvent;
					clientLoader.Events[child.AncestryChanged] = child.AncestryChanged:Connect(function()
						if Core.ClientLoader == clientLoader and not clientLoader.Removing then
							Core.MakeClient();
						end
					end)
				end;

				for i,child in ipairs(folder:GetDescendants()) do
					sec(child);
				end

				folder.DescendantAdded:Connect(function(d)
					if Core.ClientLoader == clientLoader and not clientLoader.Removing then
						Core.MakeClient();
					end
				end)

				folder.DescendantRemoving:Connect(function(d)
					if Core.ClientLoader == clientLoader and not clientLoader.Removing then
						Core.MakeClient();
					end
				end)

				Core.ClientLoader = clientLoader;
			end


			local ok,err = pcall(function()
				folder.Parent = parentObj
			end)

			clientLoader.Removing = false;

			AddLog("Script", "Created client");
		end;

		HookClient = function(p)
			local key = tostring(p.UserId)
			local keys = Remote.Clients[key]
			if keys then
				local depsName = Functions:GetRandom()
				local eventName = Functions:GetRandom()
				local folder = server.Client:Clone()
				local acli = server.Deps.ClientMover:Clone();
				local client = folder.Client
				local parentTo = "PlayerGui" --// Roblox, seriously, please give the server access to PlayerScripts already so I don't need to do this.
				local parentObj = p:FindFirstChildOfClass(parentTo) or p:WaitForChild(parentTo, 600);

				if not p.Parent then
					return false
				elseif not parentObj then
					p:Kick("\n[CLI-102495] Loading Error \nPlayerGui Missing (Waited 10 Minutes)")
					return false
				end

				local container = service.New("ScreenGui");
				container.ResetOnSpawn = false;
				container.Enabled = false;
				container.Name = "\0";

				local specialVal = service.New("StringValue")
				specialVal.Value = Core.Name.."\\"..depsName
				specialVal.Name = "Special"
				specialVal.Parent = folder

				keys.Special = depsName
				keys.EventName = eventName
				keys.Module = client

				acli.Parent = folder;
				acli.Disabled = false;

				folder.Name = "Adonis_Client"
				folder.Parent = container;

				--// Event only fires AFTER the client is alive and well
				local event; event = service.Events.ClientLoaded:Connect(function(plr)
					if p == plr and container.Parent == parentObj then
						container.Parent = nil --container:Destroy(); -- Destroy update causes an issue with this pretty sure
						p.AncestryChanged:Connect(function() -- after/on remove, not on removing...
							if p.Parent == nil then
								pcall(function() container:Destroy() end) -- Prevent potential memory leak and ensure this gets properly murdered when they leave and it's no longer needed
							end
						end)
						event:Disconnect();
					end
				end)

				local ok,err = pcall(function()
					container.Parent = parentObj
				end)

				if not ok then
					p:Kick("\n[CLI-192385] Loading Error \n[HookClient Error: "..tostring(err).."]")
					return false
				else
					return true
				end
			else
				if p and p.Parent then
					p:Kick("\n[CLI-5691283] Loading Error \n[HookClient: Keys Missing]")
				end
			end
		end;

		LoadClientLoader = function(p)
			local loader = Deps.ClientLoader:Clone()
			loader.Name = Functions.GetRandom()
			loader.Parent = p:WaitForChild("PlayerGui", 60) or p:WaitForChild("Backpack")
			loader.Disabled = false
		end;

		LoadExistingPlayer = function(p)
			warn("Loading existing player: ".. tostring(p))

			TrackTask("Thread: Setup Existing Player: ".. tostring(p), function()
				Process.PlayerAdded(p)
				--Core.MakeClient(p:FindFirstChildOfClass("PlayerGui") or p:WaitForChild("PlayerGui", 120))
			end)
		end;

		ExecutePermission = function(scr, code, isLocal)
			local fixscr = service.UnWrap(scr)

			for _, val in pairs(Core.ExecuteScripts) do
				if not isLocal or (isLocal and val.Type == "LocalScript") then
					if (service.UnWrap(val.Script) == fixscr or code == val.Code) and (not val.runLimit or (val.runLimit ~= nil and val.Executions <= val.runLimit)) then
						val.Executions = val.Executions+1

						return {
							Source = val.Source;
							noCache = val.noCache;
							runLimit = val.runLimit;
							Executions = val.Executions;
						}
					end
				end
			end
		end;

		GetScript = function(scr,code)
			for i,val in pairs(Core.ExecuteScripts) do
				if val.Script == scr or code == val.Code then
					return val,i
				end
			end
		end;

		UnRegisterScript = function(scr)
			for i,dat in pairs(Core.ExecuteScripts) do
				if dat.Script == scr or dat == scr then
					table.remove(Core.ExecuteScripts, i)
					return dat
				end
			end
		end;

		RegisterScript = function(data)
			data.Executions = 0
			data.Time = os.time()
			data.Type = data.Script.ClassName
			data.Wrapped = service.Wrap(data.Script)
			data.Wrapped:SetSpecial("Clone",function()
				return Core.RegisterScript {
					Script = service.UnWrap(data.Script):Clone();
					Code = data.Code;
					Source = data.Source;
					noCache = data.noCache;
					runLimit = data.runLimit;
				}
			end)

			for ind,scr in pairs(Core.ExecuteScripts) do
				if scr.Script == data.Script then
					return scr.Wrapped or scr.Script
				end
			end

			if not data.Code then
				data.Code = Functions.GetRandom()
			end

			table.insert(Core.ExecuteScripts,data)
			return data.Wrapped
		end;

		GetLoadstring = function()
			local newLoad = Deps.Loadstring:Clone();
			local lbi = server.Shared.FiOne:Clone();

			lbi.Parent = newLoad

			return newLoad;
		end;

		Bytecode = function(str)
			if Core.BytecodeCache[str] then return Core.BytecodeCache[str] end
			local f, buff = Core.Loadstring(str)
			Core.BytecodeCache[str] = buff
			return buff
		end;

		NewScript = function(type,source,allowCodes,noCache,runLimit)
			local ScriptType
			local execCode = Functions.GetRandom()

			if type == 'Script' then
				ScriptType = Deps.ScriptBase:Clone()
			elseif type == 'LocalScript' then
				ScriptType = Deps.LocalScriptBase:Clone()
			end

			if ScriptType then
				ScriptType.Name = "[Adonis] ".. type

				if allowCodes then
					service.New("StringValue", {
						Name = "Execute",
						Value = execCode,
						Parent = ScriptType,
					})
				end

				local wrapped = Core.RegisterScript {
					Script = ScriptType;
					Code = execCode;
					Source = Core.Bytecode(source);
					noCache = noCache;
					runLimit = runLimit;
				}

				return wrapped or ScriptType, ScriptType, execCode
			end
		end;

		SavePlayer = function(p,data)
			local key = tostring(p.UserId)
			Core.PlayerData[key] = data
		end;

		DefaultPlayerData = function(p)
			return {
				Donor = {
					Cape = {
						Image = '0';
						Color = 'White';
						Material = 'Neon';
					};
					Enabled = false;
				};
				Banned = false;
				TimeBan = false;
				AdminNotes = {};
				Keybinds = {};
				Aliases = {};
				Client = {};
				Warnings = {};
				AdminPoints = 0;
			};
		end;

		GetPlayer = function(p)
			local key = tostring(p.UserId)

			if not Core.PlayerData[key] then
				local PlayerData = Core.DefaultPlayerData(p)

				Core.PlayerData[key] = PlayerData

				if Core.DataStore then
					local data = Core.GetData(key)
					if data and type(data) == "table" then
						data.AdminNotes = (data.AdminNotes and Functions.DSKeyNormalize(data.AdminNotes, true)) or {}
						data.Warnings = (data.Warnings and Functions.DSKeyNormalize(data.Warnings, true)) or {}

						local BLOCKED_SETTINGS = server.Core.PlayerDataKeyBlacklist

						for i,v in pairs(data) do
							if not BLOCKED_SETTINGS[i] then
								PlayerData[i] = v
							end
						end
					end
				end

				return PlayerData
			else
				return Core.PlayerData[key]
			end
		end;

		ClearPlayer = function(p)
			Core.PlayerData[tostring(p.UserId)] = Core.DefaultData(p);
		end;

		SavePlayerData = function(p, customData)
			local key = tostring(p.UserId);
			local pData = customData or Core.PlayerData[key];

			if Core.DataStore then
				if pData then
					local data = service.CloneTable(pData);

					data.LastChat = nil
					data.AdminRank = nil
					data.AdminLevel = nil
					data.LastLevelUpdate = nil
					data.LastDataSave = nil

					data.AdminNotes = Functions.DSKeyNormalize(data.AdminNotes)
					data.Warnings = Functions.DSKeyNormalize(data.Warnings)

					Core.SetData(key, data)
					AddLog(Logs.Script,{
						Text = "Saved data for ".. p.Name;
						Desc = "Player data was saved to the datastore";
					})

					pData.LastDataSave = os.time();
				end
			end
		end;

		SaveAllPlayerData = function(queueWaitTime)
			local TrackTask = service.TrackTask
			for key,pdata in pairs(Core.PlayerData) do
				local id = tonumber(key);
				local player = id and service.Players:GetPlayerByUserId(id);
				if player and (not pdata.LastDataSave or os.time() - pdata.LastDataSave >= Core.DS_AllPlayerDataSaveInterval)  then
					TrackTask(string.format("Save data for %s", player.Name), Core.SavePlayerData, player);
				end
			end
			--[[ --// OLD METHOD (Kept in case this messes anything up)
			for i,p in next,service.Players:GetPlayers() do
				local pdata = Core.PlayerData[tostring(p.UserId)];
				--// Only save player's data if it has not been saved within the last INTERVAL (default 30s)
				if pdata and (not pdata.LastDataSave or os.time() - pdata.LastDataSave >= Core.DS_AllPlayerDataSaveInterval) then
					service.Queue("SavePlayerData", function()
						Core.SavePlayerData(p)
						wait(queueWaitTime or Core.DS_AllPlayerDataSaveQueueDelay)
					end)
				end
			end--]]
		end;

		GetDataStore = function()
			local ran,store = pcall(function()
				return service.DataStoreService:GetDataStore(string.sub(Settings.DataStore, 1, 50),"Adonis")
			end)

			-- DataStore studio check.
			if ran and store and service.RunService:IsStudio() then
				local success, res = pcall(store.GetAsync, store, math.random())
				if not success and string.find(res, "403", 1, true) then
					return;
				end
			end

			return ran and store
		end;

		DataStoreEncode = function(key)
			if Core.DS_RESET_SALTS[key] then
				key = Core.DS_RESET_SALTS[key] .. key
			end

			return Functions.Base64Encode(Remote.Encrypt(tostring(key), Settings.DataStoreKey))
		end;

		SaveData = function(...)
			return Core.SetData(...)
		end;

		DS_GetRequestDelay = function(type)
			local requestType, budget;

			local reqPerMin = 60 + #service.Players:GetPlayers() * 10;
			local reqDelay = 60 / reqPerMin;

			if type == "Write" then
				requestType = Enum.DataStoreRequestType.SetIncrementAsync;
			elseif type == "Read" then
				requestType = Enum.DataStoreRequestType.GetAsync;
			elseif type == "Update" then
				requestType = Enum.DataStoreRequestType.UpdateAsync;
			end

			repeat
				budget = service.DataStoreService:GetRequestBudgetForRequestType(requestType);
			until budget > 0 and task.wait(1)

			return reqDelay + 0.5;
		end;

		DS_WriteLimiter = function(type, func, ...)
			local vararg = table.pack(...)
			return Queue("DataStoreWriteData_" .. tostring(type), function()
				local gotDelay = Core.DS_GetRequestDelay(type); --// Wait for budget, also return how long we should wait before the next request is allowed to go
				func(unpack(vararg, 1, vararg.n))
				task.wait(gotDelay)
			end, 120, true)
		end;

		RemoveData = function(key)
			local DataStore = Core.DataStore
			if DataStore then
				local ran2, err2 = Queue("DataStoreWriteData" .. tostring(key), function()
					local ran, ret = Core.DS_WriteLimiter("Write", DataStore.RemoveAsync, DataStore, Core.DataStoreEncode(key))
					if ran then
						Core.DataCache[key] = nil
					else
						logError("DataStore RemoveAsync Failed: ".. tostring(ret))
					end

					task.wait(6)
				end, 120, true)

				if not ran2 then
					warn("DataStore RemoveData Failed: ".. tostring(err2))
				end
			end
		end;

		SetData = function(key, value, repeatCount)
			if repeatCount then
				warn("Retrying SetData request for ".. key);
			end

			local DataStore = Core.DataStore
			if DataStore then
				if value == nil then
					return Core.RemoveData(key)
				else
					local ran2, err2 = Queue("DataStoreWriteData" .. tostring(key), function()
						local ran, ret = Core.DS_WriteLimiter("Write", DataStore.SetAsync, DataStore, Core.DataStoreEncode(key), value)
						if ran then
							Core.DataCache[key] = value
						else
							logError("DataStore SetAsync Failed: ".. tostring(ret));
						end

						task.wait(6)
					end, 120, true)

					if not ran2 then
						logError("DataStore SetData Failed: ".. tostring(err2))

						--// Attempt 3 times, with slight delay between if failed
						task.wait(1);
						if not repeatCount then
							return Core.SetData(key, value, 3);
						elseif repeatCount > 0 then
							return Core.SetData(key, value, repeatCount - 1);
						end
					end
				end
			end
		end;

		UpdateData = function(key, func, repeatCount)
			if repeatCount then
				warn("Retrying UpdateData request for ".. key);
			end

			local DataStore = Core.DataStore
			if DataStore then
				local err = false;
				local ran2, err2 = Queue("DataStoreWriteData" .. tostring(key), function()
					local ran, ret = Core.DS_WriteLimiter("Update", DataStore.UpdateAsync, DataStore, Core.DataStoreEncode(key), func)

					if not ran then
						err = ret;
						logError("DataStore UpdateAsync Failed: ".. tostring(ret))
						return error(ret);
					end

					wait(6)
				end, 120, true) --// 120 timeout, yield until this queued function runs and completes

				if not ran2 then
					logError("DataStore UpdateData Failed: ".. tostring(err2))

					--// Attempt 3 times, with slight delay between if failed
					wait(1);
					if not repeatCount then
						return Core.UpdateData(key, func, 3);
					elseif repeatCount > 0 then
						return Core.UpdateData(key, func, repeatCount - 1);
					end
				end

				return err
			end
		end;

		GetData = function(key, repeatCount)
			if repeatCount then
				warn("Retrying GetData request for ".. key);
			end

			local DataStore = Core.DataStore
			if DataStore then
				local ran2, err2 = Queue("DataStoreReadData", function()
					local ran, ret = pcall(DataStore.GetAsync, DataStore, Core.DataStoreEncode(key))
					if ran then
						Core.DataCache[key] = ret
						return ret
					else
						logError("DataStore GetAsync Failed: ".. tostring(ret))
						if Core.DataCache[key] then
							return Core.DataCache[key];
						else
							error(ret);
						end
					end
					wait(Core.DS_GetRequestDelay("Read"))
				end, 120, true)

				if not ran2 then
					logError("DataStore GetData Failed: ".. tostring(err2))
					--// Attempt 3 times, with slight delay between if failed
					wait(1);
					if not repeatCount then
						return Core.GetData(key, 3);
					elseif repeatCount > 0 then
						return Core.GetData(key, repeatCount - 1);
					end
				else
					return err2;
				end
			end
		end;

		IndexPathToTable = function(tableAncestry)
			local Blacklist = Core.DS_BLACKLIST
			if type(tableAncestry) == "string" and not Blacklist[tableAncestry] then
				return server.Settings[tableAncestry], tableAncestry;
			elseif type(tableAncestry) == "table" then
				local curTable = server;
				local curName = "Server";

				for i,ind in ipairs(tableAncestry) do
					curTable = curTable[ind];
					curName = ind;

					if not curTable then
						--warn(tostring(ind) .." could not be found");
						--// Not allowed or table is not found
						return nil;
					end
				end

				if curName and type(curName) == 'string' and Blacklist[curName] then
					return nil
				end

				return curTable, curName;
			end
			return nil
		end;

		ClearAllData = function()
			local tabs = Core.GetData("SavedTables") or {};

			for i,v in pairs(tabs) do
				if v.TableKey then
					Core.RemoveData(v.TableKey);
				end
			end

			Core.SetData("SavedSettings",{});
			Core.SetData("SavedTables",{});
			Core.CrossServer("LoadData");
		end;

		GetTableKey = function(indList)
			local tabs = Core.GetData("SavedTables") or {};
			local realTable,tableName = Core.IndexPathToTable(indList);

			local foundTable = nil;

			for i,v in pairs(tabs) do
				if type(v) == "table" and v.TableName and v.TableName == tableName then
					foundTable = v
					break;
				end
			end

			if not foundTable then
				foundTable = {
					TableName = tableName;
					TableKey = "SAVEDTABLE_".. tableName;
				}

				table.insert(tabs, foundTable);
				Core.SetData("SavedTables", tabs);
			end

			if not Core.GetData(foundTable.TableKey) then
				Core.SetData(foundTable.TableKey, {});
			end

			return foundTable.TableKey;
		end;

		DoSave = function(data)
			local type = data.Type
			if type == "ClearSettings" then
				Core.ClearAllData();
			elseif type == "SetSetting" then
				local setting = data.Setting
				local value = data.Value

				Core.UpdateData("SavedSettings", function(settings)
					settings[setting] = value
					return settings
				end)

				Core.CrossServer("LoadData", "SavedSettings", {[setting] = value});
			elseif type == "TableRemove" then
				local key = Core.GetTableKey(data.Table);
				local tab = data.Table
				local value = data.Value

				data.Action = "Remove"
				data.Time = os.time()

				local CheckMatch = Functions.CheckMatch
				Core.UpdateData(key, function(sets)
					sets = sets or {}

					for i,v in pairs(sets) do
						if CheckMatch(tab, v.Table) and CheckMatch(v.Value, value) then
							table.remove(sets,i)
						end
					end

					table.insert(sets, data)

					return sets
				end)

				Core.CrossServer("LoadData", "TableUpdate", data);
			elseif type == "TableAdd" then
				local key = Core.GetTableKey(data.Table);
				local tab = data.Table
				local value = data.Value

				data.Action = "Add"
				data.Time = os.time()

				local CheckMatch = Functions.CheckMatch
				Core.UpdateData(key, function(sets)
					sets = sets or {}

					for i,v in pairs(sets) do
						if CheckMatch(tab, v.Table) and CheckMatch(v.Value, value) then
							table.remove(sets, i)
						end
					end

					table.insert(sets, data)

					return sets
				end)

				Core.CrossServer("LoadData", "TableUpdate", data);
			end

			AddLog(Logs.Script,{
				Text = "Saved setting change to datastore";
				Desc = "A setting change was issued and saved";
			})
		end;

		LoadData = function(key, data, serverId)
			if serverId and serverId == game.JobId then return end;

			local Blacklist = Core.DS_BLACKLIST
			local CheckMatch = Functions.CheckMatch;
			if key == "TableUpdate" then
				local tab = data;
				local indList = tab.Table;
				local nameRankComp = {--// Old settings backwards compatability
					Owners = {"Settings", "Ranks", "HeadAdmins", "Users"};
					Creators = {"Settings", "Ranks", "Creators", "Users"};
					HeadAdmins = {"Settings", "Ranks", "HeadAdmins", "Users"};
					Admins = {"Settings", "Ranks", "Admins", "Users"};
					Moderators = {"Settings", "Ranks", "Moderators", "Users"};
				}

				if type(indList) == "string" and nameRankComp[indList] then
					indList = nameRankComp[indList];
				end

				local realTable,tableName = Core.IndexPathToTable(indList);
				local displayName = type(indList) == "table" and table.concat(indList, ".") or tableName;

				if displayName and type(displayName) == 'string' and Blacklist[displayName] then
					--// warn("Stopped " .. displayName .. " from being set!")
					--// Debugging --Coasterteam
					return
				end

				if realTable and tab.Action == "Add" then
					for i,v in pairs(realTable) do
						if CheckMatch(v,tab.Value) then
							table.remove(realTable, i)
						end
					end

					AddLog("Script",{
						Text = "Added value to ".. displayName;
						Desc = "Added "..tostring(tab.Value).." to ".. displayName .." from datastore";
					})

					table.insert(realTable, tab.Value)
				elseif realTable and tab.Action == "Remove" then
					for i,v in pairs(realTable) do
						if CheckMatch(v, tab.Value) then
							AddLog("Script",{
								Text = "Removed value from ".. displayName;
								Desc = "Removed "..tostring(tab.Value).." from ".. displayName .." from datastore";
							})

							table.remove(realTable, i)
						end
					end
				end
			else
				local SavedSettings
				local SavedTables
				if Core.DataStore and Settings.DataStoreEnabled then
					local GetData, LoadData, SaveData, DoSave = Core.GetData, Core.LoadData, Core.SaveData, Core.DoSave

					if not key then
						SavedSettings = GetData("SavedSettings")
						SavedTables = GetData("SavedTables")
					elseif key and not data then
						if key == "SavedSettings" then
							SavedSettings = GetData("SavedSettings")
						elseif key == "SavedTables" then
							SavedTables = GetData("SavedTables")
						end
					elseif key and data then
						if key == "SavedSettings" then
							SavedSettings = data
						elseif key == "SavedTables" then
							SavedTables = data
						end
					end

					if not key and not data then
						if not SavedSettings then
							SavedSettings = {}
							SaveData("SavedSettings",{})
						end

						if not SavedTables then
							SavedTables = {}
							SaveData("SavedTables",{})
						end
					end

					if SavedSettings then
						for setting,value in pairs(SavedSettings) do
							if not Blacklist[setting] then
								if setting == 'Prefix' or setting == 'AnyPrefix' or setting == 'SpecialPrefix' then
									local orig = Settings[setting]
									for i,v in pairs(server.Commands) do
										if v.Prefix == orig then
											v.Prefix = value
										end
									end
								end

								Settings[setting] = value
							end
						end
					end

					if SavedTables then
						for i,tData in pairs(SavedTables) do
							if tData.TableName and tData.TableKey and not Blacklist[tData.tableName] then
								local data = GetData(tData.TableKey);
								if data then
									for k,v in ipairs(data) do
										LoadData("TableUpdate", v)
									end
								end
							elseif tData.Table and tData.Action then
								LoadData("TableUpdate", tData)
							end
						end

						if Core.Variables.TimeBans then
							for i,v in pairs(Core.Variables.TimeBans) do
								if v.EndTime-os.time() <= 0 then
									table.remove(Core.Variables.TimeBans, i)
									DoSave({
										Type = "TableRemove";
										Table = {"Core", "Variables", "TimeBans"};
										Value = v;
									})
								end
							end
						end
					end

					AddLog(Logs.Script,{
						Text = "Loaded saved data";
						Desc = "Data was retrieved from the datastore and loaded successfully";
					})
				end
			end
		end;

		StartAPI = function()
			local _G = _G
			local setmetatable = setmetatable
			local rawset = rawset
			local rawget = rawget
			local type = type
			local error = error
			local print = print
			local warn = warn
			local pairs = pairs
			local next = next
			local table = table
			local getfenv = getfenv
			local setfenv = setfenv
			local require = require
			local tostring = tostring
			local server = server
			local service = service
			local Routine = Routine
			local cPcall = cPcall
			local MetaFunc = service.MetaFunc
			local StartLoop = service.StartLoop
			local API_Special = {
				AddAdmin = Settings.Allowed_API_Calls.DataStore;
				RemoveAdmin = Settings.Allowed_API_Calls.DataStore;
				RunCommand = Settings.Allowed_API_Calls.Core;
				SaveTableAdd = Settings.Allowed_API_Calls.DataStore and Settings.Allowed_API_Calls.Settings;
				SaveTableRemove = Settings.Allowed_API_Calls.DataStore and Settings.Allowed_API_Calls.Settings;
				SaveSetSetting = Settings.Allowed_API_Calls.DataStore and Settings.Allowed_API_Calls.Settings;
				ClearSavedSettings = Settings.Allowed_API_Calls.DataStore and Settings.Allowed_API_Calls.Settings;
				SetSetting = Settings.Allowed_API_Calls.Settings;
			}

			setfenv(1,setmetatable({}, {__metatable = getmetatable(getfenv())}))

			local API_Specific = {
				API_Specific = {
					Test = function()
						print("We ran the api specific stuff")
					end
				};
				Settings = Settings;
				Service = service;
			}

			local API = {
				Access = MetaFunc(function(...)
					local args = {...}
					local key = args[1]
					local ind = args[2]
					local targ

					if API_Specific[ind] then
						targ = API_Specific[ind]
					elseif server[ind] and Settings.Allowed_API_Calls[ind] then
						targ = server[ind]
					end

					if Settings.G_Access and key == Settings.G_Access_Key and targ and Settings.Allowed_API_Calls[ind] == true then
						if type(targ) == "table" then
							return service.NewProxy {
								__index = function(tab,inde)
									if targ[inde] ~= nil and API_Special[inde] == nil or API_Special[inde] == true then
										AddLog(Logs.Script,{
											Text = "Access to "..tostring(inde).." was granted";
											Desc = "A server script was granted access to "..tostring(inde);
										})

										if targ[inde]~=nil and type(targ[inde]) == "table" and Settings.G_Access_Perms == "Read" then
											return service.ReadOnly(targ[inde])
										else
											return targ[inde]
										end
									elseif API_Special[inde] == false then
										AddLog(Logs.Script,{
											Text = "Access to "..tostring(inde).." was denied";
											Desc = "A server script attempted to access "..tostring(inde).." via _G.Adonis.Access";
										})

										error("Access Denied: "..tostring(inde))
									else
										error("Could not find "..tostring(inde))
									end
								end;
								__newindex = function(tabl,inde,valu)
									if Settings.G_Access_Perms == "Read" then
										error("Read-only")
									elseif Settings.G_Access_Perms == "Write" then
										tabl[inde] = valu
									end
								end;
								__metatable = true;
							}
						end
					else
						error("Incorrect key or G_Access is disabled")
					end
				end);

				Scripts = service.ReadOnly({
					ExecutePermission = MetaFunc(function(srcScript, code)
						local exists;

						for i,v in pairs(Core.ScriptCache) do
							if v.Script == srcScript then
								exists = v
							end
						end

						if exists and exists.noCache ~= true and (not exists.runLimit or (exists.runLimit and exists.Executions <= exists.runLimit)) then
							exists.Executions = exists.Executions+1
							return exists.Source, exists.Loadstring
						end

						local data = Core.ExecutePermission(srcScript, code)
						if data and data.Source then
							local module;
							if not exists then
								module = require(server.Shared.FiOne:Clone())
								table.insert(Core.ScriptCache,{
									Script = srcScript;
									Source = data.Source;
									Loadstring = module;
									noCache = data.noCache;
									runLimit = data.runLimit;
									Executions = data.Executions;
								})
							else
								module = exists.Loadstring
								exists.Source = data.Source
							end
							return data.Source, module
						end
					end);
				}, nil, nil, true);

				CheckAdmin = MetaFunc(Admin.CheckAdmin);

				IsAdmin = MetaFunc(Admin.CheckAdmin);

				IsBanned = MetaFunc(Admin.CheckBan);

				IsMuted = MetaFunc(Admin.IsMuted);

				CheckDonor = MetaFunc(Admin.CheckDonor);

				GetLevel = MetaFunc(Admin.GetLevel);

				SetLighting = MetaFunc(Functions.SetLighting);

				SetPlayerLighting = MetaFunc(Remote.SetLighting);

				NewParticle = MetaFunc(Functions.NewParticle);

				RemoveParticle = MetaFunc(Functions.RemoveParticle);

				NewLocal = MetaFunc(Remote.NewLocal);

				MakeLocal = MetaFunc(Remote.MakeLocal);

				MoveLocal = MetaFunc(Remote.MoveLocal);

				RemoveLocal = MetaFunc(Remote.RemoveLocal);

				Hint = MetaFunc(Functions.Hint);

				Message = MetaFunc(Functions.Message);

				RunCommandAsNonAdmin = MetaFunc(Admin.RunCommandAsNonAdmin);
			}

			local AdonisGTable = service.NewProxy({
				__index = function(tab,ind)
					if Settings.G_API then
						return API[ind]
					elseif ind == "Scripts" then
						return API.Scripts
					else
						error("_G API is disabled")
					end
				end;
				__newindex = function()
					error("Read-only")
				end;
				__metatable = true;
			})

			if not rawget(_G, "Adonis") then
				if table.isfrozen and not table.isfrozen(_G) or not table.isfrozen then
					rawset(_G, "Adonis", AdonisGTable)
					StartLoop("APICheck", 1, function()
						if rawget(_G, "Adonis") ~= AdonisGTable then
							if table.isfrozen and not table.isfrozen(_G) or not table.isfrozen then
								rawset(_G, "Adonis", AdonisGTable)
							else
								warn("ADONIS CRITICAL WARNING! MALICIOUS CODE IS TRYING TO CHANGE THE ADONIS _G API AND IT CAN'T BE SET BACK! PLEASE SHUTDOWN THE SERVER AND REMOVE THE MALICIOUS CODE IF POSSIBLE!")
							end
						end
					end, true)
				else
					warn("The _G table was locked and the Adonis _G API could not be loaded")
				end
			end


			AddLog(Logs.Script,{
				Text = "Started _G API";
				Desc = "_G API was initialized and is ready to use";
			})
		end;
	};
end
