Advertisement
Guest User

r3

a guest
Sep 15th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.43 KB | None | 0 0
  1. local a={windowcount=0}local b={}local c={}do local d=game:GetService("Players").LocalPlayer:GetMouse()local e=game:GetService('UserInputService')local f=game:GetService("RunService").Heartbeat;function b.new(g)local h,i=pcall(function()return g.MouseEnter end)if h then g.Active=true;i:connect(function()local j=g.InputBegan:connect(function(k)if k.UserInputType==Enum.UserInputType.MouseButton1 then local l=Vector2.new(d.X-g.AbsolutePosition.X,d.Y-g.AbsolutePosition.Y)while f:wait()and e:IsMouseButtonPressed(Enum.UserInputType.MouseButton1)do g:TweenPosition(UDim2.new(0,d.X-l.X+g.Size.X.Offset*g.AnchorPoint.X,0,d.Y-l.Y+g.Size.Y.Offset*g.AnchorPoint.Y),'Out','Quad',0.1,true)end end end)local m;m=g.MouseLeave:connect(function()j:disconnect()m:disconnect()end)end)end end;function c.new(n,h)n:GetPropertyChangedSignal('AbsoluteSize'):connect(function()h.Size=UDim2.new(h.Size.X.Scale,h.Size.X.Offset,h.Size.Y.Scale,n.AbsoluteSize.Y)end)end end;local o={txtcolor=Color3.fromRGB(255,255,255),underline=Color3.fromRGB(0,255,140),barcolor=Color3.fromRGB(40,40,40),bgcolor=Color3.fromRGB(30,30,30)}function a:Create(p,q)local r=Instance.new(p)for s,t in next,q do if s~="Parent"then r[s]=t end end;r.Parent=q.Parent;return r end;function a:CreateWindow(u)assert(u.text,"no name")local v={count=0,toggles={},closed=false}local u=u or{}setmetatable(u,{__index=o})self.windowcount=self.windowcount+1;a.gui=a.gui or self:Create("ScreenGui",{Name="UILibrary",Parent=game:GetService("CoreGui")})v.frame=self:Create("Frame",{Name=u.text,Parent=self.gui,Active=true,BackgroundTransparency=0,Size=UDim2.new(0,190,0,30),Position=UDim2.new(0,15+200*self.windowcount-200,0,15),BackgroundColor3=u.barcolor,BorderSizePixel=0})v.background=self:Create('Frame',{Name='Background',Parent=v.frame,BorderSizePixel=0,BackgroundColor3=u.bgcolor,Position=UDim2.new(0,0,1,0),Size=UDim2.new(1,0,0,25),ClipsDescendants=true})v.container=self:Create('Frame',{Name='Container',Parent=v.frame,BorderSizePixel=0,BackgroundColor3=u.bgcolor,Position=UDim2.new(0,0,1,0),Size=UDim2.new(1,0,0,25),ClipsDescendants=true})v.organizer=self:Create('UIListLayout',{Name='Sorter',SortOrder=Enum.SortOrder.LayoutOrder,Parent=v.container})v.padder=self:Create('UIPadding',{Name='Padding',PaddingLeft=UDim.new(0,10),PaddingTop=UDim.new(0,5),Parent=v.container})self:Create("Frame",{Name='Underline',Size=UDim2.new(1,0,0,1),Position=UDim2.new(0,0,1,-1),BorderSizePixel=0,BackgroundColor3=u.underline,Parent=v.frame})local w=self:Create("TextButton",{Name='Toggle',ZIndex=2,BackgroundTransparency=1,Position=UDim2.new(1,-25,0,0),Size=UDim2.new(0,25,1,0),Text="-",TextSize=17,TextColor3=u.txtcolor,Font=Enum.Font.SourceSans,Parent=v.frame})w.MouseButton1Click:connect(function()v.closed=not v.closed;w.Text=v.closed and"+"or"-"if v.closed then v:Resize(true,UDim2.new(1,0,0,0))else v:Resize(true)end end)self:Create("TextLabel",{Size=UDim2.new(1,0,1,0),BackgroundTransparency=1,BorderSizePixel=0,TextColor3=u.txtcolor,TextColor3=u.bartextcolor or Color3.fromRGB(255,255,255),TextSize=17,Font=Enum.Font.SourceSansSemibold,Text=u.text or"window",Name="Window",Parent=v.frame})do b.new(v.frame)c.new(v.background,v.container)end;local function x()local y=0;for s,r in next,v.container:GetChildren()do if not r:IsA('UIListLayout')and not r:IsA('UIPadding')then y=y+r.AbsoluteSize.Y end end;return UDim2.new(1,0,0,y+10)end;function v:Resize(z,A)local B=A or x()self.container.ClipsDescendants=true;if z then self.background:TweenSize(B,"Out","Sine",0.5,true)else self.background.Size=B end end;function v:AddToggle(C,D)self.count=self.count+1;D=D or function()end;local E=a:Create("TextLabel",{Text=C,Size=UDim2.new(1,-10,0,20),BackgroundTransparency=1,TextColor3=Color3.fromRGB(255,255,255),TextXAlignment=Enum.TextXAlignment.Left,LayoutOrder=self.Count,TextSize=16,Font=Enum.Font.SourceSans,Parent=self.container})local F=a:Create("TextButton",{Text="OFF",TextColor3=Color3.fromRGB(255,25,25),BackgroundTransparency=1,Position=UDim2.new(1,-25,0,0),Size=UDim2.new(0,25,1,0),TextSize=17,Font=Enum.Font.SourceSansSemibold,Parent=E})F.MouseButton1Click:connect(function()self.toggles[C]=not self.toggles[C]F.TextColor3=self.toggles[C]and Color3.fromRGB(0,255,140)or Color3.fromRGB(255,25,25)F.Text=self.toggles[C]and"ON"or"OFF"D(self.toggles[C])end)self:Resize()return F end;function v:AddBox(C,D)self.count=self.count+1;D=D or function()end;local G=a:Create("TextBox",{PlaceholderText=C,Size=UDim2.new(1,-10,0,20),BackgroundTransparency=0.75,BackgroundColor3=u.boxcolor,TextColor3=Color3.fromRGB(255,255,255),TextXAlignment=Enum.TextXAlignment.Center,TextSize=16,Text="",Font=Enum.Font.SourceSans,LayoutOrder=self.Count,BorderSizePixel=0,Parent=self.container})G.FocusLost:connect(function(...)D(G,...)end)self:Resize()return G end;function v:AddButton(C,D)self.count=self.count+1;D=D or function()end;local F=a:Create("TextButton",{Text=C,Size=UDim2.new(1,-10,0,20),BackgroundTransparency=1,TextColor3=Color3.fromRGB(255,255,255),TextXAlignment=Enum.TextXAlignment.Left,TextSize=16,Font=Enum.Font.SourceSans,LayoutOrder=self.Count,Parent=self.container})F.MouseButton1Click:connect(D)self:Resize()return F end;function v:AddLabel(C)self.count=self.count+1;local H=game:GetService('TextService'):GetTextSize(C,16,Enum.Font.SourceSans,Vector2.new(math.huge,math.huge))local F=a:Create("TextLabel",{Text=C,Size=UDim2.new(1,-10,0,H.Y+5),TextScaled=false,BackgroundTransparency=1,TextColor3=Color3.fromRGB(255,255,255),TextXAlignment=Enum.TextXAlignment.Left,TextSize=16,Font=Enum.Font.SourceSans,LayoutOrder=self.Count,Parent=self.container})self:Resize()return F end;function v:AddDropdown(u,D)self.count=self.count+1;local I=u[1]or""D=D or function()end;local J=a:Create("TextLabel",{Size=UDim2.new(1,-10,0,20),BackgroundTransparency=0.75,BackgroundColor3=u.boxcolor,TextColor3=Color3.fromRGB(255,255,255),TextXAlignment=Enum.TextXAlignment.Center,TextSize=16,Text=I,Font=Enum.Font.SourceSans,BorderSizePixel=0,LayoutOrder=self.Count,Parent=self.container})local F=a:Create("ImageButton",{BackgroundTransparency=1,Image='rbxassetid://3234893186',Size=UDim2.new(0,18,1,0),Position=UDim2.new(1,-20,0,0),Parent=J})local g;local function K(g)local L=game:GetService('UserInputService'):GetMouseLocation()local d=Vector2.new(L.X,L.Y-36)local M,N=g.AbsolutePosition.X,g.AbsolutePosition.X+g.AbsoluteSize.X;local O,P=g.AbsolutePosition.Y,g.AbsolutePosition.Y+g.AbsoluteSize.Y;return d.X>=M and d.X<=N and(d.Y>=O and d.Y<=P)end;local function Q(R)local S=0;for s,T in next,R do S=S+1 end;return S end;F.MouseButton1Click:connect(function()if Q(u)==0 then return end;if g then g:Destroy()g=nil end;self.container.ClipsDescendants=false;g=a:Create('Frame',{Position=UDim2.new(0,0,1,0),BackgroundColor3=Color3.fromRGB(40,40,40),Size=UDim2.new(0,J.AbsoluteSize.X,0,Q(u)*21),BorderSizePixel=0,Parent=J,ClipsDescendants=true,ZIndex=2})a:Create('UIListLayout',{Name='Layout',Parent=g})for s,U in next,u do local V=a:Create('TextButton',{Text=U,BackgroundColor3=Color3.fromRGB(40,40,40),TextColor3=Color3.fromRGB(255,255,255),BorderSizePixel=0,TextSize=16,Font=Enum.Font.SourceSans,Size=UDim2.new(1,0,0,21),Parent=g,ZIndex=2})V.MouseButton1Click:connect(function()J.Text=U;D(U)g.Size=UDim2.new(1,0,0,0)game:GetService('Debris'):AddItem(g,0.1)end)end end)game:GetService('UserInputService').InputBegan:connect(function(W)if W.UserInputType==Enum.UserInputType.MouseButton1 then if g and not K(g)then game:GetService('Debris'):AddItem(g)end end end)D(I)self:Resize()return{Refresh=function(self,X)game:GetService('Debris'):AddItem(g)u=X;J.Text=u[1]end}end;return v end;return a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement