return function(z,p)if p then setfenv(1,p)end local K=service.Players.LocalPlayer local M=K:GetMouse()local b=service.UserInputService local h=z.gIndex local N=z.gTable local y=N.BindEvent local q=N.Object local P=z.Name local o=z.Icon local x=z.Size local D=z.Menu local H=z.Title local l=z.Ready local Q=z.Walls local I=z.NoHide local g=z.NoClose local C=z.OnReady local r=z.OnClose local L=z.OnResize local j=z.OnRefresh local E=z.OnMinimize local c=z.ContextMenu local s=z.ResetOnSpawn local v=z.CanKeepAlive local m=z.IconClicked local w=z.SizeLocked or z.SizeLock local Y=z.CanvasSize local a=z.Position local F=z.Content or z.Children local G=z.MinSize or{150,50}local i=z.MaxSize or{math.huge,math.huge}local d=M.Icon local T=false local f=false local V=false local n=true local U=service.CheckProperty local e={}local X local O local S local Z local t local u=q.Drag local W=u.Close local R=u.Hide local J=u.Icon local k=u.Title local A=u.Refresh local B=A.Spinner local z_=u.Main local p_=q.Desc local K_=q.Drag.Main.ScrollingFrame local M_=z_.LeftResizeIcon local b_=z_.RightResizeIcon local h_=z_.RightCorner local N_=z_.LeftCorner local y_=z_.RightSide local q_=z_.LeftSide local P_=z_.TopRight local o_=z_.TopLeft local x_=z_.Bottom local D_=z_.Top function Expand(z,p,K)local M=p:FindFirstChild("\076\097\098\101\108")if M then z.MouseLeave:Connect(function(K,M)if X==z then p.Visible=false end end)z.MouseMoved:Connect(function(b,h)X=z M.Text=K or z.Desc.Value local N=500 local y=(service.TextService:GetTextSize(K or z.Desc.Value,M.TextSize,M.Font,Vector2.new(1000,1000))).X local q=math.floor(y/500)q=q+1 if q<1 then q=1 end if y<500 then N=y end p.Size=UDim2.new(0,N+10,0,q*20+10)p.Position=UDim2.new(0,b+6,0,(h-40)-(q*20+10))p.Visible=true end)end end function getNextPos(z)local p,K for z,M in next,z:GetChildren()do if U(M,"\083\105\122\101")then if not p or M.AbsolutePosition.X+M.AbsoluteSize.X>p.AbsolutePosition.X+p.AbsoluteSize.X then p=M end if not K or M.AbsolutePosition.Y+M.AbsoluteSize.Y>p.AbsolutePosition.Y+p.AbsoluteSize.Y then K=M end end end return(not p or not K)and UDim2.new(0,0,0,0)or UDim2.new(p.Position.X.Scale,p.Position.X.Offset+p.AbsoluteSize.X,K.Position.Y.Scale,K.Position.Y.Offset+K.AbsoluteSize.Y)end function S(z,p)if p then local K=p.RunWhenDone and t(p.RunWhenDone,z)for p,M in next,p do if type(M)=="\116\097\098\108\101"then if not M.Parent then M.Parent=z end create(M.Class or M.ClassName or p,M)elseif type(M)=="\102\117\110\099\116\105\111\110"or type(M)=="\115\116\114\105\110\103"and not K then K=t(M,z)end end if K then K(z)end end end function Z()for z,p in ipairs(K.PlayerGui:GetChildren())do if p:FindFirstChild("\095\095\065\068\079\078\073\083\095\087\073\078\068\079\087")then p.DisplayOrder=100 end end q.DisplayOrder=101 end function O(z)local p=1 local K local M local b=R if R.Visible then p=p+1 end if W.Visible then p=p+1 end if A.Visible then p=p+1 end K=UDim2.new(1,-((30*p+5)+(p-1)),0,0)z.Position=z.Position or K z.Size=z.Size or b.Size z.BackgroundColor3=z.BackgroundColor3 or b.BackgroundColor3 z.BackgroundTransparency=z.BackgroundTransparency or b.BackgroundTransparency z.BorderSizePixel=z.BorderSizePixel or b.BorderSizePixel z.ZIndex=z.ZIndex or b.ZIndex z.TextColor3=z.TextColor3 or b.TextColor3 z.TextScaled=z.TextScaled or b.TextScaled z.TextStrokeColor3=z.TextStrokeColor3 or b.TextStrokeColor3 z.TextSize=z.TextSize or b.TextSize z.TextTransparency=z.TextTransparency or b.TextTransparency z.TextStrokeTransparency=z.TextStrokeTransparency or b.TextStrokeTransparency z.TextScaled=z.TextScaled or b.TextScaled z.TextWrapped=z.TextWrapped or b.TextWrapped z.Font=z.Font or b.Font z.Parent=u return create("\084\101\120\116\066\117\116\116\111\110",z)end function t(z,p)if type(z)=="\115\116\114\105\110\103"then if p then local K=GetEnv()K.Object=p return client.Core.LoadCode(z,K)else return client.Core.LoadCode(z)end else return z end end function create(z,p,K)local b=p or{}local h=b.Class or b.ClassName or z local N=K or e[h]and e[h]:Clone()or service.New(h)local P=b.Parent or N.Parent if p then b.Parent=nil if b.Class or b.ClassName then b.Class=nil b.ClassName=nil end if not b.BorderColor3 and U(N,"\066\111\114\100\101\114\067\111\108\111\114\051")then N.BorderColor3=dBorder end if not b.CanvasSize and U(N,"\067\097\110\118\097\115\083\105\122\101")then N.CanvasSize=dCanvasSize end if not b.BorderSizePixel and U(N,"\066\111\114\100\101\114\083\105\122\101\080\105\120\101\108")then N.BorderSizePixel=dPixelSize end if not b.BackgroundColor3 and U(N,"\066\097\099\107\103\114\111\117\110\100\067\111\108\111\114\051")then N.BackgroundColor3=dBackground end if not b.PlaceholderColor3 and U(N,"\080\108\097\099\101\104\111\108\100\101\114\067\111\108\111\114\051")then N.PlaceholderColor3=dPlaceholderColor end if not b.Transparency and(not b.BackgroundTransparency and U(N,"\084\114\097\110\115\112\097\114\101\110\099\121"))then N.BackgroundTransparency=dTransparency elseif b.Transparency then N.BackgroundTransparency=b.Transparency end if not b.TextColor3 and(not b.TextColor and U(N,"\084\101\120\116\067\111\108\111\114\051"))then N.TextColor3=dTextColor elseif b.TextColor then N.TextColor3=b.TextColor end if not b.Font and U(N,"\070\111\110\116")then b.Font=dFont end if not b.TextSize and U(N,"\084\101\120\116\083\105\122\101")then b.TextSize=dTextSize end if not b.BottomImage and(not b.MidImage and(not b.TopImage and h=="\083\099\114\111\108\108\105\110\103\070\114\097\109\101"))then N.BottomImage=dScrollImage N.MidImage=dScrollImage N.TopImage=dScrollImage end if not b.Size and U(N,"\083\105\122\101")then N.Size=dSize end if not b.Position and U(N,"\080\111\115\105\116\105\111\110")then N.Position=dPosition end if not b.ZIndex and U(N,"\090\073\110\100\101\120")then N.ZIndex=dZIndex if P and U(P,"\090\073\110\100\101\120")then N.ZIndex=P.ZIndex end end if b.TextChanged and h=="\084\101\120\116\066\111\120"then local z=t(b.TextChanged,N)N.FocusLost:Connect(function(p)z(N.Text,p,N)end)end if(b.OnClicked or b.OnClick)and(h=="\084\101\120\116\066\117\116\116\111\110"or h=="\073\109\097\103\101\066\117\116\116\111\110")then local z=false local p=b.Debounce local K=t(b.OnClicked or b.OnClick,N)N.MouseButton1Down:Connect(function()if not z then if p then z=true end K(N)z=false end end)end if b.Events then for z,p in pairs(b.Events)do local K=t(p,N)y(N[z],function(...)K(...)end)end end if b.Visible==nil then b.Visible=true end if b.LabelProps then b.LabelProperties=b.LabelProps end end if h=="\069\110\116\114\121"then local z=N.Text local p=N.Dots local K=N.Desc z.ZIndex=b.ZIndex or N.ZIndex p.ZIndex=b.ZIndex or N.ZIndex if b.Text then N.Text.Text=b.Text N.Text.Visible=true b.Text=nil end if b.Desc or b.ToolTip then N.Desc.Value=b.Desc or b.ToolTip b.Desc=nil end Expand(N,p_)else if b.ToolTip then Expand(N,p_,b.ToolTip)end end if h=="\066\117\116\116\111\110\069\110\116\114\121"then local z=N.Button local p=false local K=t(b.OnClicked,z)N:SetSpecial("\068\111\067\108\105\099\107",function()if not p then p=true if K then K(z)end p=false end end)N.Text=b.Text or N.Text z.ZIndex=b.ZIndex or N.ZIndex z.MouseButton1Down:Connect(N.DoClick)end if h=="\066\111\111\108\101\097\110"then local z=b.Enabled local p=false local K=t(b.OnToggle,N)local function M(M)if not p then p=true if M~=nil and M or M==nil and z then z=false N.Text="\068\105\115\097\098\108\101\100"elseif M~=nil and M==false or M==nil and not z then z=true N.Text="\069\110\097\098\108\101\100"end if K then K(z,N)end p=false end end N.Text=z and"\069\110\097\098\108\101\100"or"\068\105\115\097\098\108\101\100"N.MouseButton1Down:Connect(function()if K then M()end end)N:SetSpecial("\084\111\103\103\108\101",function(z,p)M(p)end)end if h=="\083\116\114\105\110\103\069\110\116\114\121"then local z=N.Box local p N.Text=b.Text or N.Text z.ZIndex=b.ZIndex or N.ZIndex if b.BoxText then z.Text=b.BoxText end if b.BoxProperties then for p,K in next,b.BoxProperties do if U(z,p)then z[p]=K end end end if b.TextChanged then local K=t(b.TextChanged,z)z.Changed:Connect(function(M)if M=="\084\101\120\116"and not p then K(z.Text)end end)z.FocusLost:Connect(function(M)local b=K(z.Text,true,M)if b then p=true z.Text=b p=false end end)end N:SetSpecial("\083\101\116\086\097\108\117\101",function(p,K)z.Text=K end)end if h=="\083\108\105\100\101\114"then local z=false local p=N.Percentage local K=N.Slider local h=N.SliderBar local y=N.Drag local q=false local P=0 local o=t(b.OnSlide,N)h.ZIndex=b.ZIndex or N.ZIndex K.ZIndex=h.ZIndex+1 y.ZIndex=K.ZIndex+1 y.Active=true if b.Value then K.Position=UDim2.new(.5,-10,.5,-10)y.Position=K.Position end h.InputBegan:Connect(function(z)if not q and z.UserInputType==Enum.UserInputType.MouseButton1 then P=(M.X-N.AbsolutePosition.X)/N.AbsoluteSize.X if P<0 then P=0 elseif P>1 then P=1 end K.Position=UDim2.new(P,-10,.5,-10)y.Position=K.Position p.Value=P if o then o(P)end end end)y.DragBegin:Connect(function()q=true end)y.DragStopped:Connect(function()q=false y.Position=K.Position end)y.Changed:Connect(function()if q then P=(M.X-N.AbsolutePosition.X)/N.AbsoluteSize.X if P<0 then P=0 elseif P>1 then P=1 end K.Position=UDim2.new(P,-10,.5,-10)p.Value=P if o then o(P)end end end)N:SetSpecial("\083\101\116\086\097\108\117\101",function(z,M)if M and tonumber(M)then P=tonumber(M)p.Value=P K.Position=UDim2.new(P,-10,.5,-10)y.Position=K.Position end end)end if h=="\068\114\111\112\100\111\119\110"then local z=N.Menu local p=N.Down local K=N.dSelected local M=b.Options local h=b.Selected or b.Selection local y=t(b.OnSelection or b.OnSelect or function() end)local P=b.TextProperties local o=create("\083\099\114\111\108\108\105\110\103\070\114\097\109\101",{Parent=z;Size=UDim2.new(1,0,1,0),Position=UDim2.new(0,0,0,0);BackgroundTransparency=1,ZIndex=100})z.ZIndex=o.ZIndex z.Parent=q z.Visible=false z.Size=UDim2.new(0,N.AbsoluteSize.X,0,100)z.BackgroundColor3=b.BackgroundColor3 or N.BackgroundColor3 if b.TextAlignment then K.TextXAlignment=b.TextAlignment K.Position=UDim2.new(0,30,0,0)end if b.NoArrow then p.Visible=false end N:SetSpecial("\077\101\110\117\067\111\110\116\097\105\110\101\114",z)N.Changed:Connect(function(h)if h=="\065\098\115\111\108\117\116\101\080\111\115\105\116\105\111\110"and z.Visible then z.Position=UDim2.new(0,N.AbsolutePosition.X,0,N.AbsolutePosition.Y+N.AbsoluteSize.Y)elseif h=="\065\098\115\111\108\117\116\101\083\105\122\101"or h=="\080\097\114\101\110\116"then p.Size=UDim2.new(0,N.AbsoluteSize.Y,1,0)if b.TextAlignment=="\082\105\103\104\116"then p.Position=UDim2.new(0,0,.5,-(p.AbsoluteSize.X/2))K.Position=UDim2.new(0,N.AbsoluteSize.Y,0,0)else p.Position=UDim2.new(1,-p.AbsoluteSize.X,.5,-(p.AbsoluteSize.X/2))end K.Size=UDim2.new(1,-p.AbsoluteSize.X,1,0)if M and#M<=6 then z.Size=UDim2.new(0,N.AbsoluteSize.X,0,30*#M)else z.Size=UDim2.new(0,N.AbsoluteSize.X,0,180)o:ResizeCanvas(false,true)end end end)K.ZIndex=N.ZIndex p.ZIndex=N.ZIndex if P then for z,p in next,P do K[z]=p end end if M then for p,M in next,M do local b=o:Add("\084\101\120\116\066\117\116\116\111\110",{Text="  "..tostring(M),Size=UDim2.new(1,-10,0,30);Position=UDim2.new(0,5,0,30*(p-1)),ZIndex=z.ZIndex,BackgroundTransparency=1,OnClick=function()K.Text=M y(M,N)z.Visible=false end})if P then for z,p in next,P do b[z]=p end end end if h then K.Text=h else K.Text="\078\111 \083\101\108\101\099\116\105\111\110"end K.MouseButton1Down:Connect(function()z.Position=UDim2.new(0,N.AbsolutePosition.X,0,N.AbsolutePosition.Y+N.AbsoluteSize.Y)z.Visible=not z.Visible end)end end if h=="\084\097\098\070\114\097\109\101"then local z=create("\083\099\114\111\108\108\105\110\103\070\114\097\109\101",nil,N.Buttons)local p=N.Frames local K=0 local M=b.ButtonSize or 60 N.BackgroundTransparency=b.BackgroundTransparency or 1 z.ZIndex=b.ZIndex or N.ZIndex p.ZIndex=z.ZIndex N:SetSpecial("\071\101\116\084\097\098",function(z,K)return p:FindFirstChild(K)end)N:SetSpecial("\078\101\119\084\097\098",function(M,b,h)local N=h or{}local y=getNextPos(z)local q=service.TextService:GetTextSize(N.Text or b,dTextSize,dFont,z.AbsoluteSize)local P=N.TextTransparency local o=false local x=false local D=create("\083\099\114\111\108\108\105\110\103\070\114\097\109\101",{Name=b,Size=UDim2.new(1,0,1,0);Position=UDim2.new(0,0,0,0);BorderSizePixel=0,BackgroundTransparency=N.FrameTransparency or N.Transparency,BackgroundColor3=N.Color or dBackground:lerp(Color3.new(1,1,1),.2);ZIndex=z.ZIndex;Visible=false})local H=create("\084\101\120\116\066\117\116\116\111\110",{Name=b;Text=N.Text or b,Size=UDim2.new(0,q.X+20,1,0);ZIndex=z.ZIndex,Position=UDim2.new(0,y.X.Offset>0 and y.X.Offset+5 or 0,0,0);TextColor3=N.TextColor;BackgroundTransparency=.7;TextTransparency=N.TextTransparency,BackgroundColor3=N.Color or dBackground:lerp(Color3.new(1,1,1),.2),BorderSizePixel=0})D:SetSpecial("\070\111\099\117\115\084\097\098",function()for z,p in next,z:GetChildren()do if isGui(p)then p.BackgroundTransparency=.7 p.TextTransparency=.7 end end for z,p in next,p:GetChildren()do if isGui(p)then p.Visible=false end end H.BackgroundTransparency=N.Transparency or 0 H.TextTransparency=N.TextTransparency or 0 D.Visible=true if N.OnFocus then N.OnFocus(true)end end)if K==0 then D.Visible=true H.BackgroundTransparency=N.Transparency or 0 end H.MouseButton1Down:Connect(function()if not x then D:FocusTab()end end)H.Parent=z D.Parent=p z:ResizeCanvas(true,false)D:SetSpecial("\068\105\115\097\098\108\101",function()x=true H.BackgroundTransparency=.9 H.TextTransparency=.9 end)D:SetSpecial("\069\110\097\098\108\101",function()x=false H.BackgroundTransparency=.7 H.TextTransparency=N.TextTransparency or 0 end)K=K+1 return D,H end)end if h=="\083\099\114\111\108\108\105\110\103\070\114\097\109\101"then local z=false if not b.ScrollBarThickness then b.ScrollBarThickness=dScrollBar end N:SetSpecial("\071\101\110\101\114\097\116\101\076\105\115\116",function(p,K,M,h)local y=K or p local q={}local P=M or{}z=q N:ClearAllChildren()local o=0 for p,K in next,y do local h=K local y local x local D if type(K)=="\116\097\098\108\101"then h=K.Text y=K.Desc x=K.Color if K.RichTextAllowed or P.RichTextAllowed then D=true end end local H=create("\084\101\120\116\076\097\098\101\108",{Text=" "..tostring(h),ToolTip=y,Size=UDim2.new(1,-5,0,P.ySize or 20),Visible=true;BackgroundTransparency=1,Font="\065\114\105\097\108",TextSize=14,TextStrokeTransparency=.8;TextXAlignment="\076\101\102\116",Position=UDim2.new(0,0,0,o*(P.ySize or 20));RichText=D or false})if x then H.TextColor3=x end if M then for z,p in next,P do if U(H,z)then H[z]=p end end end if z==q then H.Parent=N else H:Destroy()break end o=o+1 if b.Delay then if type(b.Delay)=="\110\117\109\098\101\114"then wait(b.Delay)elseif p%100==0 then wait(.1)end end end N:ResizeCanvas(false,true,false,h,5,5,50)z=nil end)N:SetSpecial("\082\101\115\105\122\101\067\097\110\118\097\115",function(z,p,K,M,h,y,q,P)local o,x=b.xPadding or 5,b.yPadding or 5 local D,H=0,0 if not p and not K then p=false K=true end for z,M in next,N:GetChildren()do if M:IsA("\071\117\105\079\098\106\101\099\116")then if K then M.Size=UDim2.new(M.Size.X.Scale,M.Size.X.Offset,0,M.AbsoluteSize.Y)M.Position=UDim2.new(M.Position.X.Scale,M.Position.X.Offset,0,M.AbsolutePosition.Y-N.AbsolutePosition.Y)end if p then M.Size=UDim2.new(0,M.AbsoluteSize.X,M.Size.Y.Scale,M.Size.Y.Offset)M.Position=UDim2.new(0,M.AbsolutePosition.X-N.AbsolutePosition.X,M.Position.Y.Scale,M.Position.Y.Offset)end local b=M.Position.Y.Offset+M.Size.Y.Offset local h=M.Position.X.Offset+M.Size.X.Offset D=math.max(D,b)H=math.max(H,h)if P then if z%P==0 then wait(.016666666666667)end end end end if K then N.CanvasSize=UDim2.new(N.CanvasSize.X.Scale,N.CanvasSize.X.Offset,0,D+x)end if p then N.CanvasSize=UDim2.new(0,H+o,N.CanvasSize.Y.Scale,N.CanvasSize.Y.Offset)end if M then N.CanvasPosition=Vector2.new((H+o)-N.AbsoluteSize.X,N.CanvasPosition.Y)end if h then N.CanvasPosition=Vector2.new(N.CanvasPosition.X,(D+x)-N.AbsoluteSize.Y)end end)if b.List then N:GenerateList(b.List)b.List=nil end end S(N,b.Content or b.Children)b.Children=nil b.Content=nil for z,p in next,b do if U(N,z)then N[z]=p end end N.Parent=P return apiIfy(N,b,h),b end function apiIfy(z,p,K)local M=service.Wrap(z)z:SetSpecial("\079\098\106\101\099\116",z)z:SetSpecial("\083\101\116\080\111\115\105\116\105\111\110",function(p,K)z.Position=K end)z:SetSpecial("\083\101\116\083\105\122\101",function(p,K)z.Size=K end)z:SetSpecial("\065\100\100",function(p,K,M)if not M then M=K K=p end local b=create(K,M)b.Parent=z return apiIfy(b,M,K)end)z:SetSpecial("\067\111\112\121",function(K,M,b)local h={}local N for z,p in next,p do h[z]=p end for z,p in next,b do h[z]=p end N=create(M or p.Class or z.ClassName,h)N.Parent=b.Parent or z.Parent return apiIfy(N,p,M)end)return M end function doClose()if not T then T=true print(r)if r then r()end N:Destroy()end end function isVisible()return z_.Visible end local H_=R:FindFirstChild("\084\101\120\116\076\097\098\101\108")function doHide(z)local p=R.LineHeight if z or z==nil and z_.Visible then dragSize=u.Size z_.Visible=false u.BackgroundTransparency=z_.BackgroundTransparency u.BackgroundColor3=z_.BackgroundColor3 u.Size=UDim2.new(0,200,u.Size.Y.Scale,u.Size.Y.Offset)if H_ then H_.Text="\043"else R.Text="\043"end R.LineHeight=p N.Minimized=true elseif z==false or z==nil and not z_.Visible then z_.Visible=true u.BackgroundTransparency=1 u.Size=dragSize or u.Size if H_ then H_.Text="-"else R.Text="-"end R.LineHeight=p N.Minimized=false end if E then E(z_.Visible)end if Q then wallPosition()end end function isInFrame(z,p,K)if z>K.AbsolutePosition.X and(z<K.AbsolutePosition.X+K.AbsoluteSize.X and(p>K.AbsolutePosition.Y and p<K.AbsolutePosition.Y+K.AbsoluteSize.Y))then return true else return false end end function wallPosition()if N.Active then local z,p=u.AbsolutePosition.X,u.AbsolutePosition.Y local K,M,b=u.AbsoluteSize.X,q.AbsoluteSize.X,q.AbsoluteSize.Y local h=z_.Visible and z_.AbsoluteSize.Y or u.AbsoluteSize.Y if z<0 then u.Position=UDim2.new(0,0,u.Position.Y.Scale,u.Position.Y.Offset)end if p<0 then u.Position=UDim2.new(u.Position.X.Scale,u.Position.X.Offset,0,0)end if z+K>M then u.Position=UDim2.new(0,q.AbsoluteSize.X-u.AbsoluteSize.X,u.Position.Y.Scale,u.Position.Y.Offset)end if p+h>b then u.Position=UDim2.new(u.Position.X.Scale,u.Position.X.Offset,0,q.AbsoluteSize.Y-h)end end end function setSize(z)if z and type(z)=="\116\097\098\108\101"then if z[1]<50 then z[1]=50 end if z[2]<50 then z[2]=50 end u.Size=UDim2.new(0,z[1],u.Size.Y.Scale,u.Size.Y.Offset)z_.Size=UDim2.new(1,0,0,z[2])end end function setPosition(z)if z and typeof(z)=="\085\068\105\109\050"then u.Position=z elseif z and type(z)=="\116\097\098\108\101"then u.Position=UDim2.new(0,z[1],0,z[2])elseif x and not z then u.Position=UDim2.new(.5,-u.AbsoluteSize.X/2,.5,-z_.AbsoluteSize.Y/2)end end if P then N.Name=P if z.AllowMultiple~=nil and z.AllowMultiple==false then local z,p=client.UI.Get(P,q,true)if z then doClose()return nil end end end if x then setSize(x)end if a then setPosition(a)end if H then k.Text=H end if v or not s then N.CanKeepAlive=true q.ResetOnSpawn=false elseif s then N.CanKeepAlive=false q.ResetOnSpawn=true end if o then J.Visible=true J.Image=o end if Y then K_.CanvasSize=Y end if g then W.Visible=false A.Position=R.Position R.Position=W.Position end if I then R.Visible=false A.Position=R.Position end if Q then u.DragStopped:Connect(function()wallPosition()end)end if j then local z=false function DoRefresh()if not V then local z=false V=true spawn(function()while N.Active and not z do for z=0,180,10 do B.Rotation=-z wait(.016666666666667)end end end)j()wait(1)z=true V=false end end A.MouseButton1Down:Connect(function()if not z then z=true DoRefresh()z=false end end)k.Size=UDim2.new(1,-130,k.Size.Y.Scale,k.Size.Y.Offset)else A.Visible=false end if m then J.MouseButton1Down(function()m(z,q,J)end)end if D then z.Menu.Text=""z.Menu.Parent=z_ z.Menu.Size=UDim2.new(1,-10,0,25)z.Menu.Position=UDim2.new(0,5,0,25)K_.Size=UDim2.new(1,-10,1,-55)K_.Position=UDim2.new(0,5,0,50)z.Menu.BackgroundColor3=Color3.fromRGB(216,216,216)z.Menu.BorderSizePixel=0 create("\084\101\120\116\076\097\098\101\108",z.Menu)end if not w then local z=u.AbsolutePosition.X local p=u.AbsolutePosition.Y local K=u.AbsoluteSize.X local h=u.AbsoluteSize.Y local q=client.Variables local P local o local x local function D(z)z.MouseEnter:Connect(function()x=z end)z.MouseLeave:Connect(function()if x==z then x=nil end end)end function checkMouse(z,p)if N.Active and z_.Visible then if isInFrame(z,p,u)or isInFrame(z,p,K_)then o=nil P=nil elseif isInFrame(z,p,P_)then o="\084\111\112\082\105\103\104\116"P=MouseIcons.TopRight elseif isInFrame(z,p,o_)then o="\084\111\112\076\101\102\116"P=MouseIcons.TopLeft elseif isInFrame(z,p,h_)then o="\082\105\103\104\116\067\111\114\110\101\114"P=MouseIcons.RightCorner elseif isInFrame(z,p,N_)then o="\076\101\102\116\067\111\114\110\101\114"P=MouseIcons.LeftCorner elseif isInFrame(z,p,y_)then o="\082\105\103\104\116\083\105\100\101"P=MouseIcons.Horizontal elseif isInFrame(z,p,q_)then o="\076\101\102\116\083\105\100\101"P=MouseIcons.Horizontal elseif isInFrame(z,p,x_)then o="\066\111\116\116\111\109"P=MouseIcons.Vertical elseif isInFrame(z,p,D_)then o="\084\111\112"P=MouseIcons.Vertical else o=nil P=nil end else o=nil end if not client.Variables.MouseLockedBy or client.Variables.MouseLockedBy==N then if o and P then M.Icon=P client.Variables.MouseLockedBy=N elseif client.Variables.MouseLockedBy==N then M.Icon=d client.Variables.MouseLockedBy=nil end end end local function H(M,b)checkMouse(M,b)if N.Active and(o and(not f and(not isInFrame(M,b,K_)and not isInFrame(M,b,u))))then f=o z=u.AbsolutePosition.X p=u.AbsolutePosition.Y K=u.AbsoluteSize.X h=z_.AbsoluteSize.Y end end local function l()if N.Active then if f and L then L(UDim2.new(u.Size.X.Scale,u.Size.X.Offset,z_.Size.Y.Scale,z_.Size.Y.Offset))end f=nil M.Icon=d end end local function Q(b,y)if N.Active then if M.Icon~=MouseIcons.TopRight and(M.Icon~=MouseIcons.TopLeft and(M.Icon~=MouseIcons.RightCorner and(M.Icon~=MouseIcons.LeftCorner and(M.Icon~=MouseIcons.Horizontal and M.Icon~=MouseIcons.Vertical))))then d=M.Icon end if f then local M=false local N=false local q=u.Position local P,o=b,y local x,D=K,h if f=="\084\111\112\082\105\103\104\116"then x=(P-z)+3 D=((p-o)+h)-1 N=true elseif f=="\084\111\112\076\101\102\116"then x=((z-P)+K)-1 D=((p-o)+h)-1 N=true M=true elseif f=="\082\105\103\104\116\067\111\114\110\101\114"then x=(P-z)+3 D=(o-p)+3 elseif f=="\076\101\102\116\067\111\114\110\101\114"then x=((z-P)+K)+3 D=(o-p)+3 M=true elseif f=="\076\101\102\116\083\105\100\101"then x=((z-P)+K)+3 D=h M=true elseif f=="\082\105\103\104\116\083\105\100\101"then x=(P-z)+3 D=h elseif f=="\066\111\116\116\111\109"then x=K D=(o-p)+3 elseif f=="\084\111\112"then x=K D=((p-o)+h)-1 N=true end if x<G[1]then x=G[1]end if D<G[2]then D=G[2]end if x>i[1]then x=i[1]end if D>i[2]then D=i[2]end if M then q=UDim2.new(0,(z+K)-x,q.Y.Scale,q.Y.Offset)end if N then q=UDim2.new(q.X.Scale,q.X.Offset,0,(p+h)-D)end u.Position=q u.Size=UDim2.new(0,x,u.Size.Y.Scale,u.Size.Y.Offset)z_.Size=UDim2.new(z_.Size.X.Scale,z_.Size.X.Offset,0,D)if not k.TextFits then k.Visible=false else k.Visible=true end else checkMouse(b,y)end end end y(b.InputBegan,function(z,p)if not p and(z.UserInputType==Enum.UserInputType.MouseButton1 or z.UserInputType==Enum.UserInputType.Touch)then H(M.X,M.Y)end end)y(b.InputChanged,function(z,p)if z.UserInputType==Enum.UserInputType.MouseMovement or Enum.UserInputType.Touch then Q(z.Position.X,z.Position.Y)end end)y(b.InputEnded,function(z,p)if z.UserInputType==Enum.UserInputType.MouseButton1 or Enum.UserInputType.Touch then l()end end)else M_.Visible=false b_.Visible=false end W.MouseButton1Down:Connect(doClose)R.MouseButton1Down:Connect(function()doHide()end)N.CustomDestroy=function()(service.UnWrap(q)):Destroy()if client.Variables.MouseLockedBy==N then M.Icon=d client.Variables.MouseLockedBy=nil end if not T then T=true if r then r()end end end for z,p in next,q:GetChildren()do if p.Name~="\068\101\115\099"and p.Name~="\068\114\097\103"then e[p.Name]=p p.Parent=nil end end do local z=Instance.new("\066\111\111\108\086\097\108\117\101",q)local p=false local K local M z.Name="\095\095\065\068\079\078\073\083\095\087\073\078\068\079\087"y(z_.InputBegan,function(z)if N.Active and(z.UserInputType==Enum.UserInputType.MouseButton1 or z.UserInputType==Enum.UserInputType.Touch)then Z()end end)y(u.InputBegan,function(z)if N.Active then M=true if z.UserInputType==Enum.UserInputType.MouseButton1 or z.UserInputType==Enum.UserInputType.Touch then Z()end end end)y(u.InputChanged,function(z)if N.Active then M=true end end)y(u.InputEnded,function(z)M=false end)y(b.InputBegan,function(z)if M and(q.DisplayOrder==101 and(not p and(z.UserInputType==Enum.UserInputType.MouseButton1 or z.UserInputType==Enum.UserInputType.Touch)))then p=true Z()K=Vector2.new(u.AbsolutePosition.X-z.Position.X,u.AbsolutePosition.Y-z.Position.Y)end end)y(b.InputChanged,function(z)if p and(z.UserInputType==Enum.UserInputType.MouseMovement or z.UserInputType==Enum.UserInputType.Touch)then u.Position=UDim2.new(0,K.X+z.Position.X,0,K.Y+z.Position.Y)end end)y(b.InputEnded,function(z)if z.UserInputType==Enum.UserInputType.MouseButton1 or z.UserInputType==Enum.UserInputType.Touch then p=false end end)end local l_=apiIfy(K_,z)local Q_=l_:GetMetatable()local I_=Q_.__newindex local g_=Q_.__index create("\083\099\114\111\108\108\105\110\103\070\114\097\109\101",nil,K_)S(l_,F)l_:SetSpecial("\103\084\097\098\108\101",N)l_:SetSpecial("\087\105\110\100\111\119",q)l_:SetSpecial("\077\097\105\110",z_)l_:SetSpecial("\084\105\116\108\101",k)l_:SetSpecial("\068\114\097\103\103\101\114",u)l_:SetSpecial("\068\101\115\116\114\111\121",doClose)l_:SetSpecial("\067\108\111\115\101",doClose)l_:SetSpecial("\079\098\106\101\099\116",K_)l_:SetSpecial("\082\101\102\114\101\115\104",DoRefresh)l_:SetSpecial("\065\100\100\084\105\116\108\101\066\117\116\116\111\110",function(z,p)if type(z)=="\116\097\098\108\101"and not p then p=z end return O(p)end)l_:SetSpecial("\082\101\097\100\121",function()if C then C()end N.Ready()Z()end)l_:SetSpecial("\066\105\110\100\069\118\101\110\116",function(z,...)y(...)end)l_:SetSpecial("\072\105\100\101",function(z,p)doHide(p)end)l_:SetSpecial("\083\101\116\084\105\116\108\101",function(z,p)k.Text=p end)l_:SetSpecial("\083\101\116\080\111\115\105\116\105\111\110",function(z,p)setPosition(p)end)l_:SetSpecial("\083\101\116\083\105\122\101",function(z,p)setSize(p)end)l_:SetSpecial("\071\101\116\080\111\115\105\116\105\111\110",function()return u.AbsolutePosition end)l_:SetSpecial("\071\101\116\083\105\122\101",function()return z_.AbsoluteSize end)l_:SetSpecial("\073\115\086\105\115\105\098\108\101",isVisible)l_:SetSpecial("\073\115\067\108\111\115\101\100",T)Q_.__index=function(z,p)if p=="\073\115\086\105\115\105\098\108\101"then return isVisible()elseif p=="\067\108\111\115\101\100"then return T else return g_(z,p)end end setSize(x)setPosition(a)if l then N:Ready()Z()end return l_,q end

return function(data, env)
	if env then
		setfenv(1, env)
	end
	
	--local client = service.GarbleTable(client)
	local Player = service.Players.LocalPlayer
	local Mouse = Player:GetMouse()
	local InputService = service.UserInputService
	local gIndex = data.gIndex
	local gTable = data.gTable
	
	local Event = gTable.BindEvent
	local GUI = gTable.Object
	local Name = data.Name
	local Icon = data.Icon
	local Size = data.Size
	local Menu = data.Menu
	local Title = data.Title
	local Ready = data.Ready
	local Walls = data.Walls
	local noHide = data.NoHide
	local noClose = data.NoClose
	local onReady = data.OnReady
	local onClose = data.OnClose
	local onResize = data.OnResize
	local onRefresh = data.OnRefresh
	local onMinimize = data.OnMinimize
	local ContextMenu = data.ContextMenu
	local ResetOnSpawn = data.ResetOnSpawn
	local CanKeepAlive = data.CanKeepAlive
	local iconClicked = data.IconClicked
	local SizeLocked = data.SizeLocked or data.SizeLock
	local CanvasSize = data.CanvasSize
	local Position = data.Position
	local Content = data.Content or data.Children
	local MinSize = data.MinSize or {150, 50}
	local MaxSize = data.MaxSize or {math.huge, math.huge}
	local curIcon = Mouse.Icon
	local isClosed = false
	local Resizing = false
	local Refreshing = false
	local DragEnabled = true
	local checkProperty = service.CheckProperty
	local specialInsts = {}
	local inExpandable
	local addTitleButton
	local LoadChildren
	local BringToFront
	local functionify
	
	local Drag = GUI.Drag
	local Close = Drag.Close
	local Hide = Drag.Hide
	local Iconf = Drag.Icon
	local Titlef = Drag.Title
	local Refresh = Drag.Refresh
	local rSpinner = Refresh.Spinner
	local Main = Drag.Main
	local Tooltip = GUI.Desc
	local ScrollFrame = GUI.Drag.Main.ScrollingFrame
	local LeftSizeIcon = Main.LeftResizeIcon
	local RightSizeIcon = Main.RightResizeIcon
	local RightCorner = Main.RightCorner
	local LeftCorner = Main.LeftCorner
	local RightSide = Main.RightSide
	local LeftSide = Main.LeftSide
	local TopRight = Main.TopRight
	local TopLeft = Main.TopLeft
	local Bottom = Main.Bottom
	local Top = Main.Top
	
	function Expand(ent, point, text)
		local label = point:FindFirstChild("Label")
		
		if label then
			ent.MouseLeave:Connect(function(x,y)
				if inExpandable == ent then
					point.Visible = false
				end
			end)
			
			ent.MouseMoved:Connect(function(x,y)
				inExpandable = ent
				label.Text = text or ent.Desc.Value
				--point.Size = UDim2.new(0, 10000, 0, 10000)
				local newx = 500
				local bounds = service.TextService:GetTextSize(text or ent.Desc.Value, label.TextSize, label.Font, Vector2.new(1000,1000)).X-- point.Label.TextBounds.X
				local rows = math.floor(bounds/500)
				rows = rows+1
				if rows<1 then rows = 1 end
				if bounds<500 then newx = bounds end
				point.Size = UDim2.new(0, newx+10, 0, (rows*20)+10)
				point.Position = UDim2.new(0, x+6, 0, y-40-((rows*20)+10))
				point.Visible = true
			end)
		end
	end
	
	function getNextPos(frame)
		local farXChild, farYChild
		for i,v in next,frame:GetChildren() do
			if checkProperty(v, "Size") then
				if not farXChild or (v.AbsolutePosition.X + v.AbsoluteSize.X) > (farXChild.AbsolutePosition.X + farXChild.AbsoluteSize.X) then
					farXChild = v
				end
				
				if not farYChild or (v.AbsolutePosition.Y + v.AbsoluteSize.Y) > (farXChild.AbsolutePosition.Y + farXChild.AbsoluteSize.Y) then
					farYChild = v
				end
			end
		end
		
		return ((not farXChild or not farYChild) and UDim2.new(0,0,0,0)) or UDim2.new(farXChild.Position.X.Scale, farXChild.Position.X.Offset + farXChild.AbsoluteSize.X, farYChild.Position.Y.Scale, farYChild.Position.Y.Offset + farYChild.AbsoluteSize.Y)
	end
	
	function LoadChildren(Obj, Children)
		if Children then
			local runWhenDone = Children.RunWhenDone and functionify(Children.RunWhenDone, Obj)
			for class,data in next,Children do
				if type(data) == "table" then
					if not data.Parent then data.Parent = Obj end
					create(data.Class or data.ClassName or class, data)
				elseif type(data) == "function" or type(data) == "string" and not runWhenDone then
					runWhenDone = functionify(data, Obj)
				end
			end
			
			if runWhenDone then
				runWhenDone(Obj)
			end
		end
	end
	
	function BringToFront()
		for i,v in ipairs(Player.PlayerGui:GetChildren()) do
			if v:FindFirstChild("__ADONIS_WINDOW") then
				v.DisplayOrder = 100
			end
		end
		
		GUI.DisplayOrder = 101
	end
	
	function addTitleButton(data)
		local startPos = 1
		local realPos
		local new 
		local original = Hide
		
		if Hide.Visible then
			startPos = startPos+1
		end
		
		if Close.Visible then
			startPos = startPos+1
		end
		
		if Refresh.Visible then
			startPos = startPos+1
		end
		
		realPos = UDim2.new(1, -(((30*startPos)+5)+(startPos-1)), 0, 0)
		data.Position = data.Position or realPos
		data.Size = data.Size or original.Size
		data.BackgroundColor3 = data.BackgroundColor3 or original.BackgroundColor3
		data.BackgroundTransparency = data.BackgroundTransparency or original.BackgroundTransparency
		data.BorderSizePixel = data.BorderSizePixel or original.BorderSizePixel
		data.ZIndex = data.ZIndex or original.ZIndex
		data.TextColor3 = data.TextColor3 or original.TextColor3
		data.TextScaled = data.TextScaled or original.TextScaled
		data.TextStrokeColor3 = data.TextStrokeColor3 or original.TextStrokeColor3
		data.TextSize = data.TextSize or original.TextSize
		data.TextTransparency = data.TextTransparency or original.TextTransparency
		data.TextStrokeTransparency = data.TextStrokeTransparency or original.TextStrokeTransparency
		data.TextScaled = data.TextScaled or original.TextScaled
		data.TextWrapped = data.TextWrapped or original.TextWrapped
		--data.TextXAlignment = data.TextXAlignment or original.TextXAlignment
		--data.TextYAlignment = data.TextYAlignment or original.TextYAlignment
		data.Font = data.Font or original.Font
		data.Parent = Drag
		
		return create("TextButton", data)
	end
	
	function functionify(func, object)
		if type(func) == "string" then
			if object then
				local env = GetEnv()
				env.Object = object
				return client.Core.LoadCode(func, env)
			else
				return client.Core.LoadCode(func)
			end
		else
			return func
		end
	end
	
	function create(class, dataFound, existing)
		local data = dataFound or {}
		local class = data.Class or data.ClassName or class
		local new = existing or (specialInsts[class] and specialInsts[class]:Clone()) or service.New(class)
		local parent = data.Parent or new.Parent
		
		if dataFound then
			data.Parent = nil
			
			if data.Class or data.ClassName then
				data.Class = nil
				data.ClassName = nil
			end
			
			if not data.BorderColor3 and checkProperty(new,"BorderColor3") then
				new.BorderColor3 = dBorder
			end
			
			if not data.CanvasSize and checkProperty(new,"CanvasSize") then
				new.CanvasSize = dCanvasSize
			end
			
			if not data.BorderSizePixel and checkProperty(new,"BorderSizePixel") then
				new.BorderSizePixel = dPixelSize
			end
			
			if not data.BackgroundColor3 and checkProperty(new,"BackgroundColor3") then
				new.BackgroundColor3 = dBackground
			end
			
			if not data.PlaceholderColor3 and checkProperty(new,"PlaceholderColor3") then
				new.PlaceholderColor3 = dPlaceholderColor
			end
			
			if not data.Transparency and not data.BackgroundTransparency and checkProperty(new,"Transparency") then
				new.BackgroundTransparency = dTransparency
			elseif data.Transparency then
				new.BackgroundTransparency = data.Transparency
			end
			
			if not data.TextColor3 and not data.TextColor and checkProperty(new,"TextColor3") then
				new.TextColor3 = dTextColor
			elseif data.TextColor then
				new.TextColor3 = data.TextColor
			end
			
			if not data.Font and checkProperty(new, "Font") then
				data.Font = dFont
			end
			
			if not data.TextSize and checkProperty(new, "TextSize") then
				data.TextSize = dTextSize
			end
			
			if not data.BottomImage and not data.MidImage and not data.TopImage and class == "ScrollingFrame" then
				new.BottomImage = dScrollImage 
				new.MidImage = dScrollImage
				new.TopImage = dScrollImage
			end
			
			if not data.Size and checkProperty(new,"Size") then
				new.Size = dSize
			end
			
			if not data.Position and checkProperty(new,"Position") then
				new.Position = dPosition
			end
			
			if not data.ZIndex and checkProperty(new,"ZIndex") then
				new.ZIndex = dZIndex
				if parent and checkProperty(parent, "ZIndex") then
					new.ZIndex = parent.ZIndex
				end
			end
			
			if data.TextChanged and class == "TextBox" then
				local textChanged = functionify(data.TextChanged, new)
				new.FocusLost:Connect(function(enterPressed)
					textChanged(new.Text, enterPressed, new)
				end)
			end
			
			if (data.OnClicked or data.OnClick) and (class == "TextButton" or class == "ImageButton") then
				local debounce = false;
				local doDebounce = data.Debounce;
				local onClick = functionify((data.OnClicked or data.OnClick), new)
				new.MouseButton1Down:Connect(function()
					if not debounce then 
						if doDebounce then
							debounce = true
						end
						
						onClick(new);
						
						debounce = false;
					end
				end)
			end
			
			if data.Events then
				for event,func in pairs(data.Events) do
					local realFunc = functionify(func, new)
					Event(new[event], function(...)
						realFunc(...)
					end)
				end
			end
			
			if data.Visible == nil then
				data.Visible = true
			end
			
			if data.LabelProps then
				data.LabelProperties = data.LabelProps
			end
		end
		
		if class == "Entry" then
			local label = new.Text
			local dots = new.Dots
			local desc = new.Desc
			
			label.ZIndex = data.ZIndex or new.ZIndex
			dots.ZIndex = data.ZIndex or new.ZIndex
			
			if data.Text then
				new.Text.Text = data.Text
				new.Text.Visible = true
				data.Text = nil
			end
			
			if data.Desc or data.ToolTip then
				new.Desc.Value = data.Desc or data.ToolTip
				data.Desc = nil
			end
			
			Expand(new, Tooltip)
		else
			if data.ToolTip then
				Expand(new, Tooltip, data.ToolTip)
			end
		end
		
		if class == "ButtonEntry" then
			local button = new.Button
			local debounce = false
			local onClicked = functionify(data.OnClicked, button)
			
			new:SetSpecial("DoClick",function()
				if not debounce then
					debounce = true
					if onClicked then
						onClicked(button)
					end
					debounce = false
				end
			end)
			
			new.Text = data.Text or new.Text
			button.ZIndex = data.ZIndex or new.ZIndex
			button.MouseButton1Down:Connect(new.DoClick)
		end
		
		if class == "Boolean" then
			local enabled = data.Enabled
			local debounce = false
			local onToggle = functionify(data.OnToggle, new)
			local function toggle(isEnabled)
				if not debounce then
					debounce = true
					if (isEnabled ~= nil and isEnabled) or (isEnabled == nil and enabled) then
						enabled = false
						new.Text = "Disabled"
					elseif (isEnabled ~= nil and isEnabled == false) or (isEnabled == nil and not enabled) then
						enabled = true
						new.Text = "Enabled"
					end
					
					if onToggle then
						onToggle(enabled, new)
					end
					debounce = false
				end
			end
			
			--new.ZIndex = data.ZIndex
			new.Text = (enabled and "Enabled") or "Disabled"
			new.MouseButton1Down:Connect(function()
				if onToggle then
					toggle()
				end
			end)
			
			new:SetSpecial("Toggle",function(ignore, isEnabled) toggle(isEnabled) end)
		end
		
		if class == "StringEntry" then
			local box = new.Box
			local ignore
			
			new.Text = data.Text or new.Text
			box.ZIndex = data.ZIndex or new.ZIndex
			
			if data.BoxText then
				box.Text = data.BoxText
			end
			
			if data.BoxProperties then
				for i,v in next,data.BoxProperties do
					if checkProperty(box, i) then
						box[i] = v
					end
				end
			end
			
			if data.TextChanged then
				local textChanged = functionify(data.TextChanged, box)
				box.Changed:Connect(function(p)
					if p == "Text" and not ignore then
						textChanged(box.Text)
					end
				end)
				
				box.FocusLost:Connect(function(enter)
					local change = textChanged(box.Text, true, enter)
					if change then
						ignore = true
						box.Text = change
						ignore = false
					end
				end)
			end
			
			new:SetSpecial("SetValue",function(ignore, newValue) box.Text = newValue end)
		end
		
		if class == "Slider" then
			local mouseIsIn = false
			local posValue = new.Percentage
			local slider = new.Slider
			local bar = new.SliderBar
			local drag = new.Drag
			local moving = false
			local value = 0
			local onSlide = functionify(data.OnSlide, new)
			
			bar.ZIndex = data.ZIndex or new.ZIndex
			slider.ZIndex = bar.ZIndex+1
			drag.ZIndex = slider.ZIndex+1
			drag.Active = true
			
			if data.Value then
				slider.Position = UDim2.new(0.5, -10, 0.5, -10)
				drag.Position = slider.Position
			end
			
			bar.InputBegan:Connect(function(input)
				if not moving and input.UserInputType == Enum.UserInputType.MouseButton1 then
					value = ((Mouse.X)-(new.AbsolutePosition.X))/(new.AbsoluteSize.X)
					
					if value < 0 then
						value = 0
					elseif value > 1 then
						value = 1
					end
					
					slider.Position = UDim2.new(value, -10, 0.5, -10)
					drag.Position = slider.Position
					posValue.Value = value
					
					if onSlide then
						onSlide(value)
					end
				end
			end)
			
			drag.DragBegin:Connect(function()
				moving = true
			end)
			
			drag.DragStopped:Connect(function()
				moving = false
				drag.Position = slider.Position
			end)
			
			drag.Changed:Connect(function()
				if moving then
					value = ((Mouse.X)-(new.AbsolutePosition.X))/(new.AbsoluteSize.X)
					
					if value < 0 then
						value = 0
					elseif value > 1 then
						value = 1
					end
					
					slider.Position = UDim2.new(value, -10, 0.5, -10)
					posValue.Value = value
					
					if onSlide then
						onSlide(value)
					end
				end
			end)
			
			new:SetSpecial("SetValue",function(ignore, newValue) 
				if newValue and tonumber(newValue) then 
					value = tonumber(newValue)
					posValue.Value = value
					slider.Position = UDim2.new(value, -10, 0.5, -10)
					drag.Position = slider.Position
				end
			end)
		end
		
		if class == "Dropdown" then
			local menu = new.Menu
			local downImg = new.Down
			local selected = new.dSelected
			local options = data.Options
			local curSelected = data.Selected or data.Selection
			local onSelect = functionify(data.OnSelection or data.OnSelect or function()end)
			local textProps = data.TextProperties
			local scroller = create("ScrollingFrame", {
				Parent = menu;
				Size = UDim2.new(1, 0, 1, 0);
				Position = UDim2.new(0, 0, 0, 0);
				BackgroundTransparency = 1;
				ZIndex = 100;
			})
			
			menu.ZIndex = scroller.ZIndex
			menu.Parent = GUI
			menu.Visible = false
			menu.Size = UDim2.new(0, new.AbsoluteSize.X, 0, 100);
			menu.BackgroundColor3 = data.BackgroundColor3 or new.BackgroundColor3
			
			if data.TextAlignment then
				selected.TextXAlignment = data.TextAlignment
				selected.Position = UDim2.new(0, 30, 0, 0);
			end
			
			if data.NoArrow then
				downImg.Visible = false
			end
			
			new:SetSpecial("MenuContainer", menu)
			
			new.Changed:Connect(function(p)
				if p == "AbsolutePosition" and menu.Visible then
					menu.Position = UDim2.new(0, new.AbsolutePosition.X, 0, new.AbsolutePosition.Y+new.AbsoluteSize.Y)
				elseif p == "AbsoluteSize" or p == "Parent" then
					downImg.Size = UDim2.new(0, new.AbsoluteSize.Y, 1, 0);
					if data.TextAlignment == "Right" then
						downImg.Position = UDim2.new(0, 0, 0.5, -(downImg.AbsoluteSize.X/2))
						selected.Position = UDim2.new(0, new.AbsoluteSize.Y, 0, 0);
					else
						downImg.Position = UDim2.new(1, -downImg.AbsoluteSize.X, 0.5, -(downImg.AbsoluteSize.X/2))
					end
					
					selected.Size = UDim2.new(1, -downImg.AbsoluteSize.X, 1, 0);
					
					if options and #options <= 6 then
						menu.Size = UDim2.new(0, new.AbsoluteSize.X, 0, 30*#options);
					else
						menu.Size = UDim2.new(0, new.AbsoluteSize.X, 0, 30*6);
						scroller:ResizeCanvas(false, true);
					end
				end
			end)
			
			selected.ZIndex = new.ZIndex
			downImg.ZIndex = new.ZIndex
			
			if textProps then
				for i,v in next,textProps do
					selected[i] = v
				end
			end
			
			if options then
				for i,v in next,options do
					local button = scroller:Add("TextButton", {
						Text = "  ".. tostring(v);
						Size = UDim2.new(1, -10, 0, 30);
						Position = UDim2.new(0, 5, 0, 30*(i-1));
						ZIndex = menu.ZIndex;
						BackgroundTransparency = 1;
						OnClick = function()
							selected.Text = v;
							onSelect(v, new);
							menu.Visible = false
						end
					})
					
					if textProps then
						for i,v in next,textProps do
							button[i] = v
						end
					end
				end
				
				if curSelected then
					selected.Text = curSelected
				else
					selected.Text = "No Selection"
				end
				
				selected.MouseButton1Down:Connect(function()
					menu.Position = UDim2.new(0, new.AbsolutePosition.X, 0, new.AbsolutePosition.Y+new.AbsoluteSize.Y)
					menu.Visible = not menu.Visible
				end)
			end
		end
		
		if class == "TabFrame" then
			local buttons = create("ScrollingFrame", nil, new.Buttons)
			local frames = new.Frames
			local numTabs = 0
			local buttonSize = data.ButtonSize or 60
			
			new.BackgroundTransparency = data.BackgroundTransparency or 1
			buttons.ZIndex = data.ZIndex or new.ZIndex
			frames.ZIndex = buttons.ZIndex
			
			new:SetSpecial("GetTab", function(ignore, name)
				return frames:FindFirstChild(name)
			end)
			
			new:SetSpecial("NewTab", function(ignore, name, data)
				local data = data or {}
				--local numChildren = #frames:GetChildren()
				local nextPos = getNextPos(buttons);
				local textSize = service.TextService:GetTextSize(data.Text or name, dTextSize, dFont, buttons.AbsoluteSize)
				local oTextTrans = data.TextTransparency
				local isOpen = false
				local disabled = false
				local tabFrame = create("ScrollingFrame",{
					Name = name;
					Size = UDim2.new(1, 0, 1, 0);
					Position = UDim2.new(0, 0, 0, 0);
					BorderSizePixel = 0;
					BackgroundTransparency = data.FrameTransparency or data.Transparency;
					BackgroundColor3 = data.Color or dBackground:lerp(Color3.new(1,1,1), 0.2);
					ZIndex = buttons.ZIndex;
					Visible = false;
				})
				
				local tabButton = create("TextButton",{
					Name = name;
					Text = data.Text or name;
					Size = UDim2.new(0, textSize.X+20, 1, 0);
					ZIndex = buttons.ZIndex;
					Position = UDim2.new(0, (nextPos.X.Offset > 0 and nextPos.X.Offset+5) or 0, 0, 0);
					TextColor3 = data.TextColor;
					BackgroundTransparency = 0.7;
					TextTransparency = data.TextTransparency;
					BackgroundColor3 = data.Color or dBackground:lerp(Color3.new(1,1,1), 0.2);
					BorderSizePixel = 0;
				})
				
				tabFrame:SetSpecial("FocusTab",function()
					for i,v in next,buttons:GetChildren() do if isGui(v) then v.BackgroundTransparency = 0.7 v.TextTransparency = 0.7 end end
					for i,v in next,frames:GetChildren() do if isGui(v) then v.Visible = false end end
					tabButton.BackgroundTransparency = data.Transparency or 0
					tabButton.TextTransparency = data.TextTransparency or 0
					tabFrame.Visible = true
					if data.OnFocus then
						data.OnFocus(true)
					end
				end)
				
				if numTabs == 0 then
					tabFrame.Visible = true
					tabButton.BackgroundTransparency = data.Transparency or 0
				end
				
				tabButton.MouseButton1Down:Connect(function()
					if not disabled then
						tabFrame:FocusTab()
					end
				end)
				
				tabButton.Parent = buttons
				tabFrame.Parent = frames
				buttons:ResizeCanvas(true, false)
				
				tabFrame:SetSpecial("Disable", function()
					disabled = true;
					tabButton.BackgroundTransparency = 0.9;
					tabButton.TextTransparency = 0.9
				end)
				
				tabFrame:SetSpecial("Enable", function()
					disabled = false;
					tabButton.BackgroundTransparency = 0.7;
					tabButton.TextTransparency = data.TextTransparency or 0;
				end)
				
				numTabs = numTabs+1;
				
				return tabFrame,tabButton
			end)
		end
		
		if class == "ScrollingFrame" then
			local genning = false
			if not data.ScrollBarThickness then
				data.ScrollBarThickness = dScrollBar
			end
			
			new:SetSpecial("GenerateList", function(obj, list, labelProperties, bottom)
				local list = list or obj;
				local genHold = {}
				local entProps = labelProperties or {}
				
				genning = genHold
				new:ClearAllChildren()
				
				local num = 0
				for i,v in next,list do
					local text = v;
					local desc;
					local color
					local richText;
					
					if type(v) == "table" then
						text = v.Text
						desc = v.Desc
						color = v.Color
						
						if v.RichTextAllowed or entProps.RichTextAllowed then
							richText = true
						end
					end
					
					local label = create("TextLabel",{
						Text = " "..tostring(text);
						ToolTip = desc;
						Size = UDim2.new(1,-5,0,(entProps.ySize or 20));
						Visible = true;
						BackgroundTransparency = 1;
						Font = "Arial";
						TextSize = 14;
						TextStrokeTransparency = 0.8;
						TextXAlignment = "Left";
						Position = UDim2.new(0,0,0,num*(entProps.ySize or 20));
						RichText = richText or false;
					})
					
					if color then
						label.TextColor3 = color
					end
					
					if labelProperties then
						for i,v in next,entProps do
							if checkProperty(label, i) then
								label[i] = v
							end
						end
					end
					
					if genning == genHold then
						label.Parent = new;
					else
						label:Destroy()
						break
					end
					
					num = num+1
					
					if data.Delay then 
						if type(data.Delay) == "number" then
							wait(data.Delay) 
						elseif i%100 == 0 then 
							wait(0.1) 
						end
					end
				end
				
				new:ResizeCanvas(false, true, false, bottom, 5, 5, 50)
				genning = nil
			end)
			
			new:SetSpecial("ResizeCanvas", function(ignore, onX, onY, xMax, yMax, xPadding, yPadding, modBreak)
				local xPadding,yPadding = data.xPadding or 5, data.yPadding or 5
				local newY, newX = 0,0
				
				if not onX and not onY then onX = false onY = true end
				for i,v in next,new:GetChildren() do
					if v:IsA("GuiObject") then
						if onY then
							v.Size = UDim2.new(v.Size.X.Scale, v.Size.X.Offset, 0, v.AbsoluteSize.Y)
							v.Position = UDim2.new(v.Position.X.Scale, v.Position.X.Offset, 0, v.AbsolutePosition.Y-new.AbsolutePosition.Y)
						end
						
						if onX then
							v.Size = UDim2.new(0, v.AbsoluteSize.X, v.Size.Y.Scale, v.Size.Y.Offset)
							v.Position = UDim2.new(0, v.AbsolutePosition.X-new.AbsolutePosition.X, v.Position.Y.Scale, v.Position.Y.Offset)
						end
						
						local yLower = v.Position.Y.Offset + v.Size.Y.Offset
						local xLower = v.Position.X.Offset + v.Size.X.Offset
						newY = math.max(newY, yLower)
						newX = math.max(newX, xLower)
						if modBreak then
							if i%modBreak == 0 then 
								wait(1/60)
							end
						end
					end
				end
				
				if onY then
					new.CanvasSize = UDim2.new(new.CanvasSize.X.Scale, new.CanvasSize.X.Offset, 0, newY+yPadding)
				end
				
				if onX then
					new.CanvasSize = UDim2.new(0, newX + xPadding, new.CanvasSize.Y.Scale, new.CanvasSize.Y.Offset)
				end
				
				if xMax then
					new.CanvasPosition = Vector2.new((newX + xPadding)-new.AbsoluteSize.X, new.CanvasPosition.Y)
				end
				
				if yMax then
					new.CanvasPosition = Vector2.new(new.CanvasPosition.X, (newY+yPadding)-new.AbsoluteSize.Y)
				end
			end)
			
			if data.List then new:GenerateList(data.List) data.List = nil end
		end
		
		LoadChildren(new, data.Content or data.Children)
		
		data.Children = nil
		data.Content = nil
		
		for i,v in next,data do
			if checkProperty(new, i) then
				new[i] = v
			end
		end
		
		new.Parent = parent
		
		return apiIfy(new, data, class),data
	end
	
	function apiIfy(gui, data, class)
		local newGui = service.Wrap(gui)
		gui:SetSpecial("Object", gui)
		gui:SetSpecial("SetPosition", function(ignore, newPos) gui.Position = newPos end)
		gui:SetSpecial("SetSize", function(ingore, newSize) gui.Size = newSize end)
		gui:SetSpecial("Add", function(ignore, class, data)
			if not data then data = class class = ignore end
			local new = create(class,data);
			new.Parent = gui;
			return apiIfy(new, data, class)
		end)
		
		gui:SetSpecial("Copy", function(ignore, class, gotData)
			local newData = {}
			local new
			
			for i,v in next,data do
				newData[i] = v
			end
			
			for i,v in next,gotData do
				newData[i] = v
			end
			
			new = create(class or data.Class or gui.ClassName, newData);
			new.Parent = gotData.Parent or gui.Parent;
			return apiIfy(new, data, class)
		end)
		
		return newGui
	end
	
	function doClose()
		if not isClosed then
			isClosed = true
			print(onClose)
			if onClose then onClose() end
			gTable:Destroy()
		end
	end
	
	function isVisible()
		return Main.Visible
	end
	
	local hideLabel = Hide:FindFirstChild("TextLabel")
	function doHide(doHide)
		local origLH = Hide.LineHeight
		if doHide or (doHide == nil and Main.Visible) then
			dragSize = Drag.Size
			Main.Visible = false
			Drag.BackgroundTransparency = Main.BackgroundTransparency
			Drag.BackgroundColor3 = Main.BackgroundColor3
			Drag.Size = UDim2.new(0, 200, Drag.Size.Y.Scale, Drag.Size.Y.Offset)
			
			if hideLabel then
				hideLabel.Text = "+"
			else
				Hide.Text = "+"
			end
			
			Hide.LineHeight = origLH
			gTable.Minimized = true
		elseif doHide == false or (doHide == nil and not Main.Visible) then
			Main.Visible = true
			Drag.BackgroundTransparency = 1
			Drag.Size = dragSize or Drag.Size
			
			if hideLabel then
				hideLabel.Text = "-"
			else
				Hide.Text = "-"
			end
			
			Hide.LineHeight = origLH
			gTable.Minimized = false
		end
		
		if onMinimize then
			onMinimize(Main.Visible)
		end
		
		if Walls then
			wallPosition()
		end
	end
	
	function isInFrame(x, y, frame)
		if x > frame.AbsolutePosition.X and x < (frame.AbsolutePosition.X+frame.AbsoluteSize.X) and y > frame.AbsolutePosition.Y and y < (frame.AbsolutePosition.Y+frame.AbsoluteSize.Y) then
			return true
		else
			return false
		end
	end
	
	function wallPosition()
		if gTable.Active then
			local x,y = Drag.AbsolutePosition.X, Drag.AbsolutePosition.Y
			local abx, gx, gy = Drag.AbsoluteSize.X, GUI.AbsoluteSize.X, GUI.AbsoluteSize.Y
			local ySize = (Main.Visible and Main.AbsoluteSize.Y) or Drag.AbsoluteSize.Y
			
			if x < 0 then
				Drag.Position = UDim2.new(0, 0, Drag.Position.Y.Scale, Drag.Position.Y.Offset)
			end
			
			if y < 0 then
				Drag.Position = UDim2.new(Drag.Position.X.Scale, Drag.Position.X.Offset, 0, 0)
			end
			
			if x + abx > gx then
				Drag.Position = UDim2.new(0, GUI.AbsoluteSize.X - Drag.AbsoluteSize.X, Drag.Position.Y.Scale, Drag.Position.Y.Offset)
			end
			
			if y + ySize > gy then
				Drag.Position = UDim2.new(Drag.Position.X.Scale, Drag.Position.X.Offset, 0, GUI.AbsoluteSize.Y - ySize)
			end
		end
	end
	
	function setSize(newSize)
		if newSize and type(newSize) == "table" then
			if newSize[1] < 50 then newSize[1] = 50 end
			if newSize[2] < 50 then newSize[2] = 50 end
			
			Drag.Size = UDim2.new(0,newSize[1],Drag.Size.Y.Scale,Drag.Size.Y.Offset)
			Main.Size = UDim2.new(1,0,0,newSize[2])
		end 
	end
	
	function setPosition(newPos)
		if newPos and typeof(newPos) == "UDim2" then
			Drag.Position = newPos
		elseif newPos and type(newPos) == "table" then
			Drag.Position = UDim2.new(0, newPos[1], 0, newPos[2])
		elseif Size and not newPos then
			Drag.Position = UDim2.new(0.5, -Drag.AbsoluteSize.X/2, 0.5, -Main.AbsoluteSize.Y/2)
		end 
	end
	
	if Name then
		gTable.Name = Name
		if data.AllowMultiple ~= nil and data.AllowMultiple == false then
			local found, num = client.UI.Get(Name, GUI, true)
			if found then
				doClose()
				return nil
			end
		end
	end
	
	if Size then
		setSize(Size)
	end
	
	if Position then
		setPosition(Position)
	end 
	
	if Title then
		Titlef.Text = Title
	end
	
	if CanKeepAlive or not ResetOnSpawn then
		gTable.CanKeepAlive = true
		GUI.ResetOnSpawn = false
	elseif ResetOnSpawn then
		gTable.CanKeepAlive = false
		GUI.ResetOnSpawn = true
	end
	
	if Icon then
		Iconf.Visible = true
		Iconf.Image = Icon
	end
	
	if CanvasSize then
		ScrollFrame.CanvasSize = CanvasSize
	end
	
	if noClose then
		Close.Visible = false
		Refresh.Position = Hide.Position
		Hide.Position = Close.Position
	end
	
	if noHide then
		Hide.Visible = false
		Refresh.Position = Hide.Position
	end
	
	if Walls then
		Drag.DragStopped:Connect(function()
			wallPosition()
		end)
	end
	
	if onRefresh then
		local debounce = false
		function DoRefresh()
			if not Refreshing then
				local done = false
				Refreshing = true
				
				spawn(function()
					while gTable.Active and not done do
						for i = 0,180,10 do
							rSpinner.Rotation = -i
							wait(1/60)
						end
					end
				end)
				
				onRefresh()
				wait(1)
				done = true
				Refreshing = false
			end
		end
		
		Refresh.MouseButton1Down:Connect(function()
			if not debounce then
				debounce = true
				DoRefresh()
				debounce = false
			end
		end)
		
		Titlef.Size = UDim2.new(1, -130, Titlef.Size.Y.Scale, Titlef.Size.Y.Offset)
	else
		Refresh.Visible = false
	end
	
	if iconClicked then
		Iconf.MouseButton1Down(function()
			iconClicked(data, GUI, Iconf)
		end)
	end
	
	if Menu then
		data.Menu.Text     = ""
		data.Menu.Parent   = Main
		data.Menu.Size     = UDim2.new(1,-10,0,25)
		data.Menu.Position = UDim2.new(0,5,0,25)
		ScrollFrame.Size   = UDim2.new(1,-10,1,-55)
		ScrollFrame.Position       = UDim2.new(0,5,0,50)
		data.Menu.BackgroundColor3 = Color3.fromRGB(216, 216, 216)
		data.Menu.BorderSizePixel  = 0
		create("TextLabel",data.Menu)
	end
	
	if not SizeLocked then
		local startXPos = Drag.AbsolutePosition.X
		local startYPos = Drag.AbsolutePosition.Y
		local startXSize = Drag.AbsoluteSize.X
		local startYSize = Drag.AbsoluteSize.Y
		local vars = client.Variables
		local newIcon
		local inFrame
		local ReallyInFrame
		
		local function readify(obj)
			obj.MouseEnter:Connect(function()
				ReallyInFrame = obj
			end)
			
			obj.MouseLeave:Connect(function()
				if ReallyInFrame == obj then
					ReallyInFrame = nil
				end
			end)
		end
		
		--[[
		readify(Drag)
		readify(ScrollFrame)
		readify(TopRight)
		readify(TopLeft)
		readify(RightCorner)
		readify(LeftCorner)
		readify(RightSide)
		readify(LeftSide)
		readify(Bottom)
		readify(Top)
		--]]
		
		function checkMouse(x, y) --// Update later to remove frame by frame pos checking
			if gTable.Active and Main.Visible then 
				if isInFrame(x, y, Drag) or isInFrame(x, y, ScrollFrame) then
					inFrame = nil
					newIcon = nil
				elseif isInFrame(x, y, TopRight) then
					inFrame = "TopRight"
					newIcon = MouseIcons.TopRight
				elseif isInFrame(x, y, TopLeft) then
					inFrame = "TopLeft"
					newIcon = MouseIcons.TopLeft
				elseif isInFrame(x, y, RightCorner) then
					inFrame = "RightCorner"
					newIcon = MouseIcons.RightCorner
				elseif isInFrame(x, y, LeftCorner) then
					inFrame = "LeftCorner"
					newIcon = MouseIcons.LeftCorner
				elseif isInFrame(x, y, RightSide) then
					inFrame = "RightSide"
					newIcon = MouseIcons.Horizontal
				elseif isInFrame(x, y, LeftSide) then
					inFrame = "LeftSide"
					newIcon = MouseIcons.Horizontal
				elseif isInFrame(x, y, Bottom) then
					inFrame = "Bottom"
					newIcon = MouseIcons.Vertical
				elseif isInFrame(x, y, Top) then
					inFrame = "Top"
					newIcon = MouseIcons.Vertical
				else
					inFrame = nil
					newIcon = nil
				end
			else
				inFrame = nil
			end
			
			if (not client.Variables.MouseLockedBy) or client.Variables.MouseLockedBy == gTable then
				if inFrame and newIcon then
					Mouse.Icon = newIcon
					client.Variables.MouseLockedBy = gTable
				elseif client.Variables.MouseLockedBy == gTable then
					Mouse.Icon = curIcon
					client.Variables.MouseLockedBy = nil
				end
			end
		end
		
		local function inputStart(x, y)
			checkMouse(x, y)
			if gTable.Active and inFrame and not Resizing and not isInFrame(x, y, ScrollFrame) and not isInFrame(x, y, Drag) then
				Resizing = inFrame
				startXPos = Drag.AbsolutePosition.X
				startYPos = Drag.AbsolutePosition.Y
				startXSize = Drag.AbsoluteSize.X
				startYSize = Main.AbsoluteSize.Y
			end
		end
		
		local function inputEnd()
			if gTable.Active then
				if Resizing and onResize then
					onResize(UDim2.new(Drag.Size.X.Scale, Drag.Size.X.Offset, Main.Size.Y.Scale, Main.Size.Y.Offset))
				end
				
				Resizing = nil
				Mouse.Icon = curIcon
				--DragEnabled = true
				--if Walls then
				--	wallPosition()
				--end
			end
		end
		
		local function inputMoved(x, y)
			if gTable.Active then
				if Mouse.Icon ~= MouseIcons.TopRight and Mouse.Icon ~= MouseIcons.TopLeft and Mouse.Icon ~= MouseIcons.RightCorner and Mouse.Icon ~= MouseIcons.LeftCorner and Mouse.Icon ~= MouseIcons.Horizontal and Mouse.Icon ~= MouseIcons.Vertical then
					curIcon = Mouse.Icon
				end
				
				if Resizing then
					local moveX = false
					local moveY = false
					local newPos = Drag.Position
					local xPos, yPos = x, y
					local newX, newY = startXSize, startYSize
					
					--DragEnabled = false
					
					if Resizing == "TopRight" then
						newX = (xPos - startXPos) + 3
						newY = (startYPos - yPos) + startYSize -1
						moveY = true
					elseif Resizing == "TopLeft" then
						newX = (startXPos - xPos) + startXSize -1
						newY = (startYPos - yPos) + startYSize -1
						moveY = true
						moveX = true
					elseif Resizing == "RightCorner" then
						newX = (xPos - startXPos) + 3
						newY = (yPos - startYPos) + 3
					elseif Resizing == "LeftCorner" then
						newX = (startXPos - xPos) + startXSize + 3
						newY = (yPos - startYPos) + 3
						moveX = true
					elseif Resizing == "LeftSide" then
						newX = (startXPos - xPos) + startXSize + 3
						newY = startYSize
						moveX = true
					elseif Resizing == "RightSide" then
						newX = (xPos - startXPos) + 3
						newY = startYSize
					elseif Resizing == "Bottom" then
						newX = startXSize
						newY = (yPos - startYPos) + 3
					elseif Resizing == "Top" then
						newX = startXSize
						newY = (startYPos - yPos) + startYSize - 1
						moveY = true
					end
					
					if newX < MinSize[1] then newX = MinSize[1]  end
					if newY < MinSize[2] then newY = MinSize[2] end
					if newX > MaxSize[1] then newX = MaxSize[1] end
					if newY > MaxSize[2] then newY = MaxSize[2] end
					
					if moveX then
						newPos = UDim2.new(0, (startXPos+startXSize)-newX, newPos.Y.Scale, newPos.Y.Offset)
					end
					
					if moveY then
						newPos  = UDim2.new(newPos.X.Scale, newPos.X.Offset, 0, (startYPos+startYSize)-newY)
					end
					
					Drag.Position = newPos
					Drag.Size = UDim2.new(0, newX, Drag.Size.Y.Scale, Drag.Size.Y.Offset)
					Main.Size = UDim2.new(Main.Size.X.Scale, Main.Size.X.Offset, 0, newY)
					
					if not Titlef.TextFits then
						Titlef.Visible = false
					else
						Titlef.Visible = true
					end
				else
					checkMouse(x, y)
				end
			end
		end
		
		Event(InputService.InputBegan, function(input, gameHandled)
			if not gameHandled and (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
				inputStart(Mouse.X, Mouse.Y)
			end
		end)
		
		Event(InputService.InputChanged, function(input, gameHandled)
			if input.UserInputType == Enum.UserInputType.MouseMovement or Enum.UserInputType.Touch then
				inputMoved(input.Position.X, input.Position.Y)
			end
		end)
		
		Event(InputService.InputEnded, function(input, gameHandled)
			if input.UserInputType == Enum.UserInputType.MouseButton1 or Enum.UserInputType.Touch then
				inputEnd()
			end
		end)
		
		--[[Event(Mouse.Button1Down, function()
			if gTable.Active and inFrame and not Resizing and not isInFrame(Mouse.X, Mouse.Y, ScrollFrame) and not isInFrame(Mouse.X, Mouse.Y, Drag) then
				Resizing = inFrame
				startXPos = Drag.AbsolutePosition.X
				startYPos = Drag.AbsolutePosition.Y
				startXSize = Drag.AbsoluteSize.X
				startYSize = Main.AbsoluteSize.Y
				checkMouse()
			end
		end)
		
		Event(Mouse.Button1Up, function()
			if gTable.Active then
				if Resizing and onResize then
					onResize(UDim2.new(Drag.Size.X.Scale, Drag.Size.X.Offset, Main.Size.Y.Scale, Main.Size.Y.Offset))
				end
				
				Resizing = nil
				Mouse.Icon = curIcon
				--if Walls then
				--	wallPosition()
				--end
			end
		end)--]]
	else
		LeftSizeIcon.Visible  = false
		RightSizeIcon.Visible = false
	end
	
	
	Close.MouseButton1Down:Connect(doClose)
	Hide.MouseButton1Down:Connect(function() doHide() end)
	gTable.CustomDestroy = function()
		service.UnWrap(GUI):Destroy()
		if client.Variables.MouseLockedBy == gTable then
			Mouse.Icon = curIcon
			client.Variables.MouseLockedBy = nil
		end
		
		if not isClosed then
			isClosed = true
			if onClose then
				onClose()
			end
		end
	end
	
	for i,child in next,GUI:GetChildren() do
		if child.Name ~= "Desc" and child.Name ~= "Drag" then
			specialInsts[child.Name] = child
			child.Parent = nil
		end
	end
	
	--// Drag & DisplayOrder Handler
	do
		local windowValue = Instance.new("BoolValue", GUI)
		local dragDragging = false
		local dragOffset
		local inFrame
		
		windowValue.Name = "__ADONIS_WINDOW"
		
		Event(Main.InputBegan, function(input)
			if gTable.Active and (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
				BringToFront()
			end
		end)
		
		Event(Drag.InputBegan, function(input)
			if gTable.Active then
				inFrame = true
				
				if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
					BringToFront()
				end
			end
		end)
		
		Event(Drag.InputChanged, function(input)
			if gTable.Active then
				inFrame = true
			end
		end)
		
		Event(Drag.InputEnded, function(input)
			inFrame = false
		end)
		
		Event(InputService.InputBegan, function(input)
			if inFrame and GUI.DisplayOrder == 101 and not dragDragging and (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then--isInFrame(input.Position.X, input.Position.Y, object) then
				dragDragging = true
				BringToFront()
				dragOffset = Vector2.new(Drag.AbsolutePosition.X - input.Position.X, Drag.AbsolutePosition.Y - input.Position.Y)
			end
		end)
		
		Event(InputService.InputChanged, function(input)
			if dragDragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
				Drag.Position = UDim2.new(0, dragOffset.X + input.Position.X, 0, dragOffset.Y + input.Position.Y)
			end
		end)
		
		Event(InputService.InputEnded, function(input)
			if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
				dragDragging = false
			end
		end)
	end

	--// Finishing up
	local api = apiIfy(ScrollFrame, data)
	local meta = api:GetMetatable()
	local oldNewIndex = meta.__newindex
	local oldIndex = meta.__index
	
	create("ScrollingFrame", nil, ScrollFrame)
	LoadChildren(api, Content)
	
	api:SetSpecial("gTable", gTable)
	api:SetSpecial("Window", GUI)
	api:SetSpecial("Main", Main)
	api:SetSpecial("Title", Titlef)
	api:SetSpecial("Dragger", Drag)
	api:SetSpecial("Destroy", doClose)
	api:SetSpecial("Close", doClose)
	api:SetSpecial("Object", ScrollFrame)
	api:SetSpecial("Refresh", DoRefresh) 
	api:SetSpecial("AddTitleButton", function(ignore, data) if type(ignore) == "table" and not data then data = ignore end return addTitleButton(data) end)
	api:SetSpecial("Ready", function() if onReady then onReady() end gTable.Ready() BringToFront() end)
	api:SetSpecial("BindEvent", function(ignore, ...) Event(...) end)	
	api:SetSpecial("Hide", function(ignore, hide) doHide(hide) end)
	api:SetSpecial("SetTitle", function(ignore, newTitle) Titlef.Text = newTitle end)
	api:SetSpecial("SetPosition", function(ignore, newPos) setPosition(newPos) end)
	api:SetSpecial("SetSize", function(ignore, newSize) setSize(newSize) end)
	api:SetSpecial("GetPosition", function() return Drag.AbsolutePosition end)
	api:SetSpecial("GetSize", function() return Main.AbsoluteSize end)
	api:SetSpecial("IsVisible", isVisible)
	api:SetSpecial("IsClosed", isClosed)
	
	meta.__index = function(tab, ind)
		if ind == "IsVisible" then
			return isVisible()
		elseif ind == "Closed" then
			return isClosed
		else
			return oldIndex(tab, ind)
		end
	end
	
	setSize(Size)
	setPosition(Position)
	
	if Ready then
		gTable:Ready()
		BringToFront()
	end
	
	return api,GUI
end
