draxe55

epic

Aug 9th, 2021 (edited)
43,132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.92 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.  
  190. closed = false
  191. plr = game.Players.LocalPlayer
  192. mouse = plr:GetMouse()
  193. mouse.KeyDown:connect(function(key)
  194. if key == "v" and closed == false then
  195. closed = true
  196. ContainerFrame.Visible = false
  197. elseif key == "v" and closed == true then
  198. closed = false
  199. ContainerFrame.Visible = true
  200. end
  201. end)
  202.  
  203. ContainerShadow = DropShadow()
  204. ContainerShadow.Name = "Shadow"
  205. ContainerShadow.Parent = ContainerFrame
  206.  
  207. Level += 1
  208.  
  209. MainFrame = RoundBox(5)
  210. MainFrame.ClipsDescendants = true
  211. MainFrame.Name = "MainFrame"
  212. MainFrame.Size = UDim2.new(1,-50,1,-30)
  213. MainFrame.Position = UDim2.new(0,25,0,15)
  214. MainFrame.ImageColor3 = Color3.fromRGB(30,30,30)
  215. MainFrame.Parent = ContainerFrame
  216.  
  217. local MenuBar, DisplayFrame, TitleBar
  218.  
  219. MenuBar = ScrollingFrame()
  220. MenuBar.Name = "MenuBar"
  221. MenuBar.BackgroundTransparency = 0.7
  222. MenuBar.BackgroundColor3 = Color3.fromRGB(20,20,20)
  223. MenuBar.Size = UDim2.new(0,100,0,235)
  224. MenuBar.Position = UDim2.new(0,5,0,30)
  225. MenuBar.CanvasSize = UDim2.new(0,0,0,0)
  226. MenuBar.Parent = MainFrame
  227.  
  228. DisplayFrame = RoundBox(5)
  229. DisplayFrame.Name = "Display"
  230. DisplayFrame.ImageColor3 = Color3.fromRGB(20,20,20)
  231. DisplayFrame.Size = UDim2.new(1,-115,0,235)
  232. DisplayFrame.Position = UDim2.new(0,110,0,30)
  233. DisplayFrame.Parent = MainFrame
  234.  
  235. TitleBar = RoundBox(5)
  236. TitleBar.Name = "TitleBar"
  237. TitleBar.ImageColor3 = Color3.fromRGB(40,40,40)
  238. TitleBar.Size = UDim2.new(1,-10,0,20)
  239. TitleBar.Position = UDim2.new(0,5,0,5)
  240. TitleBar.Parent = MainFrame
  241.  
  242. Level += 1
  243.  
  244. local MinimiseButton, TitleButton
  245. local MinimiseToggle = true
  246.  
  247. MinimiseButton = TitleIcon(true)
  248. MinimiseButton.Name = "Minimise"
  249. MinimiseButton.Parent = TitleBar
  250.  
  251. TitleButton = TextButton(GUITitle, 14)
  252. TitleButton.Name = "TitleButton"
  253. TitleButton.Size = UDim2.new(1,-20,1,0)
  254. TitleButton.Parent = TitleBar
  255.  
  256. MinimiseButton.MouseButton1Down:Connect(function()
  257. MinimiseToggle = not MinimiseToggle
  258. if not MinimiseToggle then
  259. Tween(MainFrame, {Size = UDim2.new(1,-50,0,30)})
  260. Tween(MinimiseButton, {Rotation = 0})
  261. Tween(ContainerShadow, {ImageTransparency = 1})
  262. else
  263. Tween(MainFrame, {Size = UDim2.new(1,-50,1,-30)})
  264. Tween(MinimiseButton, {Rotation = 180})
  265. Tween(ContainerShadow, {ImageTransparency = DropShadowTransparency})
  266. end
  267. end)
  268.  
  269. TitleButton.MouseButton1Down:Connect(function()
  270. local LastMX, LastMY = Mouse.X, Mouse.Y
  271. local Move, Kill
  272. Move = Mouse.Move:Connect(function()
  273. local NewMX, NewMY = Mouse.X, Mouse.Y
  274. local DX, DY = NewMX - LastMX, NewMY - LastMY
  275. ContainerFrame.Position += UDim2.new(0,DX,0,DY)
  276. LastMX, LastMY = NewMX, NewMY
  277. end)
  278. Kill = UserInputService.InputEnded:Connect(function(input)
  279. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  280. Move:Disconnect()
  281. Kill:Disconnect()
  282. end
  283. end)
  284. end)
  285.  
  286. Level += 1
  287.  
  288. local MenuListLayout
  289.  
  290. MenuListLayout = Instance.new("UIListLayout")
  291. MenuListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  292. MenuListLayout.Padding = UDim.new(0,5)
  293. MenuListLayout.Parent = MenuBar
  294.  
  295. local TabCount = 0
  296.  
  297. local TabLibrary = {}
  298.  
  299. function TabLibrary.AddPage(PageTitle, SearchBarIncluded)
  300. local SearchBarIncluded = (SearchBarIncluded == nil) and true or SearchBarIncluded
  301.  
  302. local PageContainer = RoundBox(5)
  303. PageContainer.Name = PageTitle
  304. PageContainer.Size = UDim2.new(1,0,0,20)
  305. PageContainer.LayoutOrder = TabCount
  306. PageContainer.ImageColor3 = (TabCount == 0) and Color3.fromRGB(50,50,50) or Color3.fromRGB(40,40,40)
  307. PageContainer.Parent = MenuBar
  308.  
  309. local PageButton = TextButton(PageTitle, 14)
  310. PageButton.Name = PageTitle.."Button"
  311. PageButton.TextTransparency = (TabCount == 0) and 0 or 0.5
  312. PageButton.Parent = PageContainer
  313.  
  314. PageButton.MouseButton1Down:Connect(function()
  315. spawn(function()
  316. for _, Button in next, MenuBar:GetChildren() do
  317. if Button:IsA("GuiObject") then
  318. local IsButton = string.find(Button.Name:lower(), PageContainer.Name:lower())
  319. local Button2 = Button:FindFirstChild(Button.Name.."Button")
  320. Tween(Button, {ImageColor3 = IsButton and Color3.fromRGB(50,50,50) or Color3.fromRGB(40,40,40)})
  321. Tween(Button2, {TextTransparency = IsButton and 0 or 0.5})
  322. end
  323. end
  324. end)
  325. spawn(function()
  326. for _, Display in next, DisplayFrame:GetChildren() do
  327. if Display:IsA("GuiObject") then
  328. Display.Visible = string.find(Display.Name:lower(), PageContainer.Name:lower())
  329. end
  330. end
  331. end)
  332. end)
  333.  
  334. local DisplayPage = ScrollingFrame()
  335. DisplayPage.Visible = (TabCount == 0)
  336. DisplayPage.Name = PageTitle
  337. DisplayPage.Size = UDim2.new(1,0,1,0)
  338. DisplayPage.Parent = DisplayFrame
  339.  
  340. TabCount += 1
  341.  
  342. local DisplayList = Instance.new("UIListLayout")
  343. DisplayList.SortOrder = Enum.SortOrder.LayoutOrder
  344. DisplayList.Padding = UDim.new(0,5)
  345. DisplayList.Parent = DisplayPage
  346.  
  347. DisplayList:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  348. local Y1 = DisplayList.AbsoluteContentSize.Y
  349. local Y2 = DisplayPage.AbsoluteWindowSize.Y
  350. DisplayPage.CanvasSize = UDim2.new(0,0,(Y1/Y2)+0.05,0)
  351. end)
  352.  
  353. local DisplayPadding = Instance.new("UIPadding")
  354. DisplayPadding.PaddingBottom = UDim.new(0,5)
  355. DisplayPadding.PaddingTop = UDim.new(0,5)
  356. DisplayPadding.PaddingLeft = UDim.new(0,5)
  357. DisplayPadding.PaddingRight = UDim.new(0,5)
  358. DisplayPadding.Parent = DisplayPage
  359.  
  360. if SearchBarIncluded then
  361. local SearchBarContainer = RoundBox(5)
  362. SearchBarContainer.Name = "SearchBar"
  363. SearchBarContainer.ImageColor3 = Color3.fromRGB(35,35,35)
  364. SearchBarContainer.Size = UDim2.new(1,0,0,20)
  365. SearchBarContainer.Parent = DisplayPage
  366.  
  367. local SearchBox = TextBox("Search...")
  368. SearchBox.Name = "SearchInput"
  369. SearchBox.Position = UDim2.new(0,20,0,0)
  370. SearchBox.Size = UDim2.new(1,-20,1,0)
  371. SearchBox.TextTransparency = 0.5
  372. SearchBox.TextXAlignment = Enum.TextXAlignment.Left
  373. SearchBox.Parent = SearchBarContainer
  374.  
  375. local SearchIcon = SearchIcon()
  376. SearchIcon.Parent = SearchBarContainer
  377.  
  378. SearchBox:GetPropertyChangedSignal("Text"):Connect(function()
  379. local NewValue = SearchBox.Text
  380.  
  381. for _, Element in next, DisplayPage:GetChildren() do
  382. if Element:IsA("Frame") then
  383. if not string.find(Element.Name:lower(), "label") then
  384. if string.find(Element.Name:lower(), NewValue:lower()) then
  385. Element.Visible = true
  386. else
  387. Element.Visible = false
  388. end
  389. end
  390. end
  391. end
  392. end)
  393. end
  394.  
  395. local PageLibrary = {}
  396.  
  397. function PageLibrary.AddButton(Text, Callback, Parent, Underline)
  398. local ButtonContainer = Frame()
  399. ButtonContainer.Name = Text.."BUTTON"
  400. ButtonContainer.Size = UDim2.new(1,0,0,20)
  401. ButtonContainer.BackgroundTransparency = 1
  402. ButtonContainer.Parent = Parent or DisplayPage
  403.  
  404. local ButtonForeground = RoundBox(5)
  405. ButtonForeground.Name = "ButtonForeground"
  406. ButtonForeground.Size = UDim2.new(1,0,1,0)
  407. ButtonForeground.ImageColor3 = Color3.fromRGB(35,35,35)
  408. ButtonForeground.Parent = ButtonContainer
  409.  
  410. if Underline then
  411. local TextSize = TextService:GetTextSize(Text, 12, Enum.Font.Gotham, Vector2.new(0,0))
  412.  
  413. local BottomEffect = Frame()
  414. BottomEffect.Size = UDim2.new(0,TextSize.X,0,1)
  415. BottomEffect.Position = UDim2.new(0.5,(-TextSize.X/2)-1,1,-1)
  416. BottomEffect.BackgroundColor3 = Color3.fromRGB(255,255,255)
  417. BottomEffect.BackgroundTransparency = 0.5
  418. BottomEffect.Parent = ButtonForeground
  419. end
  420.  
  421. local HiddenButton = TextButton(Text, 12)
  422. HiddenButton.Parent = ButtonForeground
  423.  
  424. HiddenButton.MouseButton1Down:Connect(function()
  425. Callback()
  426. Tween(ButtonForeground, {ImageColor3 = Color3.fromRGB(45,45,45)})
  427. Tween(HiddenButton, {TextTransparency = 0.5})
  428. wait(TweenTime)
  429. Tween(ButtonForeground, {ImageColor3 = Color3.fromRGB(35,35,35)})
  430. Tween(HiddenButton, {TextTransparency = 0})
  431. end)
  432. end
  433.  
  434. function PageLibrary.AddLabel(Text)
  435. local LabelContainer = Frame()
  436. LabelContainer.Name = Text.."LABEL"
  437. LabelContainer.Size = UDim2.new(1,0,0,20)
  438. LabelContainer.BackgroundTransparency = 1
  439. LabelContainer.Parent = DisplayPage
  440.  
  441. local LabelForeground = RoundBox(5)
  442. LabelForeground.Name = "LabelForeground"
  443. LabelForeground.ImageColor3 = Color3.fromRGB(45,45,45)
  444. LabelForeground.Size = UDim2.new(1,0,1,0)
  445. LabelForeground.Parent = LabelContainer
  446.  
  447. local HiddenLabel = TextLabel(Text, 12)
  448. HiddenLabel.Parent = LabelForeground
  449. end
  450.  
  451. function PageLibrary.AddDropdown(Text, ConfigurationArray, Callback)
  452. local DropdownArray = ConfigurationArray or {}
  453.  
  454. local DropdownToggle = false
  455.  
  456. local DropdownContainer = Frame()
  457. DropdownContainer.Size = UDim2.new(1,0,0,20)
  458. DropdownContainer.Name = Text.."DROPDOWN"
  459. DropdownContainer.BackgroundTransparency = 1
  460. DropdownContainer.Parent = DisplayPage
  461.  
  462. local DropdownForeground = RoundBox(5)
  463. DropdownForeground.ClipsDescendants = true
  464. DropdownForeground.ImageColor3 = Color3.fromRGB(35,35,35)
  465. DropdownForeground.Size = UDim2.new(1,0,1,0)
  466. DropdownForeground.Parent = DropdownContainer
  467.  
  468. local DropdownExpander = DropdownIcon(true)
  469. DropdownExpander.Parent = DropdownForeground
  470.  
  471. local DropdownLabel = TextLabel(Text, 12)
  472. DropdownLabel.Size = UDim2.new(1,0,0,20)
  473. DropdownLabel.Parent = DropdownForeground
  474.  
  475. local DropdownFrame = Frame()
  476. DropdownFrame.Position = UDim2.new(0,0,0,20)
  477. DropdownFrame.BackgroundTransparency = 1
  478. DropdownFrame.Size = UDim2.new(1,0,0,#DropdownArray*20)
  479. DropdownFrame.Parent = DropdownForeground
  480.  
  481. local DropdownList = Instance.new("UIListLayout")
  482. DropdownList.Parent = DropdownFrame
  483.  
  484. for OptionIndex, Option in next, DropdownArray do
  485. PageLibrary.AddButton(Option, function()
  486. Callback(Option)
  487. DropdownLabel.Text = Text..": "..Option
  488. end, DropdownFrame, OptionIndex < #DropdownArray)
  489. end
  490.  
  491. DropdownExpander.MouseButton1Down:Connect(function()
  492. DropdownToggle = not DropdownToggle
  493. Tween(DropdownContainer, {Size = DropdownToggle and UDim2.new(1,0,0,20+(#DropdownArray*20)) or UDim2.new(1,0,0,20)})
  494. Tween(DropdownExpander, {Rotation = DropdownToggle and 135 or 0})
  495. end)
  496. end
  497.  
  498. function PageLibrary.AddColourPicker(Text, DefaultColour, Callback)
  499. local DefaultColour = DefaultColour or Color3.fromRGB(255,255,255)
  500.  
  501. local ColourDictionary = {
  502. white = Color3.fromRGB(255,255,255),
  503. black = Color3.fromRGB(0,0,0),
  504. red = Color3.fromRGB(255,0,0),
  505. green = Color3.fromRGB(0,255,0),
  506. blue = Color3.fromRGB(0,0,255)
  507. }
  508.  
  509. if typeof(DefaultColour) == "table" then
  510. DefaultColour = Color3.fromRGB(DefaultColour[1] or 255, DefaultColour[2] or 255, DefaultColour[3] or 255)
  511. elseif typeof(DefaultColour) == "string" then
  512. DefaultColour = ColourDictionary[DefaultColour:lower()] or ColourDictionary["white"]
  513. end
  514.  
  515. local PickerContainer = Frame()
  516. PickerContainer.ClipsDescendants = true
  517. PickerContainer.Size = UDim2.new(1,0,0,20)
  518. PickerContainer.Name = Text.."COLOURPICKER"
  519. PickerContainer.BackgroundTransparency = 1
  520. PickerContainer.Parent = DisplayPage
  521.  
  522. local ColourTracker = Instance.new("Color3Value")
  523. ColourTracker.Value = DefaultColour
  524. ColourTracker.Parent = PickerContainer
  525.  
  526. local PickerLeftSide, PickerRightSide, PickerFrame = RoundBox(5), RoundBox(5), RoundBox(5)
  527.  
  528. PickerLeftSide.Size = UDim2.new(1,-22,1,0)
  529. PickerLeftSide.ImageColor3 = Color3.fromRGB(35,35,35)
  530. PickerLeftSide.Parent = PickerContainer
  531.  
  532. PickerRightSide.Size = UDim2.new(0,20,1,0)
  533. PickerRightSide.Position = UDim2.new(1,-20,0,0)
  534. PickerRightSide.ImageColor3 = DefaultColour
  535. PickerRightSide.Parent = PickerContainer
  536.  
  537. PickerFrame.ImageColor3 = Color3.fromRGB(35,35,35)
  538. PickerFrame.Size = UDim2.new(1,-22,0,60)
  539. PickerFrame.Position = UDim2.new(0,0,0,20)
  540. PickerFrame.Parent = PickerContainer
  541.  
  542. local PickerList = Instance.new("UIListLayout")
  543. PickerList.SortOrder = Enum.SortOrder.LayoutOrder
  544. PickerList.Parent = PickerFrame
  545.  
  546. local RedPicker = PageLibrary.AddSlider("R", {Min = 0, Max = 255, Def = ColourTracker.Value.R * 255}, function(Value)
  547. ColourTracker.Value = Color3.fromRGB(Value, ColourTracker.Value.G * 255, ColourTracker.Value.B * 255)
  548. Callback(ColourTracker.Value)
  549. end, PickerFrame)
  550.  
  551. local BluePicker = PageLibrary.AddSlider("G", {Min = 0, Max = 255, Def = ColourTracker.Value.G * 255}, function(Value)
  552. ColourTracker.Value = Color3.fromRGB(ColourTracker.Value.R * 255, Value, ColourTracker.Value.B * 255)
  553. Callback(ColourTracker.Value)
  554. end, PickerFrame)
  555.  
  556. local GreenPicker = PageLibrary.AddSlider("B", {Min = 0, Max = 255, Def = ColourTracker.Value.B * 255}, function(Value)
  557. ColourTracker.Value = Color3.fromRGB(ColourTracker.Value.R * 255, ColourTracker.Value.G * 255, Value)
  558. Callback(ColourTracker.Value)
  559. end, PickerFrame)
  560.  
  561. local EffectLeft, EffectRight = Frame(), Frame()
  562.  
  563. EffectLeft.BackgroundColor3 = Color3.fromRGB(35,35,35)
  564. EffectLeft.Position = UDim2.new(1,-5,0,0)
  565. EffectLeft.Size = UDim2.new(0,5,1,0)
  566. EffectLeft.Parent = PickerLeftSide
  567.  
  568. EffectRight.BackgroundColor3 = DefaultColour
  569. EffectRight.Size = UDim2.new(0,5,1,0)
  570. EffectRight.Parent = PickerRightSide
  571.  
  572. local PickerLabel = TextLabel(Text, 12)
  573. PickerLabel.Size = UDim2.new(1,0,0,20)
  574. PickerLabel.Parent = PickerLeftSide
  575.  
  576. ColourTracker:GetPropertyChangedSignal("Value"):Connect(function()
  577. local NewValue = ColourTracker.Value
  578. EffectRight.BackgroundColor3 = NewValue
  579. PickerRightSide.ImageColor3 = NewValue
  580. end)
  581.  
  582. local PickerToggle = false
  583.  
  584. local PickerButton = TextButton("")
  585. PickerButton.Parent = PickerRightSide
  586.  
  587. PickerButton.MouseButton1Down:Connect(function()
  588. PickerToggle = not PickerToggle
  589. Tween(PickerContainer, {Size = PickerToggle and UDim2.new(1,0,0,80) or UDim2.new(1,0,0,20)})
  590. end)
  591. end
  592.  
  593. function PageLibrary.AddSlider(Text, ConfigurationDictionary, Callback, Parent)
  594. local Configuration = ConfigurationDictionary
  595. local Minimum = Configuration.Minimum or Configuration.minimum or Configuration.Min or Configuration.min
  596. local Maximum = Configuration.Maximum or Configuration.maximum or Configuration.Max or Configuration.max
  597. local Default = Configuration.Default or Configuration.default or Configuration.Def or Configuration.def
  598.  
  599. if Minimum > Maximum then
  600. local StoreValue = Minimum
  601. Minimum = Maximum
  602. Maximum = StoreValue
  603. end
  604.  
  605. Default = math.clamp(Default, Minimum, Maximum)
  606.  
  607. local DefaultScale = Default/Maximum
  608.  
  609. local SliderContainer = Frame()
  610. SliderContainer.Name = Text.."SLIDER"
  611. SliderContainer.Size = UDim2.new(1,0,0,20)
  612. SliderContainer.BackgroundTransparency = 1
  613. SliderContainer.Parent = Parent or DisplayPage
  614.  
  615. local SliderForeground = RoundBox(5)
  616. SliderForeground.Name = "SliderForeground"
  617. SliderForeground.ImageColor3 = Color3.fromRGB(35,35,35)
  618. SliderForeground.Size = UDim2.new(1,0,1,0)
  619. SliderForeground.Parent = SliderContainer
  620.  
  621. local SliderButton = TextButton(Text..": "..Default)
  622. SliderButton.Size = UDim2.new(1,0,1,0)
  623. SliderButton.ZIndex = 6
  624. SliderButton.Parent = SliderForeground
  625.  
  626. local SliderFill = RoundBox(5)
  627. SliderFill.Size = UDim2.new(DefaultScale,0,1,0)
  628. SliderFill.ImageColor3 = Color3.fromRGB(70,70,70)
  629. SliderFill.ZIndex = 5
  630. SliderFill.ImageTransparency = 0.7
  631. SliderFill.Parent = SliderButton
  632.  
  633. SliderButton.MouseButton1Down:Connect(function()
  634. Tween(SliderFill, {ImageTransparency = 0.5})
  635. local X, Y, XScale, YScale = GetXY(SliderButton)
  636. local Value = math.floor(Minimum + ((Maximum - Minimum) * XScale))
  637. Callback(Value)
  638. SliderButton.Text = Text..": "..tostring(Value)
  639. local TargetSize = UDim2.new(XScale,0,1,0)
  640. Tween(SliderFill, {Size = TargetSize})
  641. local SliderMove, SliderKill
  642. SliderMove = Mouse.Move:Connect(function()
  643. Tween(SliderFill, {ImageTransparency = 0.5})
  644. local X, Y, XScale, YScale = GetXY(SliderButton)
  645. local Value = math.floor(Minimum + ((Maximum - Minimum) * XScale))
  646. Callback(Value)
  647. SliderButton.Text = Text..": "..tostring(Value)
  648. local TargetSize = UDim2.new(XScale,0,1,0)
  649. Tween(SliderFill, {Size = TargetSize})
  650. end)
  651. SliderKill = UserInputService.InputEnded:Connect(function(UserInput)
  652. if UserInput.UserInputType == Enum.UserInputType.MouseButton1 then
  653. Tween(SliderFill, {ImageTransparency = 0.7})
  654. SliderMove:Disconnect()
  655. SliderKill:Disconnect()
  656. end
  657. end)
  658. end)
  659. end
  660.  
  661. function PageLibrary.AddToggle(Text, Default, Callback)
  662. local ThisToggle = Default or false
  663.  
  664. local ToggleContainer = Frame()
  665. ToggleContainer.Name = Text.."TOGGLE"
  666. ToggleContainer.Size = UDim2.new(1,0,0,20)
  667. ToggleContainer.BackgroundTransparency = 1
  668. ToggleContainer.Parent = DisplayPage
  669.  
  670. local ToggleLeftSide, ToggleRightSide, EffectFrame, RightTick = RoundBox(5), RoundBox(5), Frame(), TickIcon()
  671. local FlatLeft, FlatRight = Frame(), Frame()
  672.  
  673. ToggleLeftSide.Size = UDim2.new(1,-22,1,0)
  674. ToggleLeftSide.ImageColor3 = Color3.fromRGB(35,35,35)
  675. ToggleLeftSide.Parent = ToggleContainer
  676.  
  677. ToggleRightSide.Position = UDim2.new(1,-20,0,0)
  678. ToggleRightSide.Size = UDim2.new(0,20,1,0)
  679. ToggleRightSide.ImageColor3 = Color3.fromRGB(45,45,45)
  680. ToggleRightSide.Parent = ToggleContainer
  681.  
  682. FlatLeft.BackgroundColor3 = Color3.fromRGB(35,35,35)
  683. FlatLeft.Size = UDim2.new(0,5,1,0)
  684. FlatLeft.Position = UDim2.new(1,-5,0,0)
  685. FlatLeft.Parent = ToggleLeftSide
  686.  
  687. FlatRight.BackgroundColor3 = Color3.fromRGB(45,45,45)
  688. FlatRight.Size = UDim2.new(0,5,1,0)
  689. FlatRight.Parent = ToggleRightSide
  690.  
  691. EffectFrame.BackgroundColor3 = ThisToggle and Color3.fromRGB(0,255,109) or Color3.fromRGB(255,160,160)
  692. EffectFrame.Position = UDim2.new(1,-22,0.2,0)
  693. EffectFrame.Size = UDim2.new(0,2,0.6,0)
  694. EffectFrame.Parent = ToggleContainer
  695.  
  696. RightTick.ImageTransparency = ThisToggle and 0 or 1
  697. RightTick.Parent = ToggleRightSide
  698.  
  699. local ToggleButton = TextButton(Text, 12)
  700. ToggleButton.Name = "ToggleButton"
  701. ToggleButton.Size = UDim2.new(1,0,1,0)
  702. ToggleButton.Parent = ToggleLeftSide
  703.  
  704. ToggleButton.MouseButton1Down:Connect(function()
  705. ThisToggle = not ThisToggle
  706. Tween(EffectFrame, {BackgroundColor3 = ThisToggle and Color3.fromRGB(0,255,109) or Color3.fromRGB(255,160,160)})
  707. Tween(RightTick, {ImageTransparency = ThisToggle and 0 or 1})
  708. Callback(ThisToggle)
  709. end)
  710. end
  711.  
  712. return PageLibrary
  713. end
  714.  
  715. return TabLibrary
  716. end
  717.  
  718. return UILibrary
Advertisement
Add Comment
Please, Sign In to add comment