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

		Event(InputService.InputChanged, function(input, gameHandled)
			if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
				local Position = input.Position
				inputMoved(Position.X, Position.Y)
			end
		end)

		Event(InputService.InputEnded, function(input, gameHandled)
			if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == 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
