return function()local E,S,c,o,C,f,X,O,j,r,H local function n()E=server.Functions S=server.Admin c=server.Anti o=server.Core C=server.HTTP f=server.Logs X=server.Remote O=server.Process j=server.Variables r=server.Settings H=server.Deps f:AddLog("\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 server.Core={Init=n;DataQueue={},DataCache={};ExecuteScripts={},LastDataSave=0;PanicMode=false,ScriptCache={},Connections={};Variables={TimeBans={}};Panic=function(E)local S=Instance.new("\072\105\110\116",service.Workspace)S.Text="-\061 \065\100\111\110\105\115 \080\097\110\105\099\077\111\100\101 \069\110\097\098\108\101\100\058 "..(tostring(E).." \061~")o.PanicMode=true warn("\083\079\077\069\084\072\073\078\071 \083\069\086\069\082\069 \072\065\080\080\069\078\069\068\059 \069\078\065\066\076\073\078\071 \080\065\078\073\067 \077\079\068\069\059 \082\069\065\083\079\078 \066\069\076\079\087\059")warn(tostring(E))warn("\069\078\065\066\076\073\078\071 \067\072\065\084 \077\079\068\069 \065\078\068 \068\073\083\065\066\076\073\078\071 \067\076\073\069\078\084 \067\072\069\067\075\083\059")warn("\077\079\068\083 \078\079\087 \072\065\086\069 \065\067\067\069\083\083 \084\079 \080\065\078\073\067 \067\079\077\077\065\078\068\083 \083\085\067\072 \065\083 \058\083\072\085\084\068\079\087\078")f.AddLog(f.Script,{Text="\069\078\065\066\076\069\068 \080\065\078\073\067 \077\079\068\069",Desc=tostring(E)})end;MakeEvent=function()local S,C=pcall(function()if c.RLocked(service.JointsService)then o.Panic("\074\111\105\110\116\115\083\101\114\118\105\099\101 \082\111\098\108\111\120\076\111\099\107\101\100")elseif server.Running then if o.RemoteEvent then o.RemoteEvent.Security:Disconnect()o.RemoteEvent.Event:Disconnect()o.RemoteEvent.DecoySecurity1:Disconnect()o.RemoteEvent.DecoySecurity2:Disconnect()pcall(function()service.Delete(o.RemoteEvent.Object)end)pcall(function()service.Delete(o.RemoteEvent.Decoy1)end)pcall(function()service.Delete(o.RemoteEvent.Decoy2)end)end o.RemoteEvent={}local S=service.New("\082\101\109\111\116\101\069\118\101\110\116")local c=S:Clone()local C=S:Clone()S.Name=o.Name c.Name=o.Name..E.GetRandom()C.Name=o.Name..E.GetRandom()S.Archivable=false c.Archivable=false C.Archivable=false o.RemoteEvent.Object=S o.RemoteEvent.Decoy1=c o.RemoteEvent.Decoy2=C S.Parent=service.JointsService local function j(E)return service.RbxEvent(E.Changed,function(E)if E=="\078\097\109\101"then S.Name=o.Name else o.MakeEvent()end end)end o.RemoteEvent.Event=service.RbxEvent(S.OnServerEvent,O.Remote)service.RbxEvent(c.OnServerEvent,function(E,S,o,C)local f=X.Clients[tostring(E.userId)]if f and(o=="\084\114\117\115\116\067\104\101\099\107"and S==f.Module)then c:FireClient(E,"\084\114\117\115\116\067\104\101\099\107",f.Decoy1)end end)service.RbxEvent(C.OnServerEvent,function(E,S,o,C)local f=X.Clients[tostring(E.userId)]if f and(o=="\084\114\117\115\116\067\104\101\099\107"and S==f.Module)then c:FireClient(E,"\084\114\117\115\116\067\104\101\099\107",f.Decoy2)end end)o.RemoteEvent.Security=j(S)o.RemoteEvent.DecoySecurity1=j(c)o.RemoteEvent.DecoySecurity2=j(C)f.AddLog(f.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 C then warn(C)o.Panic("\069\114\114\111\114 \119\104\105\108\101 \109\097\107\105\110\103 \082\101\109\111\116\101\069\118\101\110\116")end end,CheckAllClients=function()if r.CheckClients and(not o.PanicMode and server.Running)then f.AddLog(f.Script,{Text="\067\104\101\099\107\105\110\103 \067\108\105\101\110\116\115";Desc="\077\097\107\105\110\103 \115\117\114\101 \097\108\108 \099\108\105\101\110\116\115 \097\114\101 \097\099\116\105\118\101"})local E=service.NetworkServer or service.Players local S=service.NetworkServer or false for E,o in next,E:GetChildren()do if S then o=o:GetPlayer()end if o then if c.ObjRLocked(o)then c.Detected(o,"\107\105\099\107","\082\111\098\108\111\120\076\111\099\107\101\100")else local E=X.Clients[tostring(o.userId)]if E and E.LoadingStatus=="\082\069\065\068\089"then local S=E.LastUpdate if S and tick()-S>300 then c.Detected(o,"\107\105\099\107","\067\108\105\101\110\116 \078\111\116 \082\101\115\112\111\110\100\105\110\103 \091\067\108\105\101\110\116 \104\097\115\110\'\116 \099\104\101\099\107\101\100 \105\110 \062\053 \109\105\110\117\116\101\115\093")end end end end end end end,UpdateConnections=function()if service.NetworkServer then for E,S in next,service.NetworkServer:GetChildren()do o.Connections[S]=S:GetPlayer()end end end;UpdateConnection=function(E)if service.NetworkServer then for S,c in next,service.NetworkServer:GetChildren()do if c:GetPlayer()==E then o.Connections[c]=E end end end end;GetNetworkClient=function(E)if service.NetworkServer then for S,c in pairs(service.NetworkServer:GetChildren())do if c:GetPlayer()==E then return c end end end end;SetupEvent=function(E)local S=tostring(E.userId)local C=X.Clients[S]if C and(C.EventName and(E and not c.ObjRLocked(E)))then local S=Instance.new("\082\101\109\111\116\101\069\118\101\110\116")S.Name=C.EventName S.Changed:connect(function()if c.RLocked(S)or not S or S.Parent~=E then service.Delete(S)o.SetupEvent(E)end end)S.OnServerEvent:connect(function(S,...)if S==E then O.Remote(S,...)end end)S.Parent=E else E:Kick("\076\111\099\107\101\100")end end,PrepareClient=function()if service.NetworkServer and server.Running then local E,S=pcall(function()if o.ClientLoader then pcall(function()o.ClientLoaderEvent:Disconnect()service.Delete(o.ClientLoader)end)end local E=H.ClientLoader:Clone()E.Archivable=false E.Name="\000"E.Parent=service.ReplicatedFirst E.Disabled=false o.ClientLoader=E o.ClientLoaderEvent=E.Changed:connect(function()o.PrepareClient()end)end)if S or not E then o.Panic("\067\097\110\110\111\116 \108\111\097\100 \067\108\105\101\110\116\076\111\097\100\101\114 "..tostring(S))end end end,HookClient=function(S)local c=tostring(S.userId)local C=X.Clients[c]if C then local c=E:GetRandom()local f=E:GetRandom()local X=server.Client:Clone()local O=X.Client X.Name="\065\100\111\110\105\115\095\067\108\105\101\110\116"local j=service.New("\083\116\114\105\110\103\086\097\108\117\101")j.Value=o.Name..("\092"..c)j.Name="\083\112\101\099\105\097\108"j.Parent=X C.Loader=o.ClientLoader C.Special=c C.EventName=f C.Module=O service.Events[S.userId.."\095\067\076\073\069\078\084\076\079\065\068\069\082"]:connectOnce(function()if X.Parent==S then X:Destroy()end end)local r,H=pcall(function()X.Parent=S end)if not o.PanicMode and not r then S:Kick("\076\111\097\100\105\110\103 \069\114\114\111\114 \091\072\111\111\107\067\108\105\101\110\116 \069\114\114\111\114\058 "..(tostring(H).."\093"))return false else return true end else if S then S:Kick("\076\111\097\100\105\110\103 \069\114\114\111\114 \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(E)local S=H.ClientLoader:Clone()S.Name=math.random(0,9)..(math.random(0,9)..(math.random(0,9)..(math.random(0,9)..(math.random(0,9)..(math.random(0,9)..(math.random(0,9)..(math.random(0,9)..(math.random(0,9)..(math.random(0,9)..math.random(0,9))))))))))S.Parent=E:WaitForChild("\066\097\099\107\112\097\099\107")S.Disabled=false end,LoadExistingPlayer=function(E)o.LoadClientLoader(E)O.PlayerAdded(E)end;MakeClient=function()local E,S=pcall(function()if c.RLocked(service.StarterPlayer)then o.Panic("\083\116\097\114\116\101\114\080\108\097\121\101\114 \082\111\098\108\111\120\076\111\099\107\101\100")else local E=service.StarterPlayer:FindFirstChild(o.Name)if not E then E=service.New("\083\116\097\114\116\101\114\080\108\097\121\101\114\083\099\114\105\112\116\115",service.StarterPlayer)E.Name=o.Name E.Changed:connect(function(S)if S=="\080\097\114\101\110\116"then o.MakeClient()elseif S=="\078\097\109\101"then E.Name=o.Name elseif S=="\082\111\098\108\111\120\076\111\099\107\101\100"and c.RLocked(E)then o.Panic("\080\108\097\121\101\114\083\099\114\105\112\116\115 \082\111\098\108\111\120\076\111\099\107\101\100")end end)E.ChildAdded:connect(function(E)if E.Name~=o.Name then wait(.5)E:Destroy()end end)end E:ClearAllChildren()if c.RLocked(E)then o.Panic("\083\116\097\114\116\101\114\080\108\097\121\101\114\083\099\114\105\112\116\115 \082\111\098\108\111\120\076\111\099\107\101\100")else if o.Client then local E=o.Client if c.ObjRLocked(E.Object)then o.Panic("\067\108\105\101\110\116 \082\111\098\108\111\120\076\111\099\107\101\100")else o.Client.Security:disconnect()pcall(function()o.Client.Object:Destroy()end)end end o.Client={}local S=H.Client:clone()S.Name=o.Name;(server.ClientDeps:Clone()).Parent=S S.Parent=E S.Disabled=false o.Client.Object=S o.Client.Security=S.Changed:connect(function(E)if E=="\080\097\114\101\110\116"or E=="\082\111\098\108\111\120\076\111\099\107\101\100"then o.MakeClient()end end)end end end)if S then print(S)o.Panic("\069\114\114\111\114 \119\104\105\108\101 \109\097\107\105\110\103 \099\108\105\101\110\116")end end,ExecutePermission=function(E,S,c)for o,C in next,o.ExecuteScripts do if not c or c and C.Type=="\076\111\099\097\108\083\099\114\105\112\116"then if(service.UnWrap(C.Script)==service.UnWrap(E)or S==C.Code)and(not C.runLimit or C.runLimit~=nil and C.Executions<=C.runLimit)then C.Executions=C.Executions+1 return{Source=C.Source;noCache=C.noCache;runLimit=C.runLimit,Executions=C.Executions}end end end end;GetScript=function(E,S)for c,o in next,o.ExecuteScripts do if o.Script==E or S==o.Code then return o,c end end end,UnRegisterScript=function(E)for S,c in next,o.ExecuteScripts do if c.Script==E or c==E then table.remove(o.ExecuteScripts,S)return c end end end,RegisterScript=function(S)S.Executions=0 S.Time=os.time()S.Type=S.Script.ClassName S.Wrapped=service.Wrap(S.Script)S.Wrapped:SetSpecial("\067\108\111\110\101",function()return o.RegisterScript({Script=(service.UnWrap(S.Script)):Clone();Code=S.Code;Source=S.Source,noCache=S.noCache;runLimit=S.runLimit})end)for E,c in next,o.ExecuteScripts do if c.Script==S.Script then return c.Wrapped or c.Script end end if not S.Code then S.Code=E.GetRandom()end table.insert(o.ExecuteScripts,S)return S.Wrapped end;Loadstring=function(E,S)return(require(H.Loadstring:Clone()))(E,S)end,Bytecode=function(E)local S,c=o.Loadstring(E)return c end,NewScript=function(S,c,C,f,X)local O local j=E.GetRandom()if S=="\083\099\114\105\112\116"then O=H.ScriptBase:Clone()elseif S=="\076\111\099\097\108\083\099\114\105\112\116"then O=H.LocalScriptBase:Clone()end if O then O.Name=S if C then local E=Instance.new("\083\116\114\105\110\103\086\097\108\117\101",O)E.Name="\069\120\101\099\117\116\101"E.Value=j end local E=o.RegisterScript({Script=O;Code=j;Source=o.Bytecode(c),noCache=f;runLimit=X})return E or O,O,j end end,DoSave=function(S)local c=S.Type if c=="\067\108\101\097\114\083\101\116\116\105\110\103\115"then o.SetData("\083\097\118\101\100\083\101\116\116\105\110\103\115",{})o.SetData("\083\097\118\101\100\084\097\098\108\101\115",{})elseif c=="\083\101\116\083\101\116\116\105\110\103"then local E=S.Setting local c=S.Value o.UpdateData("\083\097\118\101\100\083\101\116\116\105\110\103\115",function(S)S[E]=c return S end)elseif c=="\084\097\098\108\101\082\101\109\111\118\101"then local c=S.Table local C=S.Value S.Time=os.time()o.UpdateData("\083\097\118\101\100\084\097\098\108\101\115",function(o)o=o or{}for S,f in next,o do if c==f.Table then if E.CheckMatch(f.Value,C)then table.remove(o,S)end end end S.Action="\082\101\109\111\118\101"table.insert(o,S)return o end)elseif c=="\084\097\098\108\101\065\100\100"then local c=S.Table local C=S.Value S.Time=os.time()o.UpdateData("\083\097\118\101\100\084\097\098\108\101\115",function(o)o=o or{}for S,f in next,o do if c==f.Table then if E.CheckMatch(f.Value,C)then table.remove(o,S)end end end S.Action="\065\100\100"table.insert(o,S)return o end)end f.AddLog(f.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,SavePlayer=function(E,S)local c=tostring(E.userId)X.PlayerData[c]=S end,DefaultData=function(E)return{Donor={Cape={Image="\048";Color="\087\104\105\116\101",Material="\078\101\111\110"},Enabled=false};Banned=false,TimeBan=false;AdminNotes={};Keybinds={},Client={},Warnings={};AdminPoints=0}end;GetPlayer=function(E)local S=tostring(E.userId)local c=o.DefaultData(E)if not X.PlayerData[S]then X.PlayerData[S]=c if o.DataStore then local E=o.GetData(S)if E and type(E)=="\116\097\098\108\101"then for E,S in next,E do c[E]=S end end end else c=X.PlayerData[S]end return c end,ClearPlayer=function(E)X.PlayerData[tostring(E.userId)]=o.DefaultData(E)end;SavePlayerData=function(E)local S=tostring(E.userId)local c=X.PlayerData[S]if c and o.DataStore then c.LastChat=nil c.AdminLevel=nil c.LastLevelUpdate=nil o.SetData(S,c)X.PlayerData[S]=nil f.AddLog(f.Script,{Text="\083\097\118\101\100 \100\097\116\097 \102\111\114 "..tostring(E);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"})end end,GetDataStore=function()local E=0 local S={}local c={}local o={}local C,f=pcall(function()return service.DataStoreService:GetDataStore(r.DataStore:sub(1,50),"\065\100\111\110\105\115")end)return C and f end;DataStoreEncode=function(S)return E.Base64Encode(X.Encrypt(tostring(S),r.DataStoreKey))end;SaveData=function(...)return o.SetData(...)end,SetData=function(E,S)if o.DataStore then local c,C=pcall(o.DataStore.SetAsync,o.DataStore,o.DataStoreEncode(E),S)if c then o.DataCache[E]=S return C 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(C))end end end;UpdateData=function(E,S)if o.DataStore then local c,C=pcall(o.DataStore.UpdateAsync,o.DataStore,o.DataStoreEncode(E),S)if c then return C else 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(C))end end end;GetData=function(E)if o.DataStore then local S,c=pcall(o.DataStore.GetAsync,o.DataStore,o.DataStoreEncode(E))if S then o.DataCache[E]=c return c 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(c))return o.DataCache[E]end end end;LoadData=function(S,c)local C local X local O={DataStoreKey=true}if o.DataStore and r.DataStoreEnabled then if not S then C=o.GetData("\083\097\118\101\100\083\101\116\116\105\110\103\115")X=o.GetData("\083\097\118\101\100\084\097\098\108\101\115")elseif S and not c then if S=="\083\097\118\101\100\083\101\116\116\105\110\103\115"then C=o.GetData("\083\097\118\101\100\083\101\116\116\105\110\103\115")elseif S=="\083\097\118\101\100\084\097\098\108\101\115"then X=o.GetData("\083\097\118\101\100\084\097\098\108\101\115")end elseif S and c then if S=="\083\097\118\101\100\083\101\116\116\105\110\103\115"then C=c elseif S=="\083\097\118\101\100\084\097\098\108\101\115"then X=c end end if not S and not c then if not C then C={}o.SaveData("\083\097\118\101\100\083\101\116\116\105\110\103\115",{})end if not X then X={}o.SaveData("\083\097\118\101\100\084\097\098\108\101\115",{})end end if C then for E,S in next,C do if not O[E]then if E=="\080\114\101\102\105\120"or E=="\065\110\121\080\114\101\102\105\120"or E=="\083\112\101\099\105\097\108\080\114\101\102\105\120"then local c=r[E]for E,o in pairs(server.Commands)do if o.Prefix==c then o.Prefix=S end end end r[E]=S end end end if X then for S,c in next,X do local C=c.Parent=="\086\097\114\105\097\098\108\101\115"and o.Variables or r if not O[c.Table]and C[c.Table]~=nil then if c.Action=="\065\100\100"then local S=C[c.Table]if S then for S,o in next,S do if E.CheckMatch(o,c.Value)then table.remove(C[c.Table],S)end end end f.AddLog("\083\099\114\105\112\116",{Text="\065\100\100\101\100 \116\111 "..tostring(c.Table),Desc="\065\100\100\101\100 "..(tostring(c.Value)..(" \116\111 "..(tostring(c.Table).." \102\114\111\109 \100\097\116\097\115\116\111\114\101")))})table.insert(C[c.Table],c.Value)elseif c.Action=="\082\101\109\111\118\101"then local S=C[c.Table]if S then for S,o in next,S do if E.CheckMatch(o,c.Value)then f.AddLog("\083\099\114\105\112\116",{Text="\082\101\109\111\118\101\100 \102\114\111\109 "..tostring(c.Table);Desc="\082\101\109\111\118\101\100 "..(tostring(c.Value)..(" \102\114\111\109 "..(tostring(c.Table).." \102\114\111\109 \100\097\116\097\115\116\111\114\101")))})table.remove(C[c.Table],S)end end end end end end if o.Variables.TimeBans then for E,S in next,o.Variables.TimeBans do if S.EndTime-os.time()<=0 then table.remove(o.Variables.TimeBans,E)o.DoSave({Type="\084\097\098\108\101\082\101\109\111\118\101",Table="\084\105\109\101\066\097\110\115",Parent="\086\097\114\105\097\098\108\101\115",Value=S})end end end end f.AddLog(f.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,StartAPI=function()local c=_G local O=setmetatable local j=rawset local n=rawget local v=type local s=error local w=print local l=warn local M=pairs local W=next local F=table local K=getfenv local T=setfenv local m=require local D=tostring local b=server local B=service local A=Routine local q=cPcall local i={AddAdmin=r.Allowed_API_Calls.DataStore,RemoveAdmin=r.Allowed_API_Calls.DataStore,RunCommand=r.Allowed_API_Calls.Core;SaveTableAdd=r.Allowed_API_Calls.DataStore and r.Allowed_API_Calls.Settings,SaveTableRemove=r.Allowed_API_Calls.DataStore and r.Allowed_API_Calls.Settings;SaveSetSetting=r.Allowed_API_Calls.DataStore and r.Allowed_API_Calls.Settings;ClearSavedSettings=r.Allowed_API_Calls.DataStore and r.Allowed_API_Calls.Settings;SetSetting=r.Allowed_API_Calls.Settings}T(1,O({},{__metatable=getmetatable(K())}))local U={API_Specific={Test=function()w("\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=r,Service=B}local G={Access=B.MetaFunc(function(...)local E={...}local S=E[1]local c=E[2]local o if U[c]then o=U[c]elseif b[c]and r.Allowed_API_Calls[c]then o=b[c]end if r.G_Access and(S==r.G_Access_Key and(o and r.Allowed_API_Calls[c]==true))then if v(o)=="\116\097\098\108\101"then return B.NewProxy({__index=function(E,S)if o[S]~=nil and i[S]==nil or i[S]==true then if o[S]~=nil and(v(o[S])=="\116\097\098\108\101"and r.G_Access_Perms=="\082\101\097\100")then return B.ReadOnly(o[S])else return o[S]end f.AddLog(f.Script,{Text="\065\099\099\101\115\115 \116\111 "..(D(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 "..D(S)})elseif i[S]==false then f.AddLog(f.Script,{Text="\065\099\099\101\115\115 \116\111 "..(D(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 "..(D(S).." \118\105\097 \095\071\046\065\100\111\110\105\115\046\065\099\099\101\115\115")})s("\065\099\099\101\115\115 \068\101\110\105\101\100\058 "..D(S))else s("\067\111\117\108\100 \110\111\116 \102\105\110\100 "..D(S))end end;__newindex=function(E,S,c)if r.G_Access_Perms=="\082\101\097\100"then s("\082\101\097\100-\111\110\108\121")elseif r.G_Access_Perms=="\087\114\105\116\101"then E[S]=c end end,__metatable=true})end else s("\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=B.ReadOnly({ExecutePermission=function(E)local S if not r.CodeExecution then return nil end for E,c in M(o.ScriptCache)do if c.Script==(K(2)).script then S=c end end if S and(S.noCache~=true and(not S.runLimit or S.runLimit and S.Executions<=S.runLimit))then S.Executions=S.Executions+1 return S.Source,S.Loadstring end local c=o.ExecutePermission((K(2)).script,E)if c and c.Source then local E if not S then E=m(H.Loadstring.Rerubi:Clone())F.insert(o.ScriptCache,{Script=(K(2)).script,Source=c.Source,Loadstring=E,noCache=c.noCache,runLimit=c.runLimit,Executions=c.Executions})else E=S.Loadstring S.Source=c.Source end return c.Source,E end end;ReportLBI=function(E,S)if S=="\083\101\114\118\101\114"then return true end end},nil,nil,true),CheckAdmin=B.MetaFunc(S.CheckAdmin),CheckDonor=B.MetaFunc(S.CheckDonor),GetLevel=B.MetaFunc(S.GetLevel);CheckAgent=B.MetaFunc(C.Trello.CheckAgent);SetLighting=B.MetaFunc(E.SetLighting);SetPlayerLighting=B.MetaFunc(X.SetLighting),NewParticle=B.MetaFunc(E.NewParticle),RemoveParticle=B.MetaFunc(E.RemoveParticle);NewLocal=B.MetaFunc(X.NewLocal),MakeLocal=B.MetaFunc(X.MakeLocal),MoveLocal=B.MetaFunc(X.MoveLocal),RemoveLocal=B.MetaFunc(X.RemoveLocal);Hint=B.MetaFunc(E.Hint);Message=B.MetaFunc(E.Message)}local L=B.NewProxy({__index=function(E,S)if r.G_API then return G[S]elseif S=="\083\099\114\105\112\116\115"then return G.Scripts else s("\095\071 \065\080\073 \105\115 \100\105\115\097\098\108\101\100")end end,__newindex=function(E,S,c)s("\082\101\097\100-\111\110\108\121")end;__metatable=true})if not c.Adonis then j(c,"\065\100\111\110\105\115",L)A(B.StartLoop,"\065\080\073\067\104\101\099\107",1,function()j(c,"\065\100\111\110\105\115",L)end)end f.AddLog(f.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()
	local Functions, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Settings, Deps
	local function Init()
		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
		
		Logs:AddLog("Script", "Core Module Initialized")
	end;
	
	server.Core = {
		Init = Init;
		DataQueue = {};
		DataCache = {};
		ExecuteScripts = {};
		LastDataSave = 0;
		PanicMode = false;
		ScriptCache = {};
		Connections = {};
		Variables = {
			TimeBans = {};
		};
		
		Panic = function(reason)
			local hint = Instance.new("Hint", service.Workspace)
			hint.Text = "-= Adonis PanicMode Enabled: "..tostring(reason).." =~"
			Core.PanicMode = true;
			
			warn("SOMETHING SEVERE HAPPENED; ENABLING PANIC MODE; REASON BELOW;")
			warn(tostring(reason))
			warn("ENABLING CHAT MODE AND DISABLING CLIENT CHECKS;")
			warn("MODS NOW HAVE ACCESS TO PANIC COMMANDS SUCH AS :SHUTDOWN")
			
			--[[
			for i,v in pairs(service.Players:GetPlayers()) do 
				cPcall(function()
					v.Chatted:connect(function(msg)
						Process.Chat(v,msg)
					end)
				end)
			end
			--]]
			
			Logs.AddLog(Logs.Script,{
				Text = "ENABLED PANIC MODE";
				Desc = tostring(reason);
			})
		end;
		
		MakeEvent = function()
			local ran,error = pcall(function()
				if Anti.RLocked(service.JointsService) then
					Core.Panic("JointsService RobloxLocked")
				elseif server.Running then
					if Core.RemoteEvent then
						Core.RemoteEvent.Security:Disconnect()
						Core.RemoteEvent.Event:Disconnect()
						Core.RemoteEvent.DecoySecurity1:Disconnect()
						Core.RemoteEvent.DecoySecurity2:Disconnect()
						pcall(function() service.Delete(Core.RemoteEvent.Object) end)
						pcall(function() service.Delete(Core.RemoteEvent.Decoy1) end)
						pcall(function() service.Delete(Core.RemoteEvent.Decoy2) end)
					end
					
					Core.RemoteEvent = {}
					
					local event = service.New("RemoteEvent")
					local decoy1 = event:Clone()
					local decoy2 = event:Clone()
					
					event.Name = Core.Name--..Functions.GetRandom() -- Core.Name
					decoy1.Name = Core.Name..Functions.GetRandom()
					decoy2.Name = Core.Name..Functions.GetRandom()
					
					event.Archivable = false
					decoy1.Archivable = false
					decoy2.Archivable = false
					
					Core.RemoteEvent.Object = event
					Core.RemoteEvent.Decoy1 = decoy1
					Core.RemoteEvent.Decoy2 = decoy2
					
					event.Parent = service.JointsService
					--decoy1.Parent = service.JointsService
					--decoy2.Parent = service.JointsService
					
					local function secure(ev)
						return service.RbxEvent(ev.Changed, function(p)
							if p=="Name" then
								event.Name = Core.Name--..Functions.GetRandom()--Core.Name
							else
								Core.MakeEvent()
							end
						end)
					end
					
					Core.RemoteEvent.Event = service.RbxEvent(event.OnServerEvent, Process.Remote)
					service.RbxEvent(decoy1.OnServerEvent, function(p,modu,com,sub)
						local keys = Remote.Clients[tostring(p.userId)]
						if keys and com == "TrustCheck" and modu == keys.Module then
							decoy1:FireClient(p,"TrustCheck",keys.Decoy1)
						end
					end)
					
					service.RbxEvent(decoy2.OnServerEvent, function(p,modu,com,sub)
						local keys = Remote.Clients[tostring(p.userId)]
						if keys and com == "TrustCheck" and modu == keys.Module then
							decoy1:FireClient(p,"TrustCheck",keys.Decoy2)
						end
					end)
					
					Core.RemoteEvent.Security = secure(event)
					Core.RemoteEvent.DecoySecurity1 = secure(decoy1)
					Core.RemoteEvent.DecoySecurity2 = secure(decoy2)
					Logs.AddLog(Logs.Script,{
						Text = "Created RemoteEvent";
						Desc = "RemoteEvent was successfully created";
					})
				end
			end)
			
			if error then
				warn(error)
				Core.Panic("Error while making RemoteEvent")
			end
		end;
		
		CheckAllClients = function()
			if Settings.CheckClients and not Core.PanicMode and server.Running then
				Logs.AddLog(Logs.Script,{
					Text = "Checking Clients";
					Desc = "Making sure all clients are active";
				})
				local parent = service.NetworkServer or service.Players
				local net = service.NetworkServer or false
				for ind,p in next,parent:GetChildren() do
					if net then p = p:GetPlayer() end
					if p then
						if Anti.ObjRLocked(p) then
							Anti.Detected(p, "kick", "RobloxLocked")
						else
							local client = Remote.Clients[tostring(p.userId)]
							if client and client.LoadingStatus == "READY" then
								local lastTime = client.LastUpdate
								if lastTime and tick()-lastTime > 60*5 then
									Anti.Detected(p, "kick","Client Not Responding [Client hasn't checked in >5 minutes]")
								end
							end
						end
					end
				end
			end
		end;
		
		UpdateConnections = function()
			if service.NetworkServer then
				for i,cli in next,service.NetworkServer:GetChildren() do
					Core.Connections[cli] = cli:GetPlayer()
				end
			end
		end;
		
		UpdateConnection = function(p)
			if service.NetworkServer then
				for i,cli in next,service.NetworkServer:GetChildren() do
					if cli:GetPlayer() == p then
						Core.Connections[cli] = p
					end
				end
			end
		end;
		
		GetNetworkClient = function(p)
			if service.NetworkServer then
				for i,v in pairs(service.NetworkServer:GetChildren()) do
					if v:GetPlayer() == p then
						return v
					end
				end
			end
		end;
		
		SetupEvent = function(p)
			local key = tostring(p.userId)
			local keys = Remote.Clients[key]
			if keys and keys.EventName and p and not Anti.ObjRLocked(p) then
				local event = Instance.new("RemoteEvent")
				event.Name = keys.EventName
				event.Changed:connect(function()
					if Anti.RLocked(event) or not event or event.Parent ~= p then
						service.Delete(event)
						Core.SetupEvent(p)
					end
				end)
				event.OnServerEvent:connect(function(np,...)
					if np == p then
						Process.Remote(np,...)
					end
				end)
				event.Parent = p
			else
				p:Kick("Locked")
			end
		end;
		
		PrepareClient = function()
			if service.NetworkServer and server.Running then
				local ran,err = pcall(function()
					if Core.ClientLoader then 
						pcall(function() Core.ClientLoaderEvent:Disconnect() service.Delete(Core.ClientLoader) end) 
					end
					local loader = Deps.ClientLoader:Clone()
					loader.Archivable = false
					loader.Name = "\0"
					loader.Parent = service.ReplicatedFirst
					loader.Disabled = false
					
					Core.ClientLoader = loader
					Core.ClientLoaderEvent = loader.Changed:connect(function() 
						Core.PrepareClient()
					end)
				end)
				
				if err or not ran then 
					Core.Panic("Cannot load ClientLoader "..tostring(err))
				end
			end
		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 client = folder.Client
				
				folder.Name = "Adonis_Client" --Core.Name.."\\"..depsName
				
				local specialVal = service.New("StringValue")
				specialVal.Value = Core.Name.."\\"..depsName
				specialVal.Name = "Special"
				specialVal.Parent = folder
				
				keys.Loader = Core.ClientLoader
				keys.Special = depsName
				keys.EventName = eventName
				keys.Module = client
				
				service.Events[p.userId.."_CLIENTLOADER"]:connectOnce(function()
					if folder.Parent == p then
						folder:Destroy()
					end
				end)
				
				local ok,err = pcall(function()
					folder.Parent = p
				end)
				
				if not Core.PanicMode and not ok then
					p:Kick("Loading Error [HookClient Error: "..tostring(err).."]") 
					return false
				else
					return true
				end
			else
				if p then p:Kick("Loading Error [HookClient: Keys Missing]") end
			end
		end;
		
		LoadClientLoader = function(p)
			local loader = Deps.ClientLoader:Clone()
			loader.Name = math.random(0,9)..math.random(0,9)..math.random(0,9)..math.random(0,9)..math.random(0,9)..math.random(0,9)..math.random(0,9)..math.random(0,9)..math.random(0,9)..math.random(0,9)..math.random(0,9)
			loader.Parent = p:WaitForChild("Backpack")
			loader.Disabled = false
		end;
		
		LoadExistingPlayer = function(p)
			Core.LoadClientLoader(p)
			Process.PlayerAdded(p)
		end;
		
		MakeClient = function()
			local ran,error = pcall(function()
				if Anti.RLocked(service.StarterPlayer) then
					Core.Panic("StarterPlayer RobloxLocked")
				else
					local starterScripts = service.StarterPlayer:FindFirstChild(Core.Name)
					if not starterScripts then
						starterScripts = service.New("StarterPlayerScripts",service.StarterPlayer)
						starterScripts.Name = Core.Name
						starterScripts.Changed:connect(function(p)
							if p=="Parent" then
								Core.MakeClient()
							elseif p=="Name" then
								starterScripts.Name = Core.Name
							elseif p=="RobloxLocked" and Anti.RLocked(starterScripts) then
								Core.Panic("PlayerScripts RobloxLocked")
							end
						end)
						starterScripts.ChildAdded:connect(function(c)
							if c.Name~=Core.Name then
								wait(0.5)
								c:Destroy()
							end
						end)
					end
					starterScripts:ClearAllChildren()
					if Anti.RLocked(starterScripts) then
						Core.Panic("StarterPlayerScripts RobloxLocked")
					else
						if Core.Client then
							local cli = Core.Client
							if Anti.ObjRLocked(cli.Object) then
								Core.Panic("Client RobloxLocked")
							else
								Core.Client.Security:disconnect()
								pcall(function() Core.Client.Object:Destroy() end)
							end
						end
						Core.Client = {}
						local client = Deps.Client:clone()
						client.Name = Core.Name
						server.ClientDeps:Clone().Parent = client
						client.Parent = starterScripts
						client.Disabled = false
						Core.Client.Object = client
						Core.Client.Security = client.Changed:connect(function(p)
							if p == "Parent" or p == "RobloxLocked" then
								Core.MakeClient()
							end
						end)
					end
				end
			end)
			if error then
				print(error)
				Core.Panic("Error while making client")
			end
		end;
		
		ExecutePermission = function(scr, code, isLocal)
			for i,val in next,Core.ExecuteScripts do
				if not isLocal or (isLocal and val.Type == "LocalScript") then
					if (service.UnWrap(val.Script) == service.UnWrap(scr) 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 next,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 next,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 next,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;
		
		Loadstring = function(str, env)
			return require(Deps.Loadstring:Clone())(str, env)
		end;
		
		Bytecode = function(str)
			local f,buff = Core.Loadstring(str)
			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 = type
				
				if allowCodes then
					local exec = Instance.new("StringValue",ScriptType)
					exec.Name = "Execute"
					exec.Value = execCode
				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;
		
		DoSave = function(data)
			local type = data.Type
			if type == "ClearSettings" then
				Core.SetData("SavedSettings",{})
				Core.SetData("SavedTables",{})
			elseif type == "SetSetting" then
				local setting = data.Setting
				local value = data.Value
				Core.UpdateData("SavedSettings", function(settings)
					settings[setting] = value
					return settings
				end)
			elseif type == "TableRemove" then
				local tab = data.Table
				local value = data.Value
				data.Time = os.time()
				Core.UpdateData("SavedTables", function(sets)
					sets = sets or {}
					for i,v in next,sets do 
						if tab == v.Table then
							if Functions.CheckMatch(v.Value,value) then
								table.remove(sets,i)
							end
						end
					end
					data.Action = "Remove"
					table.insert(sets,data)
					return sets
				end)
			elseif type == "TableAdd" then
				local tab = data.Table
				local value = data.Value
				data.Time = os.time()
				Core.UpdateData("SavedTables", function(sets)
					sets = sets or {}
					for i,v in next,sets do 
						if tab == v.Table then
							if Functions.CheckMatch(v.Value,value) then
								table.remove(sets,i)
							end
						end
					end
					data.Action = "Add"
					table.insert(sets,data)
					return sets
				end)
			end
			
			Logs.AddLog(Logs.Script,{
				Text = "Saved setting change to datastore";
				Desc = "A setting change was issued and saved";
			})
		end;
		
		SavePlayer = function(p,data)
			local key = tostring(p.userId)
			Remote.PlayerData[key] = data
		end;
		
		DefaultData = function(p)
			return {
				Donor = {
					Cape = {
						Image = '0';
						Color = 'White';
						Material = 'Neon';
					};
					Enabled = false;
				};
				Banned = false;
				TimeBan = false;
				AdminNotes = {};
				Keybinds = {};
				Client = {};
				Warnings = {};
				AdminPoints = 0;
			};
		end;
		
		GetPlayer = function(p)
			local key = tostring(p.userId)
			local PlayerData = Core.DefaultData(p)
			
			if not Remote.PlayerData[key] then
				Remote.PlayerData[key] = PlayerData
				if Core.DataStore then
					local data = Core.GetData(key)
					if data and type(data) == "table" then
						for i,v in next,data do
							PlayerData[i] = v
						end
					end
				end
			else
				PlayerData = Remote.PlayerData[key]
			end
			return PlayerData
		end;
		
		ClearPlayer = function(p)
			Remote.PlayerData[tostring(p.userId)] = Core.DefaultData(p);
		end;
		
		SavePlayerData = function(p)
			local key = tostring(p.userId)
			local data = Remote.PlayerData[key]
			if data and Core.DataStore then
				data.LastChat = nil
				data.AdminLevel = nil
				data.LastLevelUpdate = nil
				Core.SetData(key, data)
				Remote.PlayerData[key] = nil
				Logs.AddLog(Logs.Script,{
					Text = "Saved data for "..tostring(p);
					Desc = "Player data was saved to the datastore";
				})
			end
		end;
		
		GetDataStore = function()
			local lastUpdate = 0
			local keyCache = {}
			local saveCache = {}
			local updateCache = {}
			local ran,store = pcall(function() return service.DataStoreService:GetDataStore(Settings.DataStore:sub(1,50),"Adonis") end)
			
			--[[
			
			--// Todo:
			--// Implement reru's idea
			--// AutoAssign a server to handle datastore updates
			--// Cache all datastore updates
			--// Update everything using one UpdateAsync per server every 30-60 seconds 
			--// Have main server handle check for new data and update datastore keys accordingly			
			
			if ran and store then
				local original = store:GetObject()
				local prepareTable; prepareTable = function(tab)
					if true then return tab end
					if type(tab) == "table" then
						local tabUpdates = {}
						for i,v in next,tab do
							tab[i] = prepareTable(v)
						end
						
						return setmetatable(tab,{
							__newindex = function(old, ind, val)
								table.insert(tabUpdates,{
									
								})
							end
						}), tabUpdates
					else
						return tab
					end
				end		
				
				store:SetSpecial("SetAsync", function(wrapped, key, value)
					table.insert(updateCache, {
						Key = key;
						Time = os.time;
						Value = value;
					})
					
					keyCache[key] = value
				end)
				
				store:SetSpecial("UpdateAsync", function(wrapped, key, func)
					original:UpdateAsync(key, function(data)
						local metaTab,tabUpdates = prepareTable(data)
						local returns = func(metaTab)
						if type(data) == "table" and tabUpdates then
							 
						end
					end)
				end)
				
				store:SetSpecial("GetAsync", function(wrapped, key)
					if not keyCache[key] then
						keyCache[key] = original:GetAsync(key)
					end
					
					return keyCache[key]
				end)
				
				store:SetSpecial("Update", function(wrapped)
					lastUpdate = os.time()
					keyCache = {}
				end)
				
				service.StartLoop("DataUpdate",30,store.Update,true)
			end--]]
			
			return ran and store
		end;
		
		DataStoreEncode = function(key)
			return Functions.Base64Encode(Remote.Encrypt(tostring(key), Settings.DataStoreKey))
		end;
		
		SaveData = function(...)
			return Core.SetData(...)
		end;
		
		SetData = function(key, value)
			if Core.DataStore then
				local ran, ret = pcall(Core.DataStore.SetAsync, Core.DataStore, Core.DataStoreEncode(key), value)
				if ran then
					Core.DataCache[key] = value
					return ret
				else
					logError("DataStore SetAsync Failed: ".. tostring(ret))
				end
			end
		end;
		
		UpdateData = function(key, func)
			if Core.DataStore then
				local ran, ret = pcall(Core.DataStore.UpdateAsync, Core.DataStore, Core.DataStoreEncode(key), func)
				if ran then
					return ret
				else
					logError("DataStore UpdateAsync Failed: ".. tostring(ret))
				end
			end
		end;
		
		GetData = function(key)
			if Core.DataStore then
				local ran, ret = pcall(Core.DataStore.GetAsync, Core.DataStore, Core.DataStoreEncode(key))
				if ran then
					Core.DataCache[key] = ret
					return ret
				else
					logError("DataStore GetAsync Failed: ".. tostring(ret))
					return Core.DataCache[key]
				end
			end
		end;
		
		LoadData = function(key, data)
			local SavedSettings
			local SavedTables
			local Blacklist = {DataStoreKey = true;}
			if Core.DataStore and Settings.DataStoreEnabled then
				if not key then
					SavedSettings = Core.GetData("SavedSettings")
					SavedTables = Core.GetData("SavedTables")
				elseif key and not data then
					if key == "SavedSettings" then
						SavedSettings = Core.GetData("SavedSettings")
					elseif key == "SavedTables" then
						SavedTables = Core.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 = {} 
						Core.SaveData("SavedSettings",{}) 
					end
					
					if not SavedTables then 
						SavedTables = {} 
						Core.SaveData("SavedTables",{}) 
					end
				end
				
				if SavedSettings then
					for setting,value in next,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 ind,tab in next,SavedTables do
						local parentTab = (tab.Parent == "Variables" and Core.Variables) or Settings
						if (not Blacklist[tab.Table]) and parentTab[tab.Table] ~= nil then
							if tab.Action == "Add" then
								local tabl = parentTab[tab.Table]
								if tabl then
									for i,v in next,tabl do
										if Functions.CheckMatch(v,tab.Value) then
											table.remove(parentTab[tab.Table],i)
										end
									end
								end
								
								Logs.AddLog("Script",{
									Text = "Added to "..tostring(tab.Table);
									Desc = "Added "..tostring(tab.Value).." to "..tostring(tab.Table).." from datastore";
								})
								table.insert(parentTab[tab.Table],tab.Value)
							elseif tab.Action == "Remove" then
								local tabl = parentTab[tab.Table]
								if tabl then
									for i,v in next,tabl do
										if Functions.CheckMatch(v,tab.Value) then
											Logs.AddLog("Script",{
												Text = "Removed from "..tostring(tab.Table);
												Desc = "Removed "..tostring(tab.Value).." from "..tostring(tab.Table).." from datastore";
											})
											table.remove(parentTab[tab.Table],i)
										end
									end
								end
							end
						end
					end
					
					if Core.Variables.TimeBans then
						for i,v in next, Core.Variables.TimeBans do
							if v.EndTime-os.time() <= 0 then
								table.remove(Core.Variables.TimeBans, i)
								Core.DoSave({
									Type = "TableRemove";
									Table = "TimeBans";
									Parent = "Variables";
									Value = v;
								})
							end
						end
					end
				end
				
				Logs.AddLog(Logs.Script,{
					Text = "Loaded saved data";
					Desc = "Data was retrieved from the datastore and loaded successfully";
				})
			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 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 = service.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
										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
										Logs.AddLog(Logs.Script,{
											Text = "Access to "..tostring(inde).." was granted";
											Desc = "A server script was granted access to "..tostring(inde);
										})
									elseif API_Special[inde] == false then
										Logs.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 = function(code)
						local exists;
						
						if not Settings.CodeExecution then
							return nil
						end
						
						for i,v in pairs(Core.ScriptCache) do
							if v.Script == getfenv(2).script 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(getfenv(2).script,code)
						if data and data.Source then
							local module;
							if not exists then
								module = require(Deps.Loadstring.Rerubi:Clone())
								table.insert(Core.ScriptCache,{
									Script = getfenv(2).script; 
									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;
					
					ReportLBI = function(scr, origin)
						if origin == "Server" then
							return true
						end
					end;
				}, nil, nil, true);
				
				CheckAdmin = service.MetaFunc(Admin.CheckAdmin); 
				
				CheckDonor = service.MetaFunc(Admin.CheckDonor);
				
				GetLevel = service.MetaFunc(Admin.GetLevel);
				
				CheckAgent = service.MetaFunc(HTTP.Trello.CheckAgent);
				
				SetLighting = service.MetaFunc(Functions.SetLighting);
				
				SetPlayerLighting = service.MetaFunc(Remote.SetLighting);
				
				NewParticle = service.MetaFunc(Functions.NewParticle);
				
				RemoveParticle = service.MetaFunc(Functions.RemoveParticle);
				
				NewLocal = service.MetaFunc(Remote.NewLocal);
				
				MakeLocal = service.MetaFunc(Remote.MakeLocal);
				
				MoveLocal = service.MetaFunc(Remote.MoveLocal);
				
				RemoveLocal = service.MetaFunc(Remote.RemoveLocal);
				
				Hint = service.MetaFunc(Functions.Hint);
				
				Message = service.MetaFunc(Functions.Message);
			}
			
			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(tabl,ind,new)
					error("Read-only")
				end;
				__metatable = true;
			})
			
			if not _G.Adonis then
				rawset(_G,"Adonis",AdonisGTable)
				Routine(service.StartLoop,"APICheck",1,function()
					rawset(_G,"Adonis",AdonisGTable)
				end)
			end
			
			Logs.AddLog(Logs.Script,{
				Text = "Started _G API";
				Desc = "_G API was initialized and is ready to use";
			})
			
		end;
	};
end
