ExploiterRoblox

unique UI Library

Nov 29th, 2021 (edited)
824
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2. This is for ROBLOX.
  3.  
  4.  
  5.  
  6.  
  7. Scroll till below to find out library.
  8. by unique (me probably)
  9.  
  10. ]]
  11.  
  12. -- thanks to xHeptc for help
  13.  
  14. if game.CoreGui:FindFirstChild("UILib") then
  15.  
  16.       game.CoreGui:FindFirstChild("UILib"):Destroy()
  17.  
  18.  end
  19.  
  20. local lib = {}
  21.  
  22.  
  23. function lib:NewWindow(text)
  24.  
  25.  
  26.  
  27.     text = text or "unique Lib"
  28.    
  29.    
  30.    
  31. local UILib = Instance.new("ScreenGui")
  32. local Tab = Instance.new("Frame")
  33. local Title = Instance.new("TextLabel")
  34. local Size = Instance.new("TextButton")
  35. local Main = Instance.new("Frame")
  36. local ScrollingFrame = Instance.new("ScrollingFrame")
  37. local ScrollingCorner = Instance.new("UICorner")
  38. local UIListLayout = Instance.new("UIListLayout")
  39. local MainCorner = Instance.new("UICorner")
  40.  
  41.  
  42.  
  43. UILib.Name = "UILib"
  44. UILib.Parent = game.CoreGui
  45. UILib.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  46.  
  47. Tab.Name = "Tab"
  48. Tab.Parent = UILib
  49. Tab.BackgroundColor3 = Color3.fromRGB(33, 33, 33)
  50. Tab.BorderSizePixel = 0
  51. Tab.Position = UDim2.new(0.0182704031, 0, 0.0159045719, 0)
  52. Tab.Size = UDim2.new(0, 150, 0, 24)
  53.  
  54. Title.Name = "Title"
  55. Title.Parent = Tab
  56. Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  57. Title.BackgroundTransparency = 1.000
  58. Title.BorderSizePixel = 0
  59. Title.Size = UDim2.new(0, 125, 0, 22)
  60. Title.Font = Enum.Font.SourceSans
  61. Title.Text = text
  62. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  63. Title.TextScaled = true
  64. Title.TextSize = 14.000
  65. Title.TextWrapped = true
  66.  
  67. Size.Name = "Size"
  68. Size.Parent = Tab
  69. Size.BackgroundColor3 = Color3.fromRGB(255, 75, 21)
  70. Size.BackgroundTransparency = 1.000
  71. Size.BorderSizePixel = 0
  72. Size.Position = UDim2.new(0.833333313, 0, 0.166666672, 0)
  73. Size.Size = UDim2.new(0, 17, 0, 14)
  74. Size.Font = Enum.Font.SourceSans
  75. Size.Text = "-"
  76. Size.TextColor3 = Color3.fromRGB(255, 255, 255)
  77. Size.TextSize = 33.000
  78. Size.TextWrapped = true
  79.  
  80. Main.Name = "Main"
  81. Main.Parent = Tab
  82. Main.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  83. Main.BorderSizePixel = 0
  84. Main.Position = UDim2.new(-0.00172959827, 0, 0.972249806, 0)
  85. Main.Size = UDim2.new(0, 150, 0, 287)
  86.  
  87. ScrollingFrame.Parent = Main
  88. ScrollingFrame.Active = true
  89. ScrollingFrame.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  90. ScrollingFrame.BorderColor3 = Color3.fromRGB(27, 42, 53)
  91. ScrollingFrame.BorderSizePixel = 0
  92. ScrollingFrame.Position = UDim2.new(0.0466666669, 0, 0.0592334419, 0)
  93. ScrollingFrame.Size = UDim2.new(0, 136, 0, 253)
  94. ScrollingFrame.ScrollBarThickness = 1
  95.  
  96. ScrollingCorner.Name = "ScrollingCorner"
  97. ScrollingCorner.Parent = ScrollingFrame
  98.  
  99. UIListLayout.Parent = ScrollingFrame
  100. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  101. UIListLayout.Padding = UDim.new(0, 5)
  102.    
  103. MainCorner.CornerRadius = UDim.new(0, 3)
  104. MainCorner.Name = "MainCorner"
  105. MainCorner.Parent = Tab
  106.  
  107. local function OGJNW_fake_script()
  108.         local script = Instance.new('LocalScript', Tab)
  109.  
  110.         local UIS = game:GetService("UserInputService")
  111.         function dragify(Frame)
  112.             dragToggle = nil
  113.             local dragSpeed = 0
  114.             dragInput = nil
  115.             dragStart = nil
  116.             local dragPos = nil
  117.             function updateInput(input)
  118.                 local Delta = input.Position - dragStart
  119.                 local Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + Delta.X, startPos.Y.Scale, startPos.Y.Offset + Delta.Y)
  120.                 game:GetService("TweenService"):Create(Frame, TweenInfo.new(0.25), {Position = Position}):Play()
  121.             end
  122.             Frame.InputBegan:Connect(function(input)
  123.                 if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) and UIS:GetFocusedTextBox() == nil then
  124.                     dragToggle = true
  125.                     dragStart = input.Position
  126.                     startPos = Frame.Position
  127.                     input.Changed:Connect(function()
  128.                         if input.UserInputState == Enum.UserInputState.End then
  129.                             dragToggle = false
  130.                         end
  131.                     end)
  132.                 end
  133.             end)
  134.             Frame.InputChanged:Connect(function(input)
  135.                 if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  136.                     dragInput = input
  137.                 end
  138.             end)
  139.             game:GetService("UserInputService").InputChanged:Connect(function(input)
  140.                 if input == dragInput and dragToggle then
  141.                     updateInput(input)
  142.                 end
  143.             end)
  144.         end
  145.  
  146.         dragify(script.Parent)
  147.     end
  148.     coroutine.wrap(OGJNW_fake_script)()
  149.     local function ERENJY_fake_script()
  150.         local script = Instance.new('LocalScript', Size)
  151.  
  152.         local scrollingframe = script.Parent.Parent.Main.ScrollingFrame
  153.  
  154.         script.Parent.MouseButton1Click:Connect(function()
  155.             if script.Parent.Parent.Main.Visible == true then
  156.                 scrollingframe.Visible = false
  157.                 script.Parent.Parent.Main:TweenSize(UDim2.new(0, 150,0, 0), "Out", "Quad", 0.2)
  158.                 script.Disabled = true
  159.                 wait(0.2)
  160.                 script.Disabled = false
  161.                 script.Parent.Parent.Main.Visible = false
  162.             else
  163.                 if script.Parent.Parent.Main.Visible == false then
  164.                     script.Parent.Parent.Main.Visible = true
  165.                     script.Parent.Parent.Main:TweenSize(UDim2.new(0, 150,0, 287), "Out", "Quad", 0.2)
  166.                     script.Disabled = true
  167.                     wait(0.2)
  168.                     script.Disabled = false
  169.                     scrollingframe.Visible = true
  170.                 end
  171.             end
  172.         end)
  173.     end
  174.     coroutine.wrap(ERENJY_fake_script)()
  175.  
  176.  
  177.     local ElementHandler = {}
  178.    
  179.     function ElementHandler:CreateButton(btnText, callback)
  180.        
  181.         btnText = btnText or "Text Button"
  182.         callback = callback or function() end  
  183.        
  184.         local TextButton = Instance.new("TextButton")
  185.         local ButtonCorner = Instance.new("UICorner")
  186.        
  187.  
  188.         TextButton.Parent = ScrollingFrame
  189.         TextButton.BackgroundColor3 = Color3.fromRGB(255, 75, 21)
  190.         TextButton.Size = UDim2.new(0, 136, 0, 24)
  191.         TextButton.Font = Enum.Font.SourceSans
  192.         TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  193.         TextButton.TextScaled = true
  194.         TextButton.TextSize = 14.000
  195.         TextButton.Text = btnText
  196.         TextButton.TextWrapped = true
  197.         TextButton.ZIndex = 1      
  198.         TextButton.MouseButton1Click:Connect(function()
  199.             callback()
  200.         end)
  201.        
  202.         ButtonCorner.CornerRadius = UDim.new(0, 8)
  203.         ButtonCorner.Name = "buttonCorner"
  204.         ButtonCorner.Parent = TextButton
  205.     end
  206.    
  207.     function ElementHandler:CreateLabel(LabelText)
  208.        
  209.         LabelText = LabelText or "Label"
  210.        
  211.         local TextLabel = Instance.new("TextLabel")
  212.        
  213.         TextLabel.BackgroundTransparency = 1
  214.         TextLabel.Parent = ScrollingFrame
  215.         TextLabel.BackgroundColor3 = Color3.fromRGB(255, 75, 21)
  216.         TextLabel.Size = UDim2.new(0, 136, 0, 24)
  217.         TextLabel.Font = Enum.Font.SourceSans
  218.         TextLabel.Text = LabelText
  219.         TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  220.         TextLabel.TextScaled = true
  221.         TextLabel.TextSize = 14.000
  222.         TextLabel.TextWrapped = true
  223.     end
  224.    
  225.    
  226.     function ElementHandler:CreateToggle(Text, callback)
  227.         Text = Text or "Toggle"
  228.        
  229.         callback = callback or function() end  
  230.        
  231.         local ToggleBtn = Instance.new("TextButton")
  232.         local ToggleCorner = Instance.new("UICorner")
  233.         local toggle = Instance.new("Frame")
  234.         local UICorner = Instance.new("UICorner")
  235.         local ToggleInfo = Instance.new("TextLabel")
  236.        
  237.         ToggleBtn.Name = "ToggleBtn"
  238.         ToggleBtn.Parent = ScrollingFrame
  239.         ToggleBtn.BackgroundColor3 = Color3.fromRGB(255, 75, 21)
  240.         ToggleBtn.Position = UDim2.new(0, 0, 0.229249015, 0)
  241.         ToggleBtn.Size = UDim2.new(0, 24, 0, 23)
  242.         ToggleBtn.Font = Enum.Font.SourceSans
  243.         ToggleBtn.Text = ""
  244.         ToggleBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  245.         ToggleBtn.TextSize = 14.000
  246.         ToggleBtn.TextWrapped = true
  247.  
  248.         ToggleCorner.CornerRadius = UDim.new(1, 999)
  249.         ToggleCorner.Name = "ToggleCorner"
  250.         ToggleCorner.Parent = ToggleBtn
  251.  
  252.         toggle.Name = "toggle"
  253.         toggle.Parent = ToggleBtn
  254.         toggle.BackgroundColor3 = Color3.fromRGB(39, 39, 39)
  255.         toggle.BorderSizePixel = 0
  256.         toggle.Position = UDim2.new(1.25, 0, 0, 0)
  257.         toggle.Size = UDim2.new(0, 105, 0, 23)
  258.         toggle.ZIndex = 0
  259.  
  260.         UICorner.CornerRadius = UDim.new(1, 999)
  261.         UICorner.Parent = toggle
  262.  
  263.         ToggleInfo.Name = "ToggleInfo"
  264.         ToggleInfo.Parent = toggle
  265.         ToggleInfo.BackgroundColor3 = Color3.fromRGB(255, 75, 21)
  266.         ToggleInfo.BackgroundTransparency = 1.000
  267.         ToggleInfo.Size = UDim2.new(0, 106, 0, 23)
  268.         ToggleInfo.Font = Enum.Font.SourceSans
  269.         ToggleInfo.Text = Text
  270.         ToggleInfo.TextColor3 = Color3.fromRGB(255, 255, 255)
  271.         ToggleInfo.TextScaled = true
  272.         ToggleInfo.TextSize = 14.000
  273.         ToggleInfo.TextWrapped = true
  274.        
  275.        
  276.         local tog = false
  277.  
  278.         ToggleBtn.MouseButton1Click:Connect(function()
  279.             tog = not tog
  280.             callback(tog) -- Callbacks whenever we toggle
  281.             if tog then
  282.                 game.TweenService:Create(ToggleBtn, TweenInfo.new(0.15, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {
  283.                     BackgroundColor3 = Color3.fromRGB(12, 255, 0)
  284.                 }):Play()
  285.                 --- We put our animation here when the toggle is on
  286.             else
  287.                 game.TweenService:Create(ToggleBtn, TweenInfo.new(0.15, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {
  288.                     BackgroundColor3 = Color3.fromRGB(255, 75, 21)
  289.                 }):Play()
  290.                 ---We Put our animation here when the toggle is off
  291.             end
  292.         end)
  293.  
  294.     end
  295.    
  296.     function ElementHandler:CreateTextBox(TxtBoxText, callback)
  297.     TxtBoxText = TxtBoxText or "PlaceHolder"
  298.    
  299.     callback = callback or function() end
  300.  
  301.     local TextBox = Instance.new("TextBox")
  302.     local ButtonCorner_2 = Instance.new("UICorner")
  303.  
  304.     TextBox.Parent = ScrollingFrame
  305.     TextBox.BackgroundColor3 = Color3.fromRGB(222, 62, 18)
  306.     TextBox.Size = UDim2.new(0, 136, 0, 24)
  307.     TextBox.Font = Enum.Font.SourceSans
  308.     TextBox.PlaceholderColor3 = Color3.fromRGB(238, 238, 238)
  309.     TextBox.PlaceholderText = TxtBoxText
  310.     TextBox.Text = ""
  311.     TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  312.     TextBox.TextScaled = true
  313.     TextBox.TextSize = 14.000
  314.     TextBox.TextWrapped = true
  315.  
  316.     ButtonCorner_2.Name = "ButtonCorner"
  317.     ButtonCorner_2.Parent = TextBox
  318.  
  319.     TextBox.Focused:Connect(function()
  320.    
  321.     TextBox.FocusLost:Connect(function()
  322.  
  323.     callback(TextBox.Text)
  324.  
  325.     end)
  326.     end)
  327.    
  328.     end
  329.    
  330.     return ElementHandler
  331. end
  332. -- Main UI Library
  333.  
  334. local main = lib:NewWindow("Title or something") -- adds new window
  335.  
  336. main:CreateButton("print", function() -- adds button
  337. print("unique or no")
  338. end)
  339.  
  340. main:CreateLabel("whos cool? idk") -- adds label
  341.  
  342. main:CreateToggle("print some toggle", function(state) -- adds toggle
  343. print(state)
  344. end)
  345.  
  346. main:CreateTextBox("TextBox", function(text) -- a textbox ofc
  347. game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = text
  348. end)
  349.  
  350. return -- dont remove this otherwise you broke it!
RAW Paste Data