return function()local P,z,k,B,a,W,n,V,o,J,p,A,i,g,H,F,f,I,G,t,m,N,T,e,K,b,O,Z,l,E,X,C,u,y,S,s,d,U,D,Y,j,r,x,Q,h,L,c,q,M,w,R,v,PR,zR,kR,BR,aR,WR,nR,VR,oR=_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 JR=k local pR=service local AR=client local iR,gR,HR,FR,fR,IR,GR local function tR()IR=AR.UI iR=AR.Anti gR=AR.Core GR=AR.Variables HR=AR.Functions FR=AR.Process fR=AR.Remote end;(B()).client=nil;(B()).service=nil;(B()).script=nil AR.Remote={Init=tR;Returns={};PendingReturns={},EncodeCache={};DecodeCache={};Received=0,Sent=0;Returnables={Test=function(P)return"\072\069\076\076\079 \070\082\079\077 \084\072\069 \067\076\073\069\078\084 \083\073\068\069 \058\041\033 ",X(P)end;Ping=function(P)return fR.Ping()end;ClientHooked=function(P)return gR.Special end;TaskManager=function(P)local z=P[1]if z=="\071\101\116\084\097\115\107\115"then local P={}for z,k in K,pR.GetTasks()do local B={}B.Status=k.Status B.Name=k.Name B.Index=k.Index B.Created=k.Created B.CurrentTime=Z.time()B.Function=S(k.Function)w.insert(P,B)end return P end end;LoadCode=function(P)local z=P[1]local k=gR.LoadCode(z,GetEnv())if k then return k()end end;Function=function(P)local z=AR.Functions[P[1]]if z and R(z)=="\102\117\110\099\116\105\111\110"then return z(X(P,2))end end,Handler=function(P)local z=AR.Handlers[P[1]]if z and R(z)=="\102\117\110\099\116\105\111\110"then return z(X(P,2))end end;UIKeepAlive=function(P)if GR.UIKeepAlive then for P,z in K,AR.GUIs do if z.KeepAlive then if z.Class=="\083\099\114\101\101\110\071\117\105"or z.Class=="\071\117\105\077\097\105\110"then z.Object.Parent=pR.PlayerGui elseif z.Class=="\084\101\120\116\076\097\098\101\108"then z.Object.Parent=IR.GetHolder()end z.KeepAlive=false else z.KeepAlive=false end end end return"\068\111\110\101"end,UI=function(P)local z=P[1]local k=P[2]local B=P[3]return IR.Make(z,B,k)end,InstanceList=function(P)local z=pR.GetAdonisObjects()local k={}for P,z in K,z do w.insert(k,{Text=z:GetFullName();Desc=z.ClassName})end return k end,ClientLog=function(P)local z={}local function k(P,k,B)for P,a in K,pR.ExtractLines(P)do w.insert(z,{Text=a;Desc=k..a,Color=B})end end for P,z in K,pR.LogService:GetLogHistory()do if z.messageType==PR.MessageType.MessageOutput then k(z.message,"\079\117\116\112\117\116\058 ")elseif z.messageType==PR.MessageType.MessageWarning then k(z.message,"\087\097\114\110\105\110\103\058 ",u.new(1,1,0))elseif z.messageType==PR.MessageType.MessageInfo then k(z.message,"\073\110\102\111\058 ",u.new(0,0,1))elseif z.messageType==PR.MessageType.MessageError then k(z.message,"\069\114\114\111\114\058 ",u.new(1,0,0))end end return z end};UnEncrypted={LightingChange=function(P,z)i(P,"\084\073\067\075\076\069 \077\069\033\063")GR.LightingChanged=true pR.Lighting[P]=z iR.LastChanges.Lighting=P v(.1)GR.LightingChanged=false i("\084\073\067\075\076\069\068 \058\041",GR.LightingChanged)if iR.LastChanges.Lighting==P then iR.LastChanges.Lighting=nil end end};Commands={GetReturn=function(P)local z=P[1]local k=P[2]local B={X(P,3)}local a=fR.Returnables[z]local W=a and{I(a,B)}or{}if W[1]~=true then logError(W[2])fR.Send("\071\105\118\101\082\101\116\117\114\110",k,"\095\095\065\068\079\078\073\083\095\082\069\084\085\082\078\095\069\082\082\079\082",W[2])else fR.Send("\071\105\118\101\082\101\116\117\114\110",k,X(W,2))end end;GiveReturn=function(P)if fR.PendingReturns[P[1]]then fR.PendingReturns[P[1]]=nil pR.Events[P[1]]:fire(X(P,2))end end;SetVariables=function(P)local z=P[1]for P,z in K,z do GR[P]=z end end;Print=function(P)i(X(P))end,FireEvent=function(P)pR.FireEvent(X(P))end,Test=function(P)i("\079\075 \087\069 \071\079\084 \067\079\077\077\085\078\073\067\065\084\073\079\078\033  \079\082\071\076\058 "..S(P[1]))end;TestError=function(P)F("\084\072\073\083 \073\083 \065 \084\069\083\084 \069\082\082\079\082")end,TestEvent=function(P)fR.PlayerEvent(P[1],X(P,2))end;LoadCode=function(P)local z=P[1]local k=gR.LoadCode(z,GetEnv())if k then return k()end end,LaunchAnti=function(P)iR.Launch(P[1],P[2])end,UI=function(P)local z=P[1]local k=P[2]local B=P[3]IR.Make(z,B,k)end,RemoveUI=function(P)IR.Remove(P[1],P[2])end,StartLoop=function(P)local z=P[1]local k=P[2]local B=P[3]local a=gR.LoadCode(B,GetEnv())if z and(k and(B and a))then pR.StartLoop(z,k,a)end end,StopLoop=function(P)pR.StopLoop(P[1])end;Function=function(P)local z=AR.Functions[P[1]]if z and R(z)=="\102\117\110\099\116\105\111\110"then Pcall(z,X(P,2))end end;Handler=function(P)local z=AR.Handlers[P[1]]if z and R(z)=="\102\117\110\099\116\105\111\110"then Pcall(z,X(P,2))end end},Fire=function(...)local P=gR.RemoteEvent if P and P.Object then fR.Sent=fR.Sent+1 P.Object:FireServer({Module=AR.Module,Loader=AR.Loader;Sent=fR.Sent,Received=fR.Received},...)end end,Send=function(P,...)gR.LastUpdate=l()fR.Fire(fR.Encrypt(P,gR.Key),...)end;Get=function(P,...)local z local k=HR:GetRandom()local B=pR.Events[k]:Connect(function(...)z={...}end)fR.PendingReturns[k]=true fR.Send("\071\101\116\082\101\116\117\114\110",P,k,...)if not z then z={B:Wait()}end B:Disconnect()if z then if z[1]=="\095\095\065\068\079\078\073\083\095\082\069\084\085\082\078\095\069\082\082\079\082"then F(z[2])else return X(z)end else return nil end end,Ping=function()local P=l()local z=fR.Get("\080\105\110\103")if not z then return false end local k=l()local B=1000.0 local a=(g.floor((k-P)*B+.5)/B)*100 return a end,PlayerEvent=function(P,...)fR.Send("\080\108\097\121\101\114\069\118\101\110\116",P,...)end;Encrypt=function(P,z,k)local B=k or fR.EncodeCache or{}if not z or not P then return P elseif B[z]and B[z][P]then return B[z][P]else local k=B[z]or{}local a=C.byte local W=g.abs local n=C.sub local V=C.len local o=C.char local J={}for k=1,V(P),1 do local B=k%V(z)+1 J[k]=C.char((a(n(P,k,k))+a(n(z,B,B)))%126+1)end J=w.concat(J)B[z]=k k[P]=J return J end end,Decrypt=function(P,z,k)local B=k or fR.DecodeCache or{}if not z or not P then return P elseif B[z]and B[z][P]then return B[z][P]else local k=B[z]or{}local a=C.byte local W=g.abs local n=C.sub local V=C.len local o=C.char local J={}for k=1,V(P),1 do local B=k%V(z)+1 J[k]=C.char((a(n(P,k,k))-a(n(z,B,B)))%126-1)end J=w.concat(J)B[z]=k k[P]=J return J 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.Remote = {
		Init = Init;
		Returns = {};
		PendingReturns = {};
		EncodeCache = {};
		DecodeCache = {};
		Received = 0;
		Sent = 0;
		
		Returnables = {
			Test = function(args)
				return "HELLO FROM THE CLIENT SIDE :)! ", unpack(args)
			end;
			
			Ping = function(args)
				return Remote.Ping()
			end;
			
			ClientHooked = function(args)
				return Core.Special
			end;
			
			TaskManager = function(args)
				local action = args[1]
				if action == "GetTasks" then
					local tab = {}
					for i,v in next,service.GetTasks() do
						local new = {}
						new.Status = v.Status
						new.Name = v.Name
						new.Index = v.Index
						new.Created = v.Created
						new.CurrentTime = os.time()
						new.Function = tostring(v.Function)
						table.insert(tab,new)
					end
					return tab
				end
			end;
			
			LoadCode = function(args)
				local code = args[1]
				local func = Core.LoadCode(code, GetEnv())
				if func then
					return func()
				end
			end;
			
			Function = function(args)
				local func = client.Functions[args[1]]
				if func and type(func) == "function" then
					return func(unpack(args, 2))
				end
			end;
				
			Handler = function(args)
				local handler = client.Handlers[args[1]]
				if handler and type(handler) == "function" then
					return handler(unpack(args, 2))
				end
			end;
			
			UIKeepAlive = function(args)
				if Variables.UIKeepAlive then
					for ind,g in next,client.GUIs do
						if g.KeepAlive then
							if g.Class == "ScreenGui" or g.Class == "GuiMain" then
								g.Object.Parent = service.PlayerGui
							elseif g.Class == "TextLabel" then
								g.Object.Parent = UI.GetHolder()
							end
							g.KeepAlive = false
						else
							g.KeepAlive = false
						end
					end
				end
				return "Done"
			end;
			
			UI = function(args)
				local guiName = args[1]
				local themeData = args[2]
				local guiData = args[3]
				
				--Core.Theme = themeData
				return UI.Make(guiName,guiData,themeData)
			end;
			
			InstanceList = function(args)
				local objects = service.GetAdonisObjects()
				local temp = {}
				for i,v in next,objects do
					table.insert(temp, {
						Text = v:GetFullName();
						Desc = v.ClassName;
					})
				end
				return temp
			end;
			
			ClientLog = function(args)
				local temp={}
				local function toTab(str, desc, color)
					for i,v in next,service.ExtractLines(str) do
						table.insert(temp,{Text = v,Desc = desc..v, Color = color})
					end
				end
				
				for i,v in next,service.LogService:GetLogHistory()do
					if v.messageType==Enum.MessageType.MessageOutput then
						toTab(v.message, "Output: ")
						--table.insert(temp,{Text=v.message,Desc='Output: '..v.message})
					elseif v.messageType==Enum.MessageType.MessageWarning then
						toTab(v.message, "Warning: ", Color3.new(1,1,0))
						--table.insert(temp,{Text=v.message,Desc='Warning: '..v.message,Color=Color3.new(1,1,0)})
					elseif v.messageType==Enum.MessageType.MessageInfo then
						toTab(v.message, "Info: ", Color3.new(0,0,1))
						--table.insert(temp,{Text=v.message,Desc='Info: '..v.message,Color=Color3.new(0,0,1)})
					elseif v.messageType==Enum.MessageType.MessageError then
						toTab(v.message, "Error: ", Color3.new(1,0,0))
						--table.insert(temp,{Text=v.message,Desc='Error: '..v.message,Color=Color3.new(1,0,0)})
					end
				end
				
				return temp
			end
		};
		
		UnEncrypted = {
			LightingChange = function(prop,val)
				print(prop,"TICKLE ME!?")
				Variables.LightingChanged = true
				service.Lighting[prop] = val
				Anti.LastChanges.Lighting = prop
				wait(.1)
				Variables.LightingChanged = false
				print("TICKLED :)",Variables.LightingChanged)
				if Anti.LastChanges.Lighting == prop then
					Anti.LastChanges.Lighting = nil
				end
			end
		};
		
		Commands = {
			GetReturn = function(args)
				local com = args[1]
				local key = args[2]
				local parms = {unpack(args,3)}
				local retfunc = Remote.Returnables[com]
				local retable = (retfunc and {pcall(retfunc,parms)}) or {}
				if retable[1] ~= true then
					logError(retable[2])
					Remote.Send("GiveReturn", key, "__ADONIS_RETURN_ERROR", retable[2])
				else
					Remote.Send("GiveReturn", key, unpack(retable,2))
				end
			end;
			
			GiveReturn = function(args)
				if Remote.PendingReturns[args[1]] then
					Remote.PendingReturns[args[1]] = nil
					service.Events[args[1]]:fire(unpack(args,2))
				end
			end;
			
			SetVariables = function(args)
				local vars = args[1]
				for var,val in next,vars do
					Variables[var] = val
				end
			end;
			
			Print = function(args)
				print(unpack(args))
			end;
			
			FireEvent = function(args)
				service.FireEvent(unpack(args))
			end;
			
			Test = function(args)
				print("OK WE GOT COMMUNICATION!  ORGL: "..tostring(args[1]))
			end;
			
			TestError = function(args)
				error("THIS IS A TEST ERROR")
			end;
			
			TestEvent = function(args)
				Remote.PlayerEvent(args[1],unpack(args,2))
			end;
			
			LoadCode = function(args)
				local code = args[1]
				local func = Core.LoadCode(code, GetEnv())
				if func then
					return func()
				end
			end;
			
			LaunchAnti = function(args)
				Anti.Launch(args[1],args[2])
			end;
			
			UI = function(args)
				local guiName = args[1]
				local themeData = args[2]
				local guiData = args[3]
				
				--Core.Theme = themeData
				UI.Make(guiName,guiData,themeData)
			end;
			
			RemoveUI = function(args)
				UI.Remove(args[1],args[2])
			end;
			
			StartLoop = function(args)
				local name = args[1]
				local delay = args[2]
				local code = args[3]
				local func = Core.LoadCode(code, GetEnv())
				if name and delay and code and func then
					service.StartLoop(name,delay,func)
				end
			end;
			
			StopLoop = function(args)
				service.StopLoop(args[1])
			end;
			
			Function = function(args)
				local func = client.Functions[args[1]]
				if func and type(func) == "function" then
					Pcall(func,unpack(args,2))
				end
			end;
			
			Handler = function(args)
				local handler = client.Handlers[args[1]]
				if handler and type(handler) == "function" then
					Pcall(handler, unpack(args, 2))
				end
			end
		};
		
		Fire = function(...)
			local RemoteEvent = Core.RemoteEvent
			if RemoteEvent and RemoteEvent.Object then
				Remote.Sent = Remote.Sent+1
				RemoteEvent.Object:FireServer({Module = client.Module, Loader = client.Loader, Sent = Remote.Sent, Received = Remote.Received},...)
			end
		end;
		
		Send = function(com,...)
			Core.LastUpdate = tick()
			Remote.Fire(Remote.Encrypt(com,Core.Key),...)
		end;
		
		Get = function(com,...)
			local returns
			local key = Functions:GetRandom()
			local event = service.Events[key]:Connect(function(...) returns = {...} end)
			
			Remote.PendingReturns[key] = true
			Remote.Send("GetReturn",com,key,...)
			
			if not returns then
				returns = {event:Wait()}
			end
			
			event:Disconnect()
			
			if returns then
				if returns[1] == "__ADONIS_RETURN_ERROR" then
					error(returns[2])
				else
					return unpack(returns)
				end
			else
				return nil
			end
		end;
		
		Ping = function()
			local t = tick()
			local ping = Remote.Get("Ping")
			if not ping then return false end
			local t2 = tick()
			local mult = 10^3
			local ms = ((math.floor((t2-t)*mult+0.5)/mult)*100)
			return ms
		end;
		
		PlayerEvent = function(event,...)
			Remote.Send("PlayerEvent",event,...)
		end;
		
		Encrypt = function(str, key, cache)
			local cache = cache or Remote.EncodeCache or {}
			if not key or not str then 
				return str
			elseif cache[key] and cache[key][str] then
				return cache[key][str]
			else
				local keyCache = cache[key] or {}
				local byte = string.byte
				local abs = math.abs
				local sub = string.sub
				local len = string.len
				local char = string.char
				local endStr = {}
				
				for i = 1,len(str) do
					local keyPos = (i%len(key))+1
					endStr[i] = string.char(((byte(sub(str, i, i)) + byte(sub(key, keyPos, keyPos)))%126) + 1)
				end
				
				endStr = table.concat(endStr)
				cache[key] = keyCache
				keyCache[str] = endStr
				return endStr
			end
		end;
		
		Decrypt = function(str, key, cache)
			local cache = cache or Remote.DecodeCache or {}
			if not key or not str then 
				return str 
			elseif cache[key] and cache[key][str] then
				return cache[key][str]
			else
				local keyCache = cache[key] or {}
				local byte = string.byte
				local abs = math.abs
				local sub = string.sub
				local len = string.len
				local char = string.char
				local endStr = {}
				
				for i = 1,len(str) do
					local keyPos = (i%len(key))+1
					endStr[i] = string.char(((byte(sub(str, i, i)) - byte(sub(key, keyPos, keyPos)))%126) - 1)
				end
				
				endStr = table.concat(endStr)
				cache[key] = keyCache
				keyCache[str] = endStr
				return endStr
			end
		end;
	}
end
