Advertisement
DracoFAAD

TwinkLibEdit

Jan 17th, 2023 (edited)
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.04 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local Mouse = Player:GetMouse()
  3.  
  4. local TweenService = game:GetService("TweenService")
  5. local UserInputService = game:GetService("UserInputService")
  6. local CoreGuiService = game:GetService("CoreGui")
  7. local RunService = game:GetService("RunService")
  8. local TextService = game:GetService("TextService")
  9.  
  10. local TweenTime = 0.1
  11. local Level = 1
  12.  
  13. local GlobalTweenInfo = TweenInfo.new(TweenTime)
  14. local AlteredTweenInfo = TweenInfo.new(TweenTime, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
  15.  
  16. local DropShadowID = "rbxassetid://297774371"
  17. local DropShadowTransparency = 0.3
  18.  
  19. local IconLibraryID = "rbxassetid://3926305904"
  20. local IconLibraryID2 = "rbxassetid://3926307971"
  21.  
  22. local MainFont = Enum.Font.Gotham
  23.  
  24. local function GetXY(GuiObject)
  25. local X, Y = Mouse.X - GuiObject.AbsolutePosition.X, Mouse.Y - GuiObject.AbsolutePosition.Y
  26. local MaxX, MaxY = GuiObject.AbsoluteSize.X, GuiObject.AbsoluteSize.Y
  27. X, Y = math.clamp(X, 0, MaxX), math.clamp(Y, 0, MaxY)
  28. return X, Y, X/MaxX, Y/MaxY
  29. end
  30.  
  31. local function TitleIcon(ButtonOrNot)
  32. local NewTitleIcon = Instance.new(ButtonOrNot and "ImageButton" or "ImageLabel")
  33. NewTitleIcon.Name = "TitleIcon"
  34. NewTitleIcon.BackgroundTransparency = 1
  35. NewTitleIcon.Image = IconLibraryID
  36. NewTitleIcon.ImageRectOffset = Vector2.new(524, 764)
  37. NewTitleIcon.ImageRectSize = Vector2.new(36, 36)
  38. NewTitleIcon.Size = UDim2.new(0,14,0,14)
  39. NewTitleIcon.Position = UDim2.new(1,-17,0,3)
  40. NewTitleIcon.Rotation = 180
  41. NewTitleIcon.ZIndex = Level
  42. return NewTitleIcon
  43. end
  44.  
  45. local function TickIcon(ButtonOrNot)
  46. local NewTickIcon = Instance.new(ButtonOrNot and "ImageButton" or "ImageLabel")
  47. NewTickIcon.Name = "TickIcon"
  48. NewTickIcon.BackgroundTransparency = 1
  49. NewTickIcon.Image = "rbxassetid://3926305904"
  50. NewTickIcon.ImageRectOffset = Vector2.new(312,4)
  51. NewTickIcon.ImageRectSize = Vector2.new(24,24)
  52. NewTickIcon.Size = UDim2.new(1,-6,1,-6)
  53. NewTickIcon.Position = UDim2.new(0,3,0,3)
  54. NewTickIcon.ZIndex = Level
  55. return NewTickIcon
  56. end
  57.  
  58. local function DropdownIcon(ButtonOrNot)
  59. local NewDropdownIcon = Instance.new(ButtonOrNot and "ImageButton" or "ImageLabel")
  60. NewDropdownIcon.Name = "DropdownIcon"
  61. NewDropdownIcon.BackgroundTransparency = 1
  62. NewDropdownIcon.Image = IconLibraryID2
  63. NewDropdownIcon.ImageRectOffset = Vector2.new(324,364)
  64. NewDropdownIcon.ImageRectSize = Vector2.new(36,36)
  65. NewDropdownIcon.Size = UDim2.new(0,16,0,16)
  66. NewDropdownIcon.Position = UDim2.new(1,-18,0,2)
  67. NewDropdownIcon.ZIndex = Level
  68. return NewDropdownIcon
  69. end
  70.  
  71. local function SearchIcon(ButtonOrNot)
  72. local NewSearchIcon = Instance.new(ButtonOrNot and "ImageButton" or "ImageLabel")
  73. NewSearchIcon.Name = "SearchIcon"
  74. NewSearchIcon.BackgroundTransparency = 1
  75. NewSearchIcon.Image = IconLibraryID
  76. NewSearchIcon.ImageRectOffset = Vector2.new(964,324)
  77. NewSearchIcon.ImageRectSize = Vector2.new(36,36)
  78. NewSearchIcon.Size = UDim2.new(0,16,0,16)
  79. NewSearchIcon.Position = UDim2.new(0,2,0,2)
  80. NewSearchIcon.ZIndex = Level
  81. return NewSearchIcon
  82. end
  83.  
  84. local function RoundBox(CornerRadius, ButtonOrNot)
  85. local NewRoundBox = Instance.new(ButtonOrNot and "ImageButton" or "ImageLabel")
  86. NewRoundBox.BackgroundTransparency = 1
  87. NewRoundBox.Image = "rbxassetid://3570695787"
  88. NewRoundBox.SliceCenter = Rect.new(100,100,100,100)
  89. NewRoundBox.SliceScale = math.clamp((CornerRadius or 5) * 0.01, 0.01, 1)
  90. NewRoundBox.ScaleType = Enum.ScaleType.Slice
  91. NewRoundBox.ZIndex = Level
  92. return NewRoundBox
  93. end
  94.  
  95. local function DropShadow()
  96. local NewDropShadow = Instance.new("ImageLabel")
  97. NewDropShadow.Name = "DropShadow"
  98. NewDropShadow.BackgroundTransparency = 1
  99. NewDropShadow.Image = DropShadowID
  100. NewDropShadow.ImageTransparency = DropShadowTransparency
  101. NewDropShadow.Size = UDim2.new(1,0,1,0)
  102. NewDropShadow.ZIndex = Level
  103. return NewDropShadow
  104. end
  105.  
  106. local function Frame()
  107. local NewFrame = Instance.new("Frame")
  108. NewFrame.BorderSizePixel = 0
  109. NewFrame.ZIndex = Level
  110. return NewFrame
  111. end
  112.  
  113. local function ScrollingFrame()
  114. local NewScrollingFrame = Instance.new("ScrollingFrame")
  115. NewScrollingFrame.BackgroundTransparency = 1
  116. NewScrollingFrame.BorderSizePixel = 0
  117. NewScrollingFrame.ScrollBarThickness = 0
  118. NewScrollingFrame.ZIndex = Level
  119. return NewScrollingFrame
  120. end
  121.  
  122. local function TextButton(Text, Size)
  123. local NewTextButton = Instance.new("TextButton")
  124. NewTextButton.Text = Text
  125. NewTextButton.AutoButtonColor = false
  126. NewTextButton.Font = MainFont
  127. NewTextButton.TextColor3 = Color3.fromRGB(255,255,255)
  128. NewTextButton.BackgroundTransparency = 1
  129. NewTextButton.TextSize = Size or 12
  130. NewTextButton.Size = UDim2.new(1,0,1,0)
  131. NewTextButton.ZIndex = Level
  132. return NewTextButton
  133. end
  134.  
  135. local function TextBox(Text, Size)
  136. local NewTextBox = Instance.new("TextBox")
  137. NewTextBox.Text = Text
  138. NewTextBox.Font = MainFont
  139. NewTextBox.TextColor3 = Color3.fromRGB(255,255,255)
  140. NewTextBox.BackgroundTransparency = 1
  141. NewTextBox.TextSize = Size or 12
  142. NewTextBox.Size = UDim2.new(1,0,1,0)
  143. NewTextBox.ZIndex = Level
  144. return NewTextBox
  145. end
  146.  
  147. local function TextLabel(Text, Size)
  148. local NewTextLabel = Instance.new("TextLabel")
  149. NewTextLabel.Text = Text
  150. NewTextLabel.Font = MainFont
  151. NewTextLabel.TextColor3 = Color3.fromRGB(255,255,255)
  152. NewTextLabel.BackgroundTransparency = 1
  153. NewTextLabel.TextSize = Size or 12
  154. NewTextLabel.Size = UDim2.new(1,0,1,0)
  155. NewTextLabel.ZIndex = Level
  156. return NewTextLabel
  157. end
  158.  
  159. local function Tween(GuiObject, Dictionary)
  160. local TweenBase = TweenService:Create(GuiObject, GlobalTweenInfo, Dictionary)
  161. TweenBase:Play()
  162. return TweenBase
  163. end
  164.  
  165. local UILibrary = {}
  166.  
  167. function UILibrary.Load(GUITitle)
  168. local TargetedParent = RunService:IsStudio() and Player:WaitForChild("PlayerGui") or CoreGuiService
  169.  
  170. local FindOldInstance = TargetedParent:FindFirstChild(GUITitle)
  171.  
  172. if FindOldInstance then
  173. FindOldInstance:Destroy()
  174. end
  175.  
  176. local NewInstance, ContainerFrame, ContainerShadow, MainFrame
  177.  
  178. NewInstance = Instance.new("ScreenGui")
  179. NewInstance.Name = GUITitle
  180. NewInstance.Parent = TargetedParent
  181.  
  182. ContainerFrame = Frame()
  183. ContainerFrame.Name = "ContainerFrame"
  184. ContainerFrame.Size = UDim2.new(0,500,0,300)
  185. ContainerFrame.Position = UDim2.new(0.5,-250,0.5,-150)
  186. ContainerFrame.BackgroundTransparency = 1
  187. ContainerFrame.Parent = NewInstance
  188.  
  189. ContainerShadow = DropShadow()
  190. ContainerShadow.Name = "Shadow"
  191. ContainerShadow.Parent = ContainerFrame
  192.  
  193. Level += 1
  194.  
  195. MainFrame = RoundBox(5)
  196. MainFrame.ClipsDescendants = true
  197. MainFrame.Name = "MainFrame"
  198. MainFrame.Size = UDim2.new(1,-50,1,-30)
  199. MainFrame.Position = UDim2.new(0,25,0,15)
  200. MainFrame.ImageColor3 = Color3.fromRGB(30,30,30)
  201. MainFrame.Parent = ContainerFrame
  202.  
  203. local MenuBar, DisplayFrame, TitleBar
  204.  
  205. MenuBar = ScrollingFrame()
  206. MenuBar.Name = "MenuBar"
  207. MenuBar.BackgroundTransparency = 0.7
  208. MenuBar.BackgroundColor3 = Color3.fromRGB(20,20,20)
  209. MenuBar.Size = UDim2.new(0,100,0,235)
  210. MenuBar.Position = UDim2.new(0,5,0,30)
  211. MenuBar.CanvasSize = UDim2.new(0,0,0,0)
  212. MenuBar.Parent = MainFrame
  213.  
  214. DisplayFrame = RoundBox(5)
  215. DisplayFrame.Name = "Display"
  216. DisplayFrame.ImageColor3 = Color3.fromRGB(20,20,20)
  217. DisplayFrame.Size = UDim2.new(1,-115,0,235)
  218. DisplayFrame.Position = UDim2.new(0,110,0,30)
  219. DisplayFrame.Parent = MainFrame
  220.  
  221. TitleBar = RoundBox(5)
  222. TitleBar.Name = "TitleBar"
  223. TitleBar.ImageColor3 = Color3.fromRGB(40,40,40)
  224. TitleBar.Size = UDim2.new(1,-10,0,20)
  225. TitleBar.Position = UDim2.new(0,5,0,5)
  226. TitleBar.Parent = MainFrame
  227.  
  228. Level += 1
  229.  
  230. local MinimiseButton, TitleButton
  231. local MinimiseToggle = true
  232.  
  233. MinimiseButton = TitleIcon(true)
  234. MinimiseButton.Name = "Minimise"
  235. MinimiseButton.Parent = TitleBar
  236.  
  237. TitleButton = TextButton(GUITitle, 14)
  238. TitleButton.Name = "TitleButton"
  239. TitleButton.Size = UDim2.new(1,-20,1,0)
  240. TitleButton.Parent = TitleBar
  241.  
  242. MinimiseButton.MouseButton1Down:Connect(function()
  243. MinimiseToggle = not MinimiseToggle
  244. if not MinimiseToggle then
  245. Tween(MainFrame, {Size = UDim2.new(1,-50,0,30)})
  246. Tween(MinimiseButton, {Rotation = 0})
  247. Tween(ContainerShadow, {ImageTransparency = 1})
  248. else
  249. Tween(MainFrame, {Size = UDim2.new(1,-50,1,-30)})
  250. Tween(MinimiseButton, {Rotation = 180})
  251. Tween(ContainerShadow, {ImageTransparency = DropShadowTransparency})
  252. end
  253. end)
  254.  
  255. TitleButton.MouseButton1Down:Connect(function()
  256. local LastMX, LastMY = Mouse.X, Mouse.Y
  257. local Move, Kill
  258. Move = Mouse.Move:Connect(function()
  259. local NewMX, NewMY = Mouse.X, Mouse.Y
  260. local DX, DY = NewMX - LastMX, NewMY - LastMY
  261. ContainerFrame.Position += UDim2.new(0,DX,0,DY)
  262. LastMX, LastMY = NewMX, NewMY
  263. end)
  264. Kill = UserInputService.InputEnded:Connect(function(input)
  265. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  266. Move:Disconnect()
  267. Kill:Disconnect()
  268. end
  269. end)
  270. end)
  271.  
  272. Level += 1
  273.  
  274. local MenuListLayout
  275.  
  276. MenuListLayout = Instance.new("UIListLayout")
  277. MenuListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  278. MenuListLayout.Padding = UDim.new(0,5)
  279. MenuListLayout.Parent = MenuBar
  280.  
  281. local TabCount = 0
  282.  
  283. local TabLibrary = {}
  284.  
  285. function TabLibrary.GetInstance()
  286. return NewInstance
  287. end
  288.  
  289. function TabLibrary.AddPage(PageTitle, SearchBarIncluded)
  290. local SearchBarIncluded = (SearchBarIncluded == nil) and true or SearchBarIncluded
  291.  
  292. local PageContainer = RoundBox(5)
  293. PageContainer.Name = PageTitle
  294. PageContainer.Size = UDim2.new(1,0,0,20)
  295. PageContainer.LayoutOrder = TabCount
  296. PageContainer.ImageColor3 = (TabCount == 0) and Color3.fromRGB(50,50,50) or Color3.fromRGB(40,40,40)
  297. PageContainer.Parent = MenuBar
  298.  
  299. local PageButton = TextButton(PageTitle, 14)
  300. PageButton.Name = PageTitle.."Button"
  301. PageButton.TextTransparency = (TabCount == 0) and 0 or 0.5
  302. PageButton.Parent = PageContainer
  303.  
  304. PageButton.MouseButton1Down:Connect(function()
  305. spawn(function()
  306. for _, Button in next, MenuBar:GetChildren() do
  307. if Button:IsA("GuiObject") then
  308. local IsButton = string.find(Button.Name:lower(), PageContainer.Name:lower())
  309. local Button2 = Button:FindFirstChild(Button.Name.."Button")
  310. Tween(Button, {ImageColor3 = IsButton and Color3.fromRGB(50,50,50) or Color3.fromRGB(40,40,40)})
  311. Tween(Button2, {TextTransparency = IsButton and 0 or 0.5})
  312. end
  313. end
  314. end)
  315. spawn(function()
  316. for _, Display in next, DisplayFrame:GetChildren() do
  317. if Display:IsA("GuiObject") then
  318. Display.Visible = string.find(Display.Name:lower(), PageContainer.Name:lower())
  319. end
  320. end
  321. end)
  322. end)
  323.  
  324. local DisplayPage = ScrollingFrame()
  325. DisplayPage.Visible = (TabCount == 0)
  326. DisplayPage.Name = PageTitle
  327. DisplayPage.Size = UDim2.new(1,0,1,0)
  328. DisplayPage.Parent = DisplayFrame
  329.  
  330. TabCount += 1
  331.  
  332. local DisplayList = Instance.new("UIListLayout")
  333. DisplayList.SortOrder = Enum.SortOrder.LayoutOrder
  334. DisplayList.Padding = UDim.new(0,5)
  335. DisplayList.Parent = DisplayPage
  336.  
  337. DisplayList:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  338. local Y1 = DisplayList.AbsoluteContentSize.Y
  339. local Y2 = DisplayPage.AbsoluteWindowSize.Y
  340. DisplayPage.CanvasSize = UDim2.new(0,0,(Y1/Y2)+0.05,0)
  341. end)
  342.  
  343. local DisplayPadding = Instance.new("UIPadding")
  344. DisplayPadding.PaddingBottom = UDim.new(0,5)
  345. DisplayPadding.PaddingTop = UDim.new(0,5)
  346. DisplayPadding.PaddingLeft = UDim.new(0,5)
  347. DisplayPadding.PaddingRight = UDim.new(0,5)
  348. DisplayPadding.Parent = DisplayPage
  349.  
  350. if SearchBarIncluded then
  351. local SearchBarContainer = RoundBox(5)
  352. SearchBarContainer.Name = "SearchBar"
  353. SearchBarContainer.ImageColor3 = Color3.fromRGB(35,35,35)
  354. SearchBarContainer.Size = UDim2.new(1,0,0,20)
  355. SearchBarContainer.Parent = DisplayPage
  356.  
  357. local SearchBox = TextBox("Search...")
  358. SearchBox.Name = "SearchInput"
  359. SearchBox.Position = UDim2.new(0,20,0,0)
  360. SearchBox.Size = UDim2.new(1,-20,1,0)
  361. SearchBox.TextTransparency = 0.5
  362. SearchBox.TextXAlignment = Enum.TextXAlignment.Left
  363. SearchBox.Parent = SearchBarContainer
  364.  
  365. local SearchIcon = SearchIcon()
  366. SearchIcon.Parent = SearchBarContainer
  367.  
  368. SearchBox:GetPropertyChangedSignal("Text"):Connect(function()
  369. local NewValue = SearchBox.Text
  370.  
  371. for _, Element in next, DisplayPage:GetChildren() do
  372. if Element:IsA("Frame") then
  373. if not string.find(Element.Name:lower(), "label") then
  374. if string.find(Element.Name:lower(), NewValue:lower()) then
  375. Element.Visible = true
  376. else
  377. Element.Visible = false
  378. end
  379. end
  380. end
  381. end
  382. end)
  383. end
  384.  
  385. local PageLibrary = {}
  386.  
  387. function PageLibrary.AddButton(Text, Callback, Parent, Underline)
  388. local ButtonContainer = Frame()
  389. ButtonContainer.Name = Text.."BUTTON"
  390. ButtonContainer.Size = UDim2.new(1,0,0,20)
  391. ButtonContainer.BackgroundTransparency = 1
  392. ButtonContainer.Parent = Parent or DisplayPage
  393.  
  394. local ButtonForeground = RoundBox(5)
  395. ButtonForeground.Name = "ButtonForeground"
  396. ButtonForeground.Size = UDim2.new(1,0,1,0)
  397. ButtonForeground.ImageColor3 = Color3.fromRGB(35,35,35)
  398. ButtonForeground.Parent = ButtonContainer
  399.  
  400. if Underline then
  401. local TextSize = TextService:GetTextSize(Text, 12, Enum.Font.Gotham, Vector2.new(0,0))
  402.  
  403. local BottomEffect = Frame()
  404. BottomEffect.Size = UDim2.new(0,TextSize.X,0,1)
  405. BottomEffect.Position = UDim2.new(0.5,(-TextSize.X/2)-1,1,-1)
  406. BottomEffect.BackgroundColor3 = Color3.fromRGB(255,255,255)
  407. BottomEffect.BackgroundTransparency = 0.5
  408. BottomEffect.Parent = ButtonForeground
  409. end
  410.  
  411. local HiddenButton = TextButton(Text, 12)
  412. HiddenButton.Parent = ButtonForeground
  413.  
  414. HiddenButton.MouseButton1Down:Connect(function()
  415. Callback()
  416. Tween(ButtonForeground, {ImageColor3 = Color3.fromRGB(45,45,45)})
  417. Tween(HiddenButton, {TextTransparency = 0.5})
  418. wait(TweenTime)
  419. Tween(ButtonForeground, {ImageColor3 = Color3.fromRGB(35,35,35)})
  420. Tween(HiddenButton, {TextTransparency = 0})
  421. end)
  422. end
  423.  
  424. function PageLibrary.AddLabel(Text)
  425. local LabelContainer = Frame()
  426. LabelContainer.Name = Text.."LABEL"
  427. LabelContainer.Size = UDim2.new(1,0,0,20)
  428. LabelContainer.BackgroundTransparency = 1
  429. LabelContainer.Parent = DisplayPage
  430.  
  431. local LabelForeground = RoundBox(5)
  432. LabelForeground.Name = "LabelForeground"
  433. LabelForeground.ImageColor3 = Color3.fromRGB(45,45,45)
  434. LabelForeground.Size = UDim2.new(1,0,1,0)
  435. LabelForeground.Parent = LabelContainer
  436.  
  437. local HiddenLabel = TextLabel(Text, 12)
  438. HiddenLabel.Parent = LabelForeground
  439. end
  440.  
  441. function PageLibrary.AddDropdown(Text, ConfigurationArray, Callback)
  442. local DropdownArray = ConfigurationArray or {}
  443.  
  444. local DropdownToggle = false
  445.  
  446. local DropdownContainer = Frame()
  447. DropdownContainer.Size = UDim2.new(1,0,0,20)
  448. DropdownContainer.Name = Text.."DROPDOWN"
  449. DropdownContainer.BackgroundTransparency = 1
  450. DropdownContainer.Parent = DisplayPage
  451.  
  452. local DropdownForeground = RoundBox(5)
  453. DropdownForeground.ClipsDescendants = true
  454. DropdownForeground.ImageColor3 = Color3.fromRGB(35,35,35)
  455. DropdownForeground.Size = UDim2.new(1,0,1,0)
  456. DropdownForeground.Parent = DropdownContainer
  457.  
  458. local DropdownExpander = DropdownIcon(true)
  459. DropdownExpander.Parent = DropdownForeground
  460.  
  461. local DropdownLabel = TextLabel(Text, 12)
  462. DropdownLabel.Size = UDim2.new(1,0,0,20)
  463. DropdownLabel.Parent = DropdownForeground
  464.  
  465. local DropdownFrame = Frame()
  466. DropdownFrame.Position = UDim2.new(0,0,0,20)
  467. DropdownFrame.BackgroundTransparency = 1
  468. DropdownFrame.Size = UDim2.new(1,0,0,#DropdownArray*20)
  469. DropdownFrame.Parent = DropdownForeground
  470.  
  471. local DropdownList = Instance.new("UIListLayout")
  472. DropdownList.Parent = DropdownFrame
  473.  
  474. for OptionIndex, Option in next, DropdownArray do
  475. PageLibrary.AddButton(Option, function()
  476. Callback(Option)
  477. DropdownLabel.Text = Text..": "..Option
  478. end, DropdownFrame, OptionIndex < #DropdownArray)
  479. end
  480.  
  481. DropdownExpander.MouseButton1Down:Connect(function()
  482. DropdownToggle = not DropdownToggle
  483. Tween(DropdownContainer, {Size = DropdownToggle and UDim2.new(1,0,0,20+(#DropdownArray*20)) or UDim2.new(1,0,0,20)})
  484. Tween(DropdownExpander, {Rotation = DropdownToggle and 135 or 0})
  485. end)
  486. end
  487.  
  488. function PageLibrary.AddColourPicker(Text, DefaultColour, Callback)
  489. local DefaultColour = DefaultColour or Color3.fromRGB(255,255,255)
  490.  
  491. local ColourDictionary = {
  492. white = Color3.fromRGB(255,255,255),
  493. black = Color3.fromRGB(0,0,0),
  494. red = Color3.fromRGB(255,0,0),
  495. green = Color3.fromRGB(0,255,0),
  496. blue = Color3.fromRGB(0,0,255)
  497. }
  498.  
  499. if typeof(DefaultColour) == "table" then
  500. DefaultColour = Color3.fromRGB(DefaultColour[1] or 255, DefaultColour[2] or 255, DefaultColour[3] or 255)
  501. elseif typeof(DefaultColour) == "string" then
  502. DefaultColour = ColourDictionary[DefaultColour:lower()] or ColourDictionary["white"]
  503. end
  504.  
  505. local PickerContainer = Frame()
  506. PickerContainer.ClipsDescendants = true
  507. PickerContainer.Size = UDim2.new(1,0,0,20)
  508. PickerContainer.Name = Text.."COLOURPICKER"
  509. PickerContainer.BackgroundTransparency = 1
  510. PickerContainer.Parent = DisplayPage
  511.  
  512. local ColourTracker = Instance.new("Color3Value")
  513. ColourTracker.Value = DefaultColour
  514. ColourTracker.Parent = PickerContainer
  515.  
  516. local PickerLeftSide, PickerRightSide, PickerFrame = RoundBox(5), RoundBox(5), RoundBox(5)
  517.  
  518. PickerLeftSide.Size = UDim2.new(1,-22,1,0)
  519. PickerLeftSide.ImageColor3 = Color3.fromRGB(35,35,35)
  520. PickerLeftSide.Parent = PickerContainer
  521.  
  522. PickerRightSide.Size = UDim2.new(0,20,1,0)
  523. PickerRightSide.Position = UDim2.new(1,-20,0,0)
  524. PickerRightSide.ImageColor3 = DefaultColour
  525. PickerRightSide.Parent = PickerContainer
  526.  
  527. PickerFrame.ImageColor3 = Color3.fromRGB(35,35,35)
  528. PickerFrame.Size = UDim2.new(1,-22,0,60)
  529. PickerFrame.Position = UDim2.new(0,0,0,20)
  530. PickerFrame.Parent = PickerContainer
  531.  
  532. local PickerList = Instance.new("UIListLayout")
  533. PickerList.SortOrder = Enum.SortOrder.LayoutOrder
  534. PickerList.Parent = PickerFrame
  535.  
  536. local RedPicker = PageLibrary.AddSlider("R", {Min = 0, Max = 255, Def = ColourTracker.Value.R * 255}, function(Value)
  537. ColourTracker.Value = Color3.fromRGB(Value, ColourTracker.Value.G * 255, ColourTracker.Value.B * 255)
  538. Callback(ColourTracker.Value)
  539. end, PickerFrame)
  540.  
  541. local BluePicker = PageLibrary.AddSlider("G", {Min = 0, Max = 255, Def = ColourTracker.Value.G * 255}, function(Value)
  542. ColourTracker.Value = Color3.fromRGB(ColourTracker.Value.R * 255, Value, ColourTracker.Value.B * 255)
  543. Callback(ColourTracker.Value)
  544. end, PickerFrame)
  545.  
  546. local GreenPicker = PageLibrary.AddSlider("B", {Min = 0, Max = 255, Def = ColourTracker.Value.B * 255}, function(Value)
  547. ColourTracker.Value = Color3.fromRGB(ColourTracker.Value.R * 255, ColourTracker.Value.G * 255, Value)
  548. Callback(ColourTracker.Value)
  549. end, PickerFrame)
  550.  
  551. local EffectLeft, EffectRight = Frame(), Frame()
  552.  
  553. EffectLeft.BackgroundColor3 = Color3.fromRGB(35,35,35)
  554. EffectLeft.Position = UDim2.new(1,-5,0,0)
  555. EffectLeft.Size = UDim2.new(0,5,1,0)
  556. EffectLeft.Parent = PickerLeftSide
  557.  
  558. EffectRight.BackgroundColor3 = DefaultColour
  559. EffectRight.Size = UDim2.new(0,5,1,0)
  560. EffectRight.Parent = PickerRightSide
  561.  
  562. local PickerLabel = TextLabel(Text, 12)
  563. PickerLabel.Size = UDim2.new(1,0,0,20)
  564. PickerLabel.Parent = PickerLeftSide
  565.  
  566. ColourTracker:GetPropertyChangedSignal("Value"):Connect(function()
  567. local NewValue = ColourTracker.Value
  568. EffectRight.BackgroundColor3 = NewValue
  569. PickerRightSide.ImageColor3 = NewValue
  570. end)
  571.  
  572. local PickerToggle = false
  573.  
  574. local PickerButton = TextButton("")
  575. PickerButton.Parent = PickerRightSide
  576.  
  577. PickerButton.MouseButton1Down:Connect(function()
  578. PickerToggle = not PickerToggle
  579. Tween(PickerContainer, {Size = PickerToggle and UDim2.new(1,0,0,80) or UDim2.new(1,0,0,20)})
  580. end)
  581. end
  582.  
  583. function PageLibrary.AddSlider(Text, ConfigurationDictionary, Callback, Parent)
  584. local Configuration = ConfigurationDictionary
  585. local Minimum = Configuration.Minimum or Configuration.minimum or Configuration.Min or Configuration.min
  586. local Maximum = Configuration.Maximum or Configuration.maximum or Configuration.Max or Configuration.max
  587. local Default = Configuration.Default or Configuration.default or Configuration.Def or Configuration.def
  588.  
  589. if Minimum > Maximum then
  590. local StoreValue = Minimum
  591. Minimum = Maximum
  592. Maximum = StoreValue
  593. end
  594.  
  595. Default = math.clamp(Default, Minimum, Maximum)
  596.  
  597. local DefaultScale = Default/Maximum
  598.  
  599. local SliderContainer = Frame()
  600. SliderContainer.Name = Text.."SLIDER"
  601. SliderContainer.Size = UDim2.new(1,0,0,20)
  602. SliderContainer.BackgroundTransparency = 1
  603. SliderContainer.Parent = Parent or DisplayPage
  604.  
  605. local SliderForeground = RoundBox(5)
  606. SliderForeground.Name = "SliderForeground"
  607. SliderForeground.ImageColor3 = Color3.fromRGB(35,35,35)
  608. SliderForeground.Size = UDim2.new(1,0,1,0)
  609. SliderForeground.Parent = SliderContainer
  610.  
  611. local SliderButton = TextButton(Text..": "..Default)
  612. SliderButton.Size = UDim2.new(1,0,1,0)
  613. SliderButton.ZIndex = 6
  614. SliderButton.Parent = SliderForeground
  615.  
  616. local SliderFill = RoundBox(5)
  617. SliderFill.Size = UDim2.new(DefaultScale,0,1,0)
  618. SliderFill.ImageColor3 = Color3.fromRGB(70,70,70)
  619. SliderFill.ZIndex = 5
  620. SliderFill.ImageTransparency = 0.7
  621. SliderFill.Parent = SliderButton
  622.  
  623. SliderButton.MouseButton1Down:Connect(function()
  624. Tween(SliderFill, {ImageTransparency = 0.5})
  625. local X, Y, XScale, YScale = GetXY(SliderButton)
  626. local Value = math.floor(Minimum + ((Maximum - Minimum) * XScale))
  627. Callback(Value)
  628. SliderButton.Text = Text..": "..tostring(Value)
  629. local TargetSize = UDim2.new(XScale,0,1,0)
  630. Tween(SliderFill, {Size = TargetSize})
  631. local SliderMove, SliderKill
  632. SliderMove = Mouse.Move:Connect(function()
  633. Tween(SliderFill, {ImageTransparency = 0.5})
  634. local X, Y, XScale, YScale = GetXY(SliderButton)
  635. local Value = math.floor(Minimum + ((Maximum - Minimum) * XScale))
  636. Callback(Value)
  637. SliderButton.Text = Text..": "..tostring(Value)
  638. local TargetSize = UDim2.new(XScale,0,1,0)
  639. Tween(SliderFill, {Size = TargetSize})
  640. end)
  641. SliderKill = UserInputService.InputEnded:Connect(function(UserInput)
  642. if UserInput.UserInputType == Enum.UserInputType.MouseButton1 then
  643. Tween(SliderFill, {ImageTransparency = 0.7})
  644. SliderMove:Disconnect()
  645. SliderKill:Disconnect()
  646. end
  647. end)
  648. end)
  649. end
  650.  
  651. function PageLibrary.AddToggle(Text, Default, Callback)
  652. local ThisToggle = Default or false
  653.  
  654. local ToggleContainer = Frame()
  655. ToggleContainer.Name = Text.."TOGGLE"
  656. ToggleContainer.Size = UDim2.new(1,0,0,20)
  657. ToggleContainer.BackgroundTransparency = 1
  658. ToggleContainer.Parent = DisplayPage
  659.  
  660. local ToggleLeftSide, ToggleRightSide, EffectFrame, RightTick = RoundBox(5), RoundBox(5), Frame(), TickIcon()
  661. local FlatLeft, FlatRight = Frame(), Frame()
  662.  
  663. ToggleLeftSide.Size = UDim2.new(1,-22,1,0)
  664. ToggleLeftSide.ImageColor3 = Color3.fromRGB(35,35,35)
  665. ToggleLeftSide.Parent = ToggleContainer
  666.  
  667. ToggleRightSide.Position = UDim2.new(1,-20,0,0)
  668. ToggleRightSide.Size = UDim2.new(0,20,1,0)
  669. ToggleRightSide.ImageColor3 = Color3.fromRGB(45,45,45)
  670. ToggleRightSide.Parent = ToggleContainer
  671.  
  672. FlatLeft.BackgroundColor3 = Color3.fromRGB(35,35,35)
  673. FlatLeft.Size = UDim2.new(0,5,1,0)
  674. FlatLeft.Position = UDim2.new(1,-5,0,0)
  675. FlatLeft.Parent = ToggleLeftSide
  676.  
  677. FlatRight.BackgroundColor3 = Color3.fromRGB(45,45,45)
  678. FlatRight.Size = UDim2.new(0,5,1,0)
  679. FlatRight.Parent = ToggleRightSide
  680.  
  681. EffectFrame.BackgroundColor3 = ThisToggle and Color3.fromRGB(0,255,109) or Color3.fromRGB(255,160,160)
  682. EffectFrame.Position = UDim2.new(1,-22,0.2,0)
  683. EffectFrame.Size = UDim2.new(0,2,0.6,0)
  684. EffectFrame.Parent = ToggleContainer
  685.  
  686. RightTick.ImageTransparency = ThisToggle and 0 or 1
  687. RightTick.Parent = ToggleRightSide
  688.  
  689. local ToggleButton = TextButton(Text, 12)
  690. ToggleButton.Name = "ToggleButton"
  691. ToggleButton.Size = UDim2.new(1,0,1,0)
  692. ToggleButton.Parent = ToggleLeftSide
  693.  
  694. ToggleButton.MouseButton1Down:Connect(function()
  695. ThisToggle = not ThisToggle
  696. Tween(EffectFrame, {BackgroundColor3 = ThisToggle and Color3.fromRGB(0,255,109) or Color3.fromRGB(255,160,160)})
  697. Tween(RightTick, {ImageTransparency = ThisToggle and 0 or 1})
  698. Callback(ThisToggle)
  699. end)
  700. end
  701.  
  702. function PageLibrary.AddTextBox(PlaceholderText, Callback)
  703. local nLabelForeground = RoundBox(5)
  704. nLabelForeground.Name = "LabelForeground"
  705. nLabelForeground.ImageColor3 = Color3.fromRGB(35, 35, 35)
  706. nLabelForeground.Size = UDim2.new(1,0,0,20)
  707. nLabelForeground.Parent = DisplayPage
  708.  
  709. local TextBoxInstance = TextBox("", 12)
  710. TextBoxInstance.PlaceholderText = PlaceholderText
  711. TextBoxInstance.Parent = nLabelForeground
  712. TextBoxInstance.Size = UDim2.new(1, 0, 0, 20)
  713.  
  714. TextBoxInstance:GetPropertyChangedSignal("Text"):Connect(function()
  715. Callback(TextBoxInstance.Text)
  716. end)
  717. end
  718. return PageLibrary
  719. end
  720.  
  721. return TabLibrary
  722. end
  723.  
  724. return UILibrary
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement