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

	local function RippleEffect(element)
		spawn(function()
			element.ClipsDescendants = true
			local effect = create("ImageLabel", {
				Parent = element,
				AnchorPoint = Vector2.new(0.5, 0.5),
				BorderSizePixel = 0,
				ZIndex = element.ZIndex + 1,
				BackgroundTransparency = 0.5,
				ImageTransparency = 0.8,
				Image = "rbxasset://textures/whiteCircle.png",
				Position = UDim2.new(0.5, 0, 0.5, 0),
			})
			effect:TweenSize(UDim2.new(0, element.AbsoluteSize.X * 2.5, 0, element.AbsoluteSize.X * 2.5), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.2)
			wait(0.2)
			effect:Destroy()
		end)
	end

	local clickSound = service.New("Sound")
	clickSound.Parent = GUI.Drag
	clickSound.Volume = 0.4
	clickSound.SoundId = "rbxassetid://6706935653"

	Main.DescendantAdded:Connect(function(child)
		if child:IsA("TextButton") and not child:FindFirstChildOfClass("UIGradient") then
			local gradient = Instance.new("UIGradient", child)
			gradient.Color = ColorSequence.new{ColorSequenceKeypoint.new(0,Color3.new(1,1,1)),ColorSequenceKeypoint.new(1,Color3.fromRGB(80,80,80))}
			--[[create("ImageLabel", {
				BackgroundTransparency = 1;
				ImageTransparency = 0.5;
				Image = "rbxassetid://456420746";  -- For dusty Aero :]
				Size = UDim2.new(1, 0, 1, 0);
				Parent = child;
				ZIndex = 2
			})]]
		end
	end)

	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, 3)
		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

		local newTitleButton = create("TextButton", data)
		create("UICorner", {CornerRadius = UDim.new(0,4);Parent = newTitleButton})

		newTitleButton.MouseButton1Down:Connect(function() RippleEffect(newTitleButton) end)
		return newTitleButton
	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

						RippleEffect(new)
						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(function()
				clickSound:Play()
				RippleEffect(new)
				new.DoClick()
			end)
		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
					clickSound:Play()
					RippleEffect(new)
					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

				local function showMenu()
					menu.Position = UDim2.new(0, new.AbsolutePosition.X, 0, new.AbsolutePosition.Y+new.AbsoluteSize.Y)
					menu.Visible = not menu.Visible
				end

				selected.MouseButton1Down:Connect(function() clickSound:Play() RippleEffect(selected) showMenu() end)
				downImg.MouseButton1Down:Connect(function() RippleEffect(selected) showMenu() end)
			end
		end

		if class == "TabFrame" then
			local buttonsTab = {};
			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 dSecondaryBackground;
					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 dSecondaryBackground;
					BorderSizePixel = 0;
				})

				tabFrame:SetSpecial("FocusTab",function()
					for i,v in next,buttonsTab do
						if isGui(v) then
							v.BackgroundTransparency = (v:IsDisabled() and 0.9) or 0.7
							v.TextTransparency = (v:IsDisabled() and 0.9) or 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)

				tabButton:SetSpecial("IsDisabled", function()
					return disabled;
				end)

				table.insert(buttonsTab, tabButton);

				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 = "SourceSans";
						TextSize = 18;
						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
			for _, thing in pairs(Drag:GetChildren()) do
				if thing ~= Main then
					thing:Destroy()
				end
			end
			Drag:TweenSize(UDim2.new(0,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.15)
			Main.ClipsDescendants = true
			Main:TweenSize(UDim2.new(0,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.15)
			wait(0.12)
			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
			Main.Glass.Parent = Drag
			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.Icon.Image = "rbxassetid://3523249191"
			else
				Hide.Icon.Image = "rbxassetid://3523249191"
			end

			Hide.LineHeight = origLH
			gTable.Minimized = true
		elseif doHide == false or (doHide == nil and not Main.Visible) then
			Main.Visible = true
			Drag.Glass.Parent = Main
			Drag.BackgroundTransparency = 1
			Drag.Size = dragSize or Drag.Size

			if hideLabel then
				hideLabel.Icon.Image = "rbxassetid://3523250728"
			else
				Hide.Icon.Image = "rbxassetid://3523250728"
			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()
			clickSound:Play()
			RippleEffect(Refresh)
			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()
			clickSound:Play()
			RippleEffect(Iconf)
			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.MouseButton1Click:Connect(function() clickSound:Play() doClose() end)
	Hide.MouseButton1Click:Connect(function() clickSound:Play() doHide() end)

	Close.MouseButton1Down:Connect(function() RippleEffect(Close) end)
	Hide.MouseButton1Down:Connect(function() RippleEffect(Hide) 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
