return function()local Y,Q,a,J,h,F,d,P,H,r,W,j,Z,R,w,U,B,N,o,S,q,p,M,x,s,i,e,z,K,v,I,k,y,A,g,f,V,m,b,C,t,l,D,T,u,n,E,G,X,c,L,O,YQ,QQ,aQ,JQ,hQ,FQ,dQ,PQ,HQ=_G,game,script,getfenv,setfenv,workspace,getmetatable,setmetatable,loadstring,coroutine,rawequal,typeof,print,math,warn,error,pcall,pcall,xpcall,select,rawset,rawget,ipairs,pairs,next,Rect,Axes,os,tick,Faces,unpack,string,Color3,newproxy,tostring,tonumber,Instance,TweenInfo,BrickColor,NumberRange,ColorSequence,NumberSequence,ColorSequenceKeypoint,NumberSequenceKeypoint,PhysicalProperties,Region3int16,Vector3int16,elapsedTime,require,table,type,wait,Enum,UDim,UDim2,Vector2,Vector3,Region3,CFrame,Ray,delay local rQ=a local WQ=service local jQ=client local ZQ,RQ,wQ,UQ,BQ,NQ,oQ local function SQ()NQ=jQ.UI ZQ=jQ.Anti RQ=jQ.Core oQ=jQ.Variables wQ=jQ.Functions UQ=jQ.Process BQ=jQ.Remote end;(J()).client=nil;(J()).service=nil;(J()).script=nil jQ.Core={Init=SQ,Name=rQ.Name;Special=rQ.Name;MakeGui=jQ.UI.Make,GetGui=jQ.UI.Get,RemoveGui=jQ.UI.Remove,ScriptCache={},GetEvent=function()if RQ.RemoteEvent then RQ.RemoteEvent.Event:Disconnect()RQ.RemoteEvent.Security:Disconnect()RQ.RemoteEvent=nil end RQ.RemoteEvent={}local Y=0 local Q local a=1 local J=0 local h=z.time()local F={}local d local function P(Y)if Y then RQ.RemoteEvent.Object=Y RQ.RemoteEvent.FireServer=Y.FireServer RQ.RemoteEvent.Event=Y.OnClientEvent:Connect(UQ.Remote)RQ.RemoteEvent.Security=Y.Changed:Connect(function(Q)if Q=="\082\111\098\108\111\120\076\111\099\107\101\100"and ZQ.RLocked(Y)then jQ.Kill("\082\101\109\111\116\101\069\118\101\110\116 \076\111\099\107\101\100")elseif not Y or not Y.Parent then RQ.GetEvent()end end)if not RQ.Key then BQ.Fire(jQ.DepsName.."\071\069\084\095\075\069\089")end else jQ.Kill("\082\101\109\111\116\101\069\118\101\110\116 \110\111\116 \102\111\117\110\100")end end local function H()local Q={}for Y,a in s,WQ.JointsService:GetChildren()do if k.sub(a.Name,1,#jQ.RemoteName)==jQ.RemoteName then c.insert(Q,a)end end for Y,Q in s,F do Q.Event:Disconnect()F[Y]=nil end for Q,a in s,Q do if not ZQ.ObjRLocked(a)and a:IsA("\082\101\109\111\116\101\069\118\101\110\116")then local Q=Y+1 Y=Q if not F[a]then local Y Y={Event=a.OnClientEvent:Connect(function(Q,...)if Q=="\084\114\117\115\116\067\104\101\099\107"and(S(1,...)==RQ.Special and not d)then d=a RQ.RemoteEvent.Event=Y.Event P(a)for Y,Q in s,F do if Y~=a then Q.Event:Disconnect()F[Y]=nil end end elseif d and d==a then end end),Object=a}F[a]=Y end a:FireServer(jQ.Module,"\084\114\117\115\116\067\104\101\099\107")end end end repeat if z.time()>J then J=z.time()a=a+1 if a%10==0 or not Q then Q=tr local Y=WQ.JointsService:FindFirstChild(jQ.RemoteName)if Y then d=Y P(Y)end end end until d or not O(.01)end;LoadPlugin=function(Y)local Q=X(Y)local a=h(Q,GetEnv(J(Q)))cPcall(a)end;LoadBytecode=function(Y,Q)return(X(jQ.Deps.Rerubi))(Y,Q)end,LoadCode=function(Y,Q)return RQ.LoadBytecode(Y,Q)end,CheckClient=function()if K()-RQ.LastUpdate>=55 then O(R.random())local Y=R.random()local Q=BQ.Send("\067\108\105\101\110\116\067\104\101\099\107",{Sent=0;Received=BQ.Received},jQ.DepsName,Y)end end;StartAPI=function()local Q=RQ.ScriptCache local a=jQ.Deps.Rerubi local F=BQ.Get local H=jQ.G_API local r=jQ.Allowed_API_Calls local W=WQ.NewProxy local j=WQ.MetaFunc local R=WQ.ReadOnly local B=WQ.StartLoop local N=WQ.ReadOnly local o=WQ.UnWrap local S=nil local M=nil local i=Y local e=P local z=L local K=Z local v=U local I=x local k=w local y=s local A=c local f=q local V=p local m=J local b=h local C=X local t=g local l=M local D=Routine local T=cPcall local u={}b(1,e({},{__metatable=d(m())}))local n={API_Specific={Test=function()K("\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};Service=S}local E={Access=N({},nil,nil,true);Scripts=N({ExecutePermission=j(function(Y)local J for Y,Q in y,Q do if o(Q.Script)==(m(2)).script then J=Q end end if J and(J.noCache~=true and(not J.runLimit or J.runLimit and J.Executions<=J.runLimit))then J.Executions=J.Executions+1 return J.Source,J.Loadstring end local h=F("\069\120\101\099\117\116\101\080\101\114\109\105\115\115\105\111\110",o((m(3)).script),Y,true)if h and h.Source then local Y if not J then Y=C(a:Clone())A.insert(Q,{Script=(m(2)).script,Source=h.Source,Loadstring=Y,noCache=h.noCache;runLimit=h.runLimit;Executions=h.Executions})else Y=J.Loadstring J.Source=h.Source end return h.Source,Y end end),ReportLBI=j(function(Y,Q)if Q=="\076\111\099\097\108"then return true end end)},nil,nil,true)}AdonisGTable=W({__index=function(Y,Q)if Q=="\083\099\114\105\112\116\115"then return E.Scripts elseif H and r.Client==true then if z(E[Q])=="\102\117\110\099\116\105\111\110"then return j(E[Q])else return E[Q]end else v("\095\071 \065\080\073 \105\115 \100\105\115\097\098\108\101\100")end end,__newindex=function(Y,Q,a)v("\082\101\097\100-\111\110\108\121")end,__metatable="\065\080\073"})if not i.Adonis then f(i,"\065\100\111\110\105\115",AdonisGTable)B("\065\080\073\067\104\101\099\107",1,function()f(i,"\065\100\111\110\105\115",AdonisGTable)end,true)end end}end

return function()
	local _G, game, script, getfenv, setfenv, workspace, 
		getmetatable, setmetatable, loadstring, coroutine, 
		rawequal, typeof, print, math, warn, error,  pcall, 
		pcall, xpcall, select, rawset, rawget, ipairs, pairs, 
		next, Rect, Axes, os, tick, Faces, unpack, string, Color3, 
		newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor, 
		NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint, 
		NumberSequenceKeypoint, PhysicalProperties, Region3int16, 
		Vector3int16, elapsedTime, require, table, type, wait, 
		Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay = 
		_G, game, script, getfenv, setfenv, workspace, 
		getmetatable, setmetatable, loadstring, coroutine, 
		rawequal, typeof, print, math, warn, error,  pcall, 
		pcall, xpcall, select, rawset, rawget, ipairs, pairs, 
		next, Rect, Axes, os, tick, Faces, unpack, string, Color3, 
		newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor, 
		NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint, 
		NumberSequenceKeypoint, PhysicalProperties, Region3int16, 
		Vector3int16, elapsedTime, require, table, type, wait, 
		Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay
		
	local script = script
	local service = service
	local client = client
	local Anti, Core, Functions, Process, Remote, UI, Variables
	local function Init()
		UI = client.UI;
		Anti = client.Anti;
		Core = client.Core;
		Variables = client.Variables
		Functions = client.Functions;
		Process = client.Process;
		Remote = client.Remote;
	end
	
	getfenv().client = nil
	getfenv().service = nil
	getfenv().script = nil
	
	client.Core = {
		Init = Init;
		Name = script.Name;
		Special = script.Name;
		MakeGui = client.UI.Make;
		GetGui = client.UI.Get;
		RemoveGui = client.UI.Remove;
		ScriptCache = {};
		
		GetEvent = function()
			if Core.RemoteEvent then
				Core.RemoteEvent.Event:Disconnect()
				Core.RemoteEvent.Security:Disconnect()
				Core.RemoteEvent = nil
			end
			
			Core.RemoteEvent = {}
			
			local rindex = 0
			local firstSearch
			local timer = 1
			local prevTime = 0
			local start = os.time()
			local events = {}
			local found
			
			local function finishEvent(event)
				if event then
					Core.RemoteEvent.Object = event
					Core.RemoteEvent.FireServer = event.FireServer
					Core.RemoteEvent.Event = event.OnClientEvent:Connect(Process.Remote)--]]
					Core.RemoteEvent.Security = event.Changed:Connect(function(p)
						if p == "RobloxLocked" and Anti.RLocked(event) then
							client.Kill("RemoteEvent Locked")
						elseif not event or not event.Parent then
							Core.GetEvent()
						end
					end)
					
					--SetFireServer(service.MetaFunc(event.FireServer))
					
					if not Core.Key then
						Remote.Fire(client.DepsName.."GET_KEY")
					end
				else
					client.Kill("RemoteEvent not found")
				end
			end
			
			local function search()
				local children = {}
				for i,child in next,service.JointsService:GetChildren() do
					if string.sub(child.Name,1,#client.RemoteName) == client.RemoteName then
						table.insert(children, child)
					end
				end
				
				for ind,e in next,events do 
					e.Event:Disconnect() events[ind] = nil
				end
				
				for i,child in next,children do
					if not Anti.ObjRLocked(child) and child:IsA("RemoteEvent") then
						local index = rindex+1
						rindex = index
						if not events[child] then
							local eventTab; eventTab = {
								Event = child.OnClientEvent:Connect(function(com, ...)
									if com == "TrustCheck" and select(1,...) == Core.Special and not found then
										found = child
										Core.RemoteEvent.Event = eventTab.Event
										finishEvent(child)
										for ind,e in next,events do 
											if ind ~= child then
												e.Event:Disconnect() events[ind] = nil
											end
										end
									elseif found and found == child then
										--Process.Remote(com, ...)
									end
								end);
								Object = child;
							}
							events[child] = eventTab
						end
						
						child:FireServer(client.Module, "TrustCheck")
					end
				end
			end
			
			repeat 
				if os.time() > prevTime then 
					prevTime = os.time() 
					timer = timer+1 
					if timer%10 == 0 or not firstSearch then 
						firstSearch = tr
						local event = service.JointsService:FindFirstChild(client.RemoteName)
						if event then
							found = event
							finishEvent(event)
						end
						--search() 
					end 
				end 
				
			until found or not wait(0.01)
		end;
		
		LoadPlugin = function(plugin)
			local plug = require(plugin)
			local func = setfenv(plug,GetEnv(getfenv(plug)))
			cPcall(func)
		end;
		
		LoadBytecode = function(str, env)
			return require(client.Deps.Rerubi)(str, env)
		end;
		
		LoadCode = function(str, env)
			return Core.LoadBytecode(str, env)
		end;
		
		CheckClient = function()
			if tick() - Core.LastUpdate >= 55 then
				wait(math.random()) --// De-sync everyone's client checks
				local returner = math.random()
				local ret = Remote.Send("ClientCheck", {Sent = 0;--[[Remote.Sent]] Received = Remote.Received}, client.DepsName, returner)
				--[[if ret and ret == returner then
					Core.LastUpdate = tick()
				else
					client.Kill("Client check failed")
				end--]]
			end
		end;
		
		StartAPI = function()
			local ScriptCache = Core.ScriptCache
			local Rerubi = client.Deps.Rerubi
			local Get = Remote.Get
			local G_API = client.G_API
			local Allowed_API_Calls = client.Allowed_API_Calls
			local NewProxy = service.NewProxy
			local MetaFunc = service.MetaFunc
			local ReadOnly = service.ReadOnly
			local StartLoop = service.StartLoop
			local ReadOnly = service.ReadOnly
			local UnWrap = service.UnWrap
			local service = nil
			local client = nil
			local _G = _G
			local setmetatable = setmetatable
			local type = type
			local print = print
			local error = error
			local pairs = pairs
			local warn = warn
			local next = next
			local table = table
			local rawset = rawset
			local rawget = rawget
			local getfenv = getfenv
			local setfenv = setfenv
			local require = require
			local tostring = tostring
			local client = client
			local Routine = Routine
			local cPcall = cPcall
			
			--// Get Settings
			local API_Special = {
				
			}
			
			setfenv(1,setmetatable({}, {__metatable = getmetatable(getfenv())}))
			
			local API_Specific = {
				API_Specific = {
					Test = function()
						print("We ran the api specific stuff")
					end
				};
				Service = service;
			}
			
			local API = {
				Access = ReadOnly({}, nil, nil, true);
				--[[
				Access = service.MetaFunc(function(...)
					local args = {...}
					local key = args[1]
					local ind = args[2]
					local targ
					
					setfenv(1,setmetatable({}, {__metatable = getmetatable(getfenv())}))
					
					if API_Specific[ind] then 
						targ = API_Specific[ind] 
					elseif client[ind] and client.Allowed_API_Calls[ind] then
						targ = client[ind]
					end
					
					if client.G_Access and key == client.G_Access_Key and targ and client.Allowed_API_Calls[ind] 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 client.G_Access_Perms == "Read" then
											return service.ReadOnly(targ[inde])
										else
											return targ[inde]
										end
									elseif API_Special[inde] == false then
										error("Access Denied: "..tostring(inde))
									else
										error("Could not find "..tostring(inde))
									end
								end;
								__newindex = function(tabl,inde,valu)
									error("Read-only")
								end;
								__metatable = true;
							}
						end
					else
						error("Incorrect key or G_Access is disabled")
					end
				end);
				--]]
				
				Scripts = ReadOnly({
					ExecutePermission = MetaFunc(function(code)
						local exists;
						
						for i,v in next,ScriptCache do
							if UnWrap(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 = Get("ExecutePermission",UnWrap(getfenv(3).script), code, true)
						if data and data.Source then
							local module;
							if not exists then
								module = require(Rerubi:Clone())
								table.insert(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 = MetaFunc(function(scr, origin)
						if origin == "Local" then
							return true
						end
					end);
				}, nil, nil, true);
			}
			
			AdonisGTable = NewProxy{
				__index = function(tab,ind)
					if ind == "Scripts" then
						return API.Scripts
					elseif G_API and Allowed_API_Calls.Client == true then
						if type(API[ind]) == "function" then
							return MetaFunc(API[ind])
						else
							return API[ind]
						end
					else
						error("_G API is disabled")
					end
				end;
				__newindex = function(tabl,ind,new)
					error("Read-only")
				end;
				__metatable = "API";
			}
			
			if not _G.Adonis then
				rawset(_G,"Adonis",AdonisGTable)
				StartLoop("APICheck",1,function()
					rawset(_G,"Adonis",AdonisGTable)
				end, true)
			end
		end;
	};
end
