Advertisement
CCorrupt

UI LIB test

Jan 26th, 2021
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 73.55 KB | None | 0 0
  1. local TweenService = game:GetService("TweenService")
  2. local RunService = game:GetService("RunService")
  3. local HttpService = game:GetService("HttpService")
  4. local UserInputService = game:GetService("UserInputService")
  5. local ContentProvider = game:GetService("ContentProvider")
  6. local CoreGui = game:GetService("CoreGui")
  7.  
  8. local LocalPlayer = game:GetService("Players").LocalPlayer
  9. local Mouse = LocalPlayer:GetMouse()
  10.  
  11. ContentProvider:PreloadAsync({"rbxassetid://3570695787", "rbxassetid://2708891598", "rbxassetid://4155801252", "rbxassetid://4695575676", "rbxassetid://4155801252"})
  12.  
  13. local Library = {
  14. Theme = {
  15. MainColor = Color3.fromRGB(255, 75, 75),
  16. BackgroundColor = Color3.fromRGB(35, 35, 35),
  17. UIToggleKey = Enum.KeyCode.RightControl,
  18. TextFont = Enum.Font.SourceSansBold,
  19. EasingStyle = Enum.EasingStyle.Quart
  20. },
  21. LibraryColorTable = {},
  22. TabCount = 0,
  23. FirstTab = nil,
  24. CurrentlyBinding = false,
  25. RainbowColorValue = 0,
  26. HueSelectionPosition = 0
  27. }
  28.  
  29. local function DarkenObjectColor(object, amount)
  30. local ColorR = (object.r * 255) - amount
  31. local ColorG = (object.g * 255) - amount
  32. local ColorB = (object.b * 255) - amount
  33.  
  34. return Color3.fromRGB(ColorR, ColorG, ColorB)
  35. end
  36.  
  37. local function SetUIAccent(color)
  38. for i, v in pairs(Library.LibraryColorTable) do
  39. if HasProperty(v, "ImageColor3") then
  40. if v ~= "CheckboxOutline" and v.ImageColor3 ~= Color3.fromRGB(65, 65, 65) then
  41. v.ImageColor3 = color
  42. end
  43. end
  44.  
  45. if HasProperty(v, "TextColor3") then
  46. if v.TextColor3 ~= Color3.fromRGB(255, 255, 255) then
  47. v.TextColor3 = color
  48. end
  49. end
  50. end
  51. end
  52.  
  53. local function RippleEffect(object)
  54. spawn(function()
  55. local Ripple = Instance.new("ImageLabel")
  56.  
  57. Ripple.Name = "Ripple"
  58. Ripple.Parent = object
  59. Ripple.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  60. Ripple.BackgroundTransparency = 1.000
  61. Ripple.ZIndex = 8
  62. Ripple.Image = "rbxassetid://2708891598"
  63. Ripple.ImageTransparency = 0.800
  64. Ripple.ScaleType = Enum.ScaleType.Fit
  65.  
  66. Ripple.Position = UDim2.new((Mouse.X - Ripple.AbsolutePosition.X) / object.AbsoluteSize.X, 0, (Mouse.Y - Ripple.AbsolutePosition.Y) / object.AbsoluteSize.Y, 0)
  67. TweenService:Create(Ripple, TweenInfo.new(1, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {Position = UDim2.new(-5.5, 0, -5.5, 0), Size = UDim2.new(12, 0, 12, 0)}):Play()
  68.  
  69. wait(0.5)
  70. TweenService:Create(Ripple, TweenInfo.new(1, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {ImageTransparency = 1}):Play()
  71.  
  72. wait(1)
  73. Ripple:Destroy()
  74. end)
  75. end
  76.  
  77. local function MakeDraggable(topbarobject, object)
  78. local Dragging = nil
  79. local DragInput = nil
  80. local DragStart = nil
  81. local StartPosition = nil
  82.  
  83. local function Update(input)
  84. local Delta = input.Position - DragStart
  85. object.Position = UDim2.new(StartPosition.X.Scale, StartPosition.X.Offset + Delta.X, StartPosition.Y.Scale, StartPosition.Y.Offset + Delta.Y)
  86. end
  87.  
  88. topbarobject.InputBegan:Connect(function(input)
  89. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  90. Dragging = true
  91. DragStart = input.Position
  92. StartPosition = object.Position
  93.  
  94. input.Changed:Connect(function()
  95. if input.UserInputState == Enum.UserInputState.End then
  96. Dragging = false
  97. end
  98. end)
  99. end
  100. end)
  101.  
  102. topbarobject.InputChanged:Connect(function(input)
  103. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  104. DragInput = input
  105. end
  106. end)
  107.  
  108. UserInputService.InputChanged:Connect(function(input)
  109. if input == DragInput and Dragging then
  110. Update(input)
  111. end
  112. end)
  113. end
  114.  
  115. local UILibrary = Instance.new("ScreenGui")
  116. local Main = Instance.new("ImageLabel")
  117. local Border = Instance.new("ImageLabel")
  118. local Topbar = Instance.new("Frame")
  119. local UITabs = Instance.new("Frame")
  120. local Tabs = Instance.new("Frame")
  121. local TabButtons = Instance.new("ImageLabel")
  122. local TabButtonLayout = Instance.new("UIListLayout")
  123.  
  124. UILibrary.Name = HttpService:GenerateGUID(false)
  125. UILibrary.Parent = CoreGui
  126. UILibrary.DisplayOrder = 1
  127. UILibrary.ZIndexBehavior = Enum.ZIndexBehavior.Global
  128.  
  129. Main.Name = "Main"
  130. Main.Parent = UILibrary
  131. Main.BackgroundColor3 = Library.Theme.BackgroundColor
  132. Main.BackgroundTransparency = 1.000
  133. Main.Position = UDim2.new(0.590086579, 0, 0.563882053, 0)
  134. Main.Size = UDim2.new(0, 450, 0, 0)
  135. Main.ZIndex = 2
  136. Main.Image = "rbxassetid://3570695787"
  137. Main.ImageColor3 = Library.Theme.BackgroundColor
  138. Main.ScaleType = Enum.ScaleType.Slice
  139. Main.SliceCenter = Rect.new(100, 100, 100, 100)
  140. Main.SliceScale = 0.050
  141.  
  142. Border.Name = "Border"
  143. Border.Parent = Main
  144. Border.BackgroundColor3 = Library.Theme.MainColor
  145. Border.BackgroundTransparency = 1.000
  146. Border.Position = UDim2.new(0, -1, 0, -1)
  147. Border.Size = UDim2.new(1, 2, 1, 2)
  148. Border.Image = "rbxassetid://3570695787"
  149. Border.ImageColor3 = Library.Theme.MainColor
  150. Border.ScaleType = Enum.ScaleType.Slice
  151. Border.SliceCenter = Rect.new(100, 100, 100, 100)
  152. Border.SliceScale = 0.050
  153. Border.ImageTransparency = 1
  154.  
  155. Topbar.Name = "Topbar"
  156. Topbar.Parent = Main
  157. Topbar.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  158. Topbar.BackgroundTransparency = 1.000
  159. Topbar.Size = UDim2.new(0, 450, 0, 15)
  160. Topbar.ZIndex = 2
  161.  
  162. UITabs.Name = "UITabs"
  163. UITabs.Parent = Main
  164. UITabs.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  165. UITabs.BackgroundTransparency = 1.000
  166. UITabs.ClipsDescendants = true
  167. UITabs.Size = UDim2.new(1, 0, 1, 0)
  168.  
  169. Tabs.Name = "Tabs"
  170. Tabs.Parent = UITabs
  171. Tabs.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  172. Tabs.BackgroundTransparency = 1.000
  173. Tabs.Position = UDim2.new(0, 13, 0, 41)
  174. Tabs.Size = UDim2.new(0, 421, 0, 209)
  175. Tabs.ZIndex = 2
  176.  
  177. TabButtons.Name = "TabButtons"
  178. TabButtons.Parent = UITabs
  179. TabButtons.BackgroundColor3 = Library.Theme.MainColor
  180. TabButtons.BackgroundTransparency = 1.000
  181. TabButtons.Position = UDim2.new(0, 14, 0, 16)
  182. TabButtons.Size = UDim2.new(0, 419, 0, 25)
  183. TabButtons.ZIndex = 2
  184. TabButtons.Image = "rbxassetid://3570695787"
  185. TabButtons.ImageColor3 = Library.Theme.MainColor
  186. TabButtons.ScaleType = Enum.ScaleType.Slice
  187. TabButtons.SliceCenter = Rect.new(100, 100, 100, 100)
  188. TabButtons.SliceScale = 0.050
  189. TabButtons.ClipsDescendants = true
  190.  
  191. TabButtonLayout.Name = "TabButtonLayout"
  192. TabButtonLayout.Parent = TabButtons
  193. TabButtonLayout.FillDirection = Enum.FillDirection.Horizontal
  194. TabButtonLayout.SortOrder = Enum.SortOrder.LayoutOrder
  195.  
  196. TweenService:Create(Main, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 450, 0, 250)}):Play()
  197. TweenService:Create(Border, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {ImageTransparency = 0}):Play()
  198.  
  199. table.insert(Library.LibraryColorTable, Border)
  200. table.insert(Library.LibraryColorTable, TabButtons)
  201. MakeDraggable(Topbar, Main)
  202.  
  203. local function CloseAllTabs()
  204. for i, v in pairs(Tabs:GetChildren()) do
  205. if v:IsA("Frame") then
  206. v.Visible = false
  207. end
  208. end
  209. end
  210.  
  211. local function ResetAllTabButtons()
  212. for i, v in pairs(TabButtons:GetChildren()) do
  213. if v:IsA("ImageButton") then
  214. TweenService:Create(v, TweenInfo.new(0.3, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {ImageColor3 = Library.Theme.MainColor}):Play()
  215. end
  216. end
  217. end
  218.  
  219. local function KeepFirstTabOpen()
  220. for i, v in pairs(Tabs:GetChildren()) do
  221. if v:IsA("Frame") then
  222. if v.Name == (Library.FirstTab .. "Tab") then
  223. v.Visible = true
  224. else
  225. v.Visible = false
  226. end
  227. end
  228. end
  229.  
  230. for i, v in pairs(TabButtons:GetChildren()) do
  231. if v:IsA("ImageButton") then
  232. if v.Name:find(Library.FirstTab .. "TabButton") then
  233. TweenService:Create(v, TweenInfo.new(0.3, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {ImageColor3 = DarkenObjectColor(Library.Theme.MainColor, 15)}):Play()
  234. else
  235. TweenService:Create(v, TweenInfo.new(0.3, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {ImageColor3 = Library.Theme.MainColor}):Play()
  236. end
  237. end
  238. end
  239. end
  240.  
  241. local function ToggleUI()
  242. Library.UIOpen = not Library.UIOpen
  243.  
  244. if Library.UIOpen then
  245. TweenService:Create(Main, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 450, 0, 0)}):Play()
  246. TweenService:Create(Border, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {ImageTransparency = 1}):Play()
  247. elseif not Library.UIOpen then
  248. TweenService:Create(Main, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 450, 0, 250)}):Play()
  249. TweenService:Create(Border, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {ImageTransparency = 0}):Play()
  250. end
  251. end
  252.  
  253. coroutine.wrap(function()
  254. while wait() do
  255. Library.RainbowColorValue = Library.RainbowColorValue + 1/255
  256. Library.HueSelectionPosition = Library.HueSelectionPosition + 1
  257.  
  258. if Library.RainbowColorValue >= 1 then
  259. Library.RainbowColorValue = 0
  260. end
  261.  
  262. if Library.HueSelectionPosition == 105 then
  263. Library.HueSelectionPosition = 0
  264. end
  265. end
  266. end)()
  267.  
  268.  
  269. function Library:CreateTab(name)
  270. local NameTab = Instance.new("Frame")
  271. local NameTabButton = Instance.new("ImageButton")
  272. local Title = Instance.new("TextLabel")
  273. local SectionLayout = Instance.new("UIListLayout")
  274. local SectionPadding = Instance.new("UIPadding")
  275.  
  276. local TabElements = {}
  277. Library.TabCount = Library.TabCount + 1
  278.  
  279. if Library.TabCount == 1 then
  280. Library.FirstTab = name
  281. end
  282.  
  283. NameTab.Name = (name .. "Tab")
  284. NameTab.Parent = Tabs
  285. NameTab.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  286. NameTab.BackgroundTransparency = 1.000
  287. NameTab.Size = UDim2.new(1, 0, 1, 0)
  288. NameTab.ZIndex = 2
  289.  
  290. NameTabButton.Name = (name .. "TabButton")
  291. NameTabButton.Parent = TabButtons
  292. NameTabButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  293. NameTabButton.BackgroundTransparency = 1.000
  294. NameTabButton.Size = UDim2.new(0, 84, 0, 25)
  295. NameTabButton.ZIndex = 2
  296. NameTabButton.Image = "rbxassetid://3570695787"
  297. NameTabButton.ImageColor3 = Library.Theme.MainColor
  298. NameTabButton.ScaleType = Enum.ScaleType.Slice
  299. NameTabButton.SliceCenter = Rect.new(100, 100, 100, 100)
  300. NameTabButton.SliceScale = 0.050
  301.  
  302. Title.Name = "Title"
  303. Title.Parent = NameTabButton
  304. Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  305. Title.BackgroundTransparency = 1.000
  306. Title.Size = UDim2.new(1, 0, 1, 0)
  307. Title.ZIndex = 2
  308. Title.Font = Library.Theme.TextFont
  309. Title.Text = name
  310. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  311. Title.TextSize = 15.000
  312.  
  313. SectionLayout.Name = "SectionLayout"
  314. SectionLayout.Parent = NameTab
  315. SectionLayout.FillDirection = Enum.FillDirection.Horizontal
  316. SectionLayout.SortOrder = Enum.SortOrder.LayoutOrder
  317. SectionLayout.Padding = UDim.new(0, 25)
  318.  
  319. SectionPadding.Name = "SectionPadding"
  320. SectionPadding.Parent = NameTab
  321. SectionPadding.PaddingTop = UDim.new(0, 12)
  322.  
  323. NameTab.Visible = true
  324.  
  325. table.insert(Library.LibraryColorTable, NameTabButton)
  326. CloseAllTabs()
  327. ResetAllTabButtons()
  328. TweenService:Create(NameTabButton, TweenInfo.new(0.3, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {ImageColor3 = DarkenObjectColor(Library.Theme.MainColor, 15)}):Play()
  329.  
  330. KeepFirstTabOpen()
  331.  
  332. NameTabButton.MouseButton1Down:Connect(function()
  333. CloseAllTabs()
  334. ResetAllTabButtons()
  335.  
  336. NameTab.Visible = true
  337. TweenService:Create(NameTabButton, TweenInfo.new(0.3, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {ImageColor3 = DarkenObjectColor(Library.Theme.MainColor, 15)}):Play()
  338. end)
  339.  
  340. function TabElements:CreateSection(name)
  341. local NameSection = Instance.new("ImageLabel")
  342. local SectionBorder = Instance.new("ImageLabel")
  343. local SectionTitle = Instance.new("TextLabel")
  344. local SectionContent = Instance.new("ScrollingFrame")
  345. local SectionContentLayout = Instance.new("UIListLayout")
  346.  
  347. local SectionElements = {}
  348.  
  349. NameSection.Name = (name .. "Section")
  350. NameSection.Parent = NameTab
  351. NameSection.BackgroundColor3 = Library.Theme.MainColor
  352. NameSection.BackgroundTransparency = 1.000
  353. NameSection.Position = UDim2.new(0, 0, 0.0574162677, 0)
  354. NameSection.Size = UDim2.new(0, 197, 0, 181)
  355. NameSection.ZIndex = 4
  356. NameSection.Image = "rbxassetid://3570695787"
  357. NameSection.ImageColor3 = Library.Theme.BackgroundColor
  358. NameSection.ScaleType = Enum.ScaleType.Slice
  359. NameSection.SliceCenter = Rect.new(100, 100, 100, 100)
  360. NameSection.SliceScale = 0.050
  361.  
  362. SectionBorder.Name = "SectionBorder"
  363. SectionBorder.Parent = NameSection
  364. SectionBorder.BackgroundColor3 = Library.Theme.MainColor
  365. SectionBorder.BackgroundTransparency = 1.000
  366. SectionBorder.Position = UDim2.new(0, -1, 0, -1)
  367. SectionBorder.Size = UDim2.new(1, 2, 1, 2)
  368. SectionBorder.ZIndex = 3
  369. SectionBorder.Image = "rbxassetid://3570695787"
  370. SectionBorder.ImageColor3 = Library.Theme.MainColor
  371. SectionBorder.ScaleType = Enum.ScaleType.Slice
  372. SectionBorder.SliceCenter = Rect.new(100, 100, 100, 100)
  373. SectionBorder.SliceScale = 0.050
  374.  
  375. SectionTitle.Name = "SectionTitle"
  376. SectionTitle.Parent = NameSection
  377. SectionTitle.BackgroundColor3 = Library.Theme.BackgroundColor
  378. SectionTitle.BorderSizePixel = 0
  379. SectionTitle.Text = name
  380. SectionTitle.Position = UDim2.new(0.5, (-SectionTitle.TextBounds.X - 5) / 2, 0, -12)
  381. SectionTitle.Size = UDim2.new(0, SectionTitle.TextBounds.X + 5, 0, 22)
  382. SectionTitle.ZIndex = 4
  383. SectionTitle.Font = Library.Theme.TextFont
  384. SectionTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
  385. SectionTitle.TextSize = 14.000
  386.  
  387. SectionContent.Name = "SectionContent"
  388. SectionContent.Parent = NameSection
  389. SectionContent.Active = true
  390. SectionContent.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  391. SectionContent.BackgroundTransparency = 1.000
  392. SectionContent.BorderColor3 = Color3.fromRGB(27, 42, 53)
  393. SectionContent.BorderSizePixel = 0
  394. SectionContent.Size = UDim2.new(1, 0, 1, 0)
  395. SectionContent.ZIndex = 4
  396. SectionContent.BottomImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
  397. SectionContent.ScrollBarImageColor3 = Color3.fromRGB(85, 85, 85)
  398. SectionContent.ScrollBarThickness = 4
  399. SectionContent.TopImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
  400.  
  401. SectionContentLayout.Name = "SectionContentLayout"
  402. SectionContentLayout.Parent = SectionContent
  403. SectionContentLayout.SortOrder = Enum.SortOrder.LayoutOrder
  404.  
  405. table.insert(Library.LibraryColorTable, SectionBorder)
  406.  
  407. SectionContentLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  408. SectionContent.CanvasSize = UDim2.new(0, 0, 0, SectionContentLayout.AbsoluteContentSize.Y + 15)
  409. end)
  410.  
  411. function SectionElements:CreateLabel(name, text)
  412. local NameLabel = Instance.new("TextLabel")
  413.  
  414. NameLabel.Name = (name .. "Label")
  415. NameLabel.Parent = SectionContent
  416. NameLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  417. NameLabel.BackgroundTransparency = 1.000
  418. NameLabel.Text = text
  419. NameLabel.Size = UDim2.new(0, 197, 0, NameLabel.TextBounds.Y)
  420. NameLabel.ZIndex = 5
  421. NameLabel.Font = Library.Theme.TextFont
  422. NameLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  423. NameLabel.TextSize = 15.000
  424.  
  425. local function ChangeText(newtext)
  426. NameLabel.Text = newtext
  427. end
  428.  
  429. NameLabel:GetPropertyChangedSignal("TextBounds"):Connect(function()
  430. if NameLabel.Text ~= "" then
  431. TweenService:Create(NameLabel, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 197, 0, NameLabel.TextBounds.Y)}):Play()
  432. else
  433. TweenService:Create(NameLabel, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 197, 0, 0)}):Play()
  434. end
  435. end)
  436.  
  437. return {
  438. ChangeText = ChangeText
  439. }
  440. end
  441.  
  442. function SectionElements:CreateButton(name, callback)
  443. local NameButton = Instance.new("Frame")
  444. local Button = Instance.new("TextButton")
  445. local ButtonRounded = Instance.new("ImageLabel")
  446.  
  447. NameButton.Name = (name .. "Button")
  448. NameButton.Parent = SectionContent
  449. NameButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  450. NameButton.BackgroundTransparency = 1.000
  451. NameButton.Size = UDim2.new(0, 197, 0, 35)
  452. NameButton.ZIndex = 5
  453.  
  454. Button.Name = "Button"
  455. Button.Parent = NameButton
  456. Button.BackgroundColor3 = Library.Theme.MainColor
  457. Button.BackgroundTransparency = 1.000
  458. Button.BorderSizePixel = 0
  459. Button.Position = UDim2.new(0.454314709, -76, 0.528571427, -12)
  460. Button.Size = UDim2.new(0, 168, 0, 25)
  461. Button.ZIndex = 6
  462. Button.Font = Library.Theme.TextFont
  463. Button.Text = name
  464. Button.TextColor3 = Color3.fromRGB(255, 255, 255)
  465. Button.TextSize = 15.000
  466. Button.ClipsDescendants = true
  467.  
  468. ButtonRounded.Name = "ButtonRounded"
  469. ButtonRounded.Parent = Button
  470. ButtonRounded.Active = true
  471. ButtonRounded.AnchorPoint = Vector2.new(0.5, 0.5)
  472. ButtonRounded.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  473. ButtonRounded.BackgroundTransparency = 1.000
  474. ButtonRounded.Position = UDim2.new(0.5, 0, 0.5, 0)
  475. ButtonRounded.Selectable = true
  476. ButtonRounded.Size = UDim2.new(1, 0, 1, 0)
  477. ButtonRounded.ZIndex = 5
  478. ButtonRounded.Image = "rbxassetid://3570695787"
  479. ButtonRounded.ImageColor3 = Library.Theme.MainColor
  480. ButtonRounded.ScaleType = Enum.ScaleType.Slice
  481. ButtonRounded.SliceCenter = Rect.new(100, 100, 100, 100)
  482. ButtonRounded.SliceScale = 0.050
  483.  
  484. Button.MouseButton1Down:Connect(function()
  485. TweenService:Create(ButtonRounded, TweenInfo.new(0.25, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {ImageColor3 = DarkenObjectColor(Library.Theme.MainColor, 20)}):Play()
  486.  
  487. RippleEffect(Button)
  488. callback(Button)
  489. end)
  490.  
  491. Button.MouseButton1Up:Connect(function()
  492. TweenService:Create(ButtonRounded, TweenInfo.new(0.25, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {ImageColor3 = Library.Theme.MainColor}):Play()
  493. end)
  494.  
  495. Button.InputEnded:Connect(function(input)
  496. if input.UserInputType == Enum.UserInputType.MouseMovement then
  497. TweenService:Create(ButtonRounded, TweenInfo.new(0.25, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {ImageColor3 = Library.Theme.MainColor}):Play()
  498. end
  499. end)
  500.  
  501. table.insert(Library.LibraryColorTable, ButtonRounded)
  502. end
  503.  
  504. function SectionElements:CreateToggle(name, callback)
  505. local NameToggle = Instance.new("Frame")
  506. local Title = Instance.new("TextLabel")
  507. local Toggle = Instance.new("TextButton")
  508. local CheckboxOutline = Instance.new("ImageLabel")
  509. local CheckboxTicked = Instance.new("ImageLabel")
  510. local TickCover = Instance.new("Frame")
  511.  
  512. local Toggled = false
  513.  
  514. NameToggle.Name = (name .. "Toggle")
  515. NameToggle.Parent = SectionContent
  516. NameToggle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  517. NameToggle.BackgroundTransparency = 1.000
  518. NameToggle.Size = UDim2.new(0, 197, 0, 35)
  519. NameToggle.ZIndex = 5
  520.  
  521. Title.Name = "Title"
  522. Title.Parent = NameToggle
  523. Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  524. Title.BackgroundTransparency = 1.000
  525. Title.Position = UDim2.new(0, 13, 0, 0)
  526. Title.Size = UDim2.new(0, 149, 0, 35)
  527. Title.ZIndex = 5
  528. Title.Font = Library.Theme.TextFont
  529. Title.Text = name
  530. Title.TextColor3 = Color3.fromRGB(185, 185, 185)
  531. Title.TextSize = 15.000
  532. Title.TextXAlignment = Enum.TextXAlignment.Left
  533.  
  534. Toggle.Name = "Toggle"
  535. Toggle.Parent = NameToggle
  536. Toggle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  537. Toggle.BackgroundTransparency = 1.000
  538. Toggle.Position = UDim2.new(0, 161, 0, 7)
  539. Toggle.Size = UDim2.new(0, 20, 0, 20)
  540. Toggle.ZIndex = 5
  541. Toggle.AutoButtonColor = false
  542. Toggle.Font = Library.Theme.TextFont
  543. Toggle.Text = ""
  544. Toggle.TextColor3 = Color3.fromRGB(255, 255, 255)
  545. Toggle.TextSize = 14.000
  546.  
  547. CheckboxOutline.Name = "CheckboxOutline"
  548. CheckboxOutline.Parent = Toggle
  549. CheckboxOutline.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  550. CheckboxOutline.BackgroundTransparency = 1.000
  551. CheckboxOutline.Position = UDim2.new(0.5, -12, 0.5, -12)
  552. CheckboxOutline.Size = UDim2.new(0, 24, 0, 24)
  553. CheckboxOutline.ZIndex = 5
  554. CheckboxOutline.Image = "http://www.roblox.com/asset/?id=5416796047"
  555. CheckboxOutline.ImageColor3 = Color3.fromRGB(65, 65, 65)
  556.  
  557. CheckboxTicked.Name = "CheckboxTicked"
  558. CheckboxTicked.Parent = Toggle
  559. CheckboxTicked.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  560. CheckboxTicked.BackgroundTransparency = 1.000
  561. CheckboxTicked.Position = UDim2.new(0.5, -12, 0.5, -12)
  562. CheckboxTicked.Size = UDim2.new(0, 24, 0, 24)
  563. CheckboxTicked.ZIndex = 5
  564. CheckboxTicked.Image = "http://www.roblox.com/asset/?id=5416796675"
  565. CheckboxTicked.ImageColor3 = Color3.fromRGB(65, 65, 65)
  566.  
  567. TickCover.Name = "TickCover"
  568. TickCover.Parent = Toggle
  569. TickCover.BackgroundColor3 = Library.Theme.BackgroundColor
  570. TickCover.BorderSizePixel = 0
  571. TickCover.Position = UDim2.new(0.5, -7, 0.5, -7)
  572. TickCover.Size = UDim2.new(0, 14, 0, 14)
  573. TickCover.ZIndex = 5
  574.  
  575. local function SetState(state)
  576. if state then
  577. TweenService:Create(Title, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {TextColor3 = Color3.fromRGB(255, 255, 255)}):Play()
  578. TweenService:Create(TickCover, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {Position = UDim2.new(0.5, 0, 0.5, 0), Size = UDim2.new(0, 0, 0, 0)}):Play()
  579. TweenService:Create(CheckboxOutline, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {ImageColor3 = Library.Theme.MainColor}):Play()
  580. TweenService:Create(CheckboxTicked, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {ImageColor3 = Library.Theme.MainColor}):Play()
  581. elseif not state then
  582. TweenService:Create(Title, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {TextColor3 = Color3.fromRGB(185, 185, 185)}):Play()
  583. TweenService:Create(TickCover, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {Position = UDim2.new(0.5, -7, 0.5, -7), Size = UDim2.new(0, 14, 0, 14)}):Play()
  584. TweenService:Create(CheckboxOutline, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {ImageColor3 = Color3.fromRGB(65, 65, 65)}):Play()
  585. TweenService:Create(CheckboxTicked, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {ImageColor3 = Color3.fromRGB(65, 65, 65)}):Play()
  586. end
  587.  
  588. callback(Toggled)
  589. end
  590.  
  591. Toggle.MouseButton1Down:Connect(function()
  592. Toggled = not Toggled
  593. SetState(Toggled)
  594. end)
  595.  
  596. table.insert(Library.LibraryColorTable, CheckboxOutline)
  597. table.insert(Library.LibraryColorTable, CheckboxTicked)
  598.  
  599. return {
  600. SetState = SetState
  601. }
  602. end
  603.  
  604. function SectionElements:CreateSlider(name, minimumvalue, maximumvalue, presetvalue, precisevalue, callback)
  605. local NameSlider = Instance.new("Frame")
  606. local Title = Instance.new("TextLabel")
  607. local SliderBackground = Instance.new("ImageLabel")
  608. local SliderIndicator = Instance.new("ImageLabel")
  609. local CircleSelector = Instance.new("ImageLabel")
  610. local SliderValue = Instance.new("ImageLabel")
  611. local Value = Instance.new("TextBox")
  612.  
  613. local SliderDragging = false
  614. local StartingValue = presetvalue
  615.  
  616. if StartingValue == nil then
  617. StartingValue = presetvalue
  618. end
  619.  
  620. NameSlider.Name = (name .. "Slider")
  621. NameSlider.Parent = SectionContent
  622. NameSlider.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  623. NameSlider.BackgroundTransparency = 1.000
  624. NameSlider.Position = UDim2.new(0, 0, 0.497237563, 0)
  625. NameSlider.Size = UDim2.new(0, 197, 0, 50)
  626. NameSlider.ZIndex = 5
  627.  
  628. Title.Name = "Title"
  629. Title.Parent = NameSlider
  630. Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  631. Title.BackgroundTransparency = 1.000
  632. Title.BorderColor3 = Color3.fromRGB(27, 42, 53)
  633. Title.Position = UDim2.new(0, 12, 0, 0)
  634. Title.Size = UDim2.new(0, 121, 0, 35)
  635. Title.ZIndex = 5
  636. Title.Font = Library.Theme.TextFont
  637. Title.Text = name
  638. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  639. Title.TextSize = 15.000
  640. Title.TextXAlignment = Enum.TextXAlignment.Left
  641.  
  642. SliderBackground.Name = "SliderBackground"
  643. SliderBackground.Parent = NameSlider
  644. SliderBackground.BackgroundColor3 = Color3.fromRGB(55, 55, 55)
  645. SliderBackground.BackgroundTransparency = 1.000
  646. SliderBackground.Position = UDim2.new(0.0600000359, 0, 0.699999988, 0)
  647. SliderBackground.Size = UDim2.new(0, 169, 0, 4)
  648. SliderBackground.ZIndex = 5
  649. SliderBackground.Image = "rbxassetid://3570695787"
  650. SliderBackground.ImageColor3 = Color3.fromRGB(55, 55, 55)
  651. SliderBackground.ScaleType = Enum.ScaleType.Slice
  652. SliderBackground.SliceCenter = Rect.new(100, 100, 100, 100)
  653. SliderBackground.SliceScale = 0.150
  654.  
  655. SliderIndicator.Name = "SliderIndicator"
  656. SliderIndicator.Parent = SliderBackground
  657. SliderIndicator.BackgroundColor3 = Color3.fromRGB(55, 55, 55)
  658. SliderIndicator.BackgroundTransparency = 1.000
  659. SliderIndicator.Size = UDim2.new(((StartingValue or minimumvalue) - minimumvalue) / (maximumvalue - minimumvalue), 0, 1, 0)
  660. SliderIndicator.ZIndex = 5
  661. SliderIndicator.Image = "rbxassetid://3570695787"
  662. SliderIndicator.ImageColor3 = Library.Theme.MainColor
  663. SliderIndicator.ScaleType = Enum.ScaleType.Slice
  664. SliderIndicator.SliceCenter = Rect.new(100, 100, 100, 100)
  665. SliderIndicator.SliceScale = 0.150
  666.  
  667. CircleSelector.Name = "CircleSelector"
  668. CircleSelector.Parent = SliderIndicator
  669. CircleSelector.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  670. CircleSelector.BackgroundTransparency = 1.000
  671. CircleSelector.Position = UDim2.new(0.986565471, -7, 0.75, -7)
  672. CircleSelector.Size = UDim2.new(0, 12, 0, 12)
  673. CircleSelector.ZIndex = 5
  674. CircleSelector.Image = "rbxassetid://3570695787"
  675.  
  676. SliderValue.Name = "SliderValue"
  677. SliderValue.Parent = NameSlider
  678. SliderValue.BackgroundColor3 = Color3.fromRGB(65, 65, 65)
  679. SliderValue.BackgroundTransparency = 1.000
  680. SliderValue.Position = UDim2.new(0.764771521, -12, 0.400000006, -12)
  681. SliderValue.Size = UDim2.new(0, 42, 0, 19)
  682. SliderValue.ZIndex = 5
  683. SliderValue.Image = "rbxassetid://3570695787"
  684. SliderValue.ImageColor3 = Color3.fromRGB(65, 65, 65)
  685. SliderValue.ScaleType = Enum.ScaleType.Slice
  686. SliderValue.SliceCenter = Rect.new(100, 100, 100, 100)
  687. SliderValue.SliceScale = 0.030
  688.  
  689. Value.Name = "Value"
  690. Value.Parent = SliderValue
  691. Value.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  692. Value.BackgroundTransparency = 1.000
  693. Value.Size = UDim2.new(1, 0, 1, 0)
  694. Value.ZIndex = 5
  695. Value.Font = Library.Theme.TextFont
  696. Value.Text = tostring(StartingValue or precisevalue and tonumber(string.format("%.2f", StartingValue)))
  697. Value.TextColor3 = Color3.fromRGB(255, 255, 255)
  698. Value.TextSize = 14.000
  699.  
  700. local function Sliding(input)
  701. local SliderPosition = UDim2.new(math.clamp((input.Position.X - SliderBackground.AbsolutePosition.X) / SliderBackground.AbsoluteSize.X, 0, 1), 0, 1, 0)
  702. TweenService:Create(SliderIndicator, TweenInfo.new(0.02, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {Size = SliderPosition}):Play()
  703.  
  704. local NonSliderPreciseValue = math.floor(((SliderPosition.X.Scale * maximumvalue) / maximumvalue) * (maximumvalue - minimumvalue) + minimumvalue)
  705. local SliderPreciseValue = ((SliderPosition.X.Scale * maximumvalue) / maximumvalue) * (maximumvalue - minimumvalue) + minimumvalue
  706.  
  707. local SlidingValue = (precisevalue and SliderPreciseValue or NonSliderPreciseValue)
  708. SlidingValue = tonumber(string.format("%.2f", SlidingValue))
  709.  
  710. Value.Text = tostring(SlidingValue)
  711. callback(SlidingValue)
  712. end
  713.  
  714. Value.FocusLost:Connect(function()
  715. if not tonumber(Value.Text) then
  716. Value.Text = tostring(StartingValue or precisevalue and tonumber(string.format("%.2f", StartingValue)))
  717. elseif Value.Text == "" or tonumber(Value.Text) <= minimumvalue then
  718. Value.Text = minimumvalue
  719. elseif Value.Text == "" or tonumber(Value.Text) >= maximumvalue then
  720. Value.Text = maximumvalue
  721. end
  722.  
  723. TweenService:Create(SliderIndicator, TweenInfo.new(0.02, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(((tonumber(Value.Text) or minimumvalue) - minimumvalue) / (maximumvalue - minimumvalue), 0, 1, 0)}):Play()
  724. callback(tonumber(Value.Text))
  725. end)
  726.  
  727. CircleSelector.InputBegan:Connect(function(input)
  728. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  729. SliderDragging = true
  730. end
  731. end)
  732.  
  733. CircleSelector.InputEnded:Connect(function(input)
  734. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  735. SliderDragging = false
  736. end
  737. end)
  738.  
  739. CircleSelector.InputBegan:Connect(function(input)
  740. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  741. Sliding(input)
  742. end
  743. end)
  744.  
  745. UserInputService.InputChanged:Connect(function(input)
  746. if SliderDragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  747. Sliding(input)
  748. end
  749. end)
  750.  
  751. local function SetSliderValue(value)
  752. Value.Text = value
  753. TweenService:Create(SliderIndicator, TweenInfo.new(0.02, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(((tonumber(Value.Text) or minimumvalue) - minimumvalue) / (maximumvalue - minimumvalue), 0, 1, 0)}):Play()
  754. callback(tonumber(Value.Text))
  755. end
  756.  
  757. callback(StartingValue)
  758. table.insert(Library.LibraryColorTable, SliderIndicator)
  759.  
  760. return {
  761. SetSliderValue = SetSliderValue
  762. }
  763. end
  764.  
  765. function SectionElements:CreateColorPicker(name, presetcolor, callback)
  766. local NameColorPicker = Instance.new("Frame")
  767. local Title = Instance.new("TextLabel")
  768. local ColorPickerToggle = Instance.new("ImageButton")
  769. local ColorPicker = Instance.new("ImageLabel")
  770. local Color = Instance.new("ImageLabel")
  771. local ColorRound = Instance.new("ImageLabel")
  772. local ColorSelection = Instance.new("ImageLabel")
  773. local RValue = Instance.new("ImageLabel")
  774. local ValueR = Instance.new("TextLabel")
  775. local GValue = Instance.new("ImageLabel")
  776. local ValueG = Instance.new("TextLabel")
  777. local BValue = Instance.new("ImageLabel")
  778. local ValueB = Instance.new("TextLabel")
  779. local RainbowToggle = Instance.new("Frame")
  780. local RainbowToggleTitle = Instance.new("TextLabel")
  781. local Toggle = Instance.new("TextButton")
  782. local CheckboxOutline = Instance.new("ImageLabel")
  783. local CheckboxTicked = Instance.new("ImageLabel")
  784. local TickCover = Instance.new("Frame")
  785. local Hue = Instance.new("ImageLabel")
  786. local UIGradient = Instance.new("UIGradient")
  787. local HueSelection = Instance.new("ImageLabel")
  788.  
  789. local ColorPickerToggled = false
  790. local OldToggleColor = Color3.fromRGB(0, 0, 0)
  791. local OldColor = Color3.fromRGB(0, 0, 0)
  792. local OldColorSelectionPosition = nil
  793. local OldHueSelectionPosition = nil
  794. local ColorH, ColorS, ColorV = 1, 1, 1
  795. local RainbowColorPicker = false
  796. local ColorPickerInput = nil
  797. local ColorInput = nil
  798. local HueInput = nil
  799.  
  800. NameColorPicker.Name = (name .. "ColorPicker")
  801. NameColorPicker.Parent = SectionContent
  802. NameColorPicker.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  803. NameColorPicker.BackgroundTransparency = 1.000
  804. NameColorPicker.Position = UDim2.new(0, 0, 0.138121545, 0)
  805. NameColorPicker.Size = UDim2.new(0, 197, 0, 32)
  806. NameColorPicker.ClipsDescendants = true
  807.  
  808. Title.Name = "Title"
  809. Title.Parent = NameColorPicker
  810. Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  811. Title.BackgroundTransparency = 1.000
  812. Title.Position = UDim2.new(0, 13, 0, 0)
  813. Title.Size = UDim2.new(0, 151, 0, 30)
  814. Title.ZIndex = 5
  815. Title.Font = Library.Theme.TextFont
  816. Title.Text = name
  817. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  818. Title.TextSize = 15.000
  819. Title.TextXAlignment = Enum.TextXAlignment.Left
  820.  
  821. ColorPickerToggle.Name = "ColorPickerToggle"
  822. ColorPickerToggle.Parent = NameColorPicker
  823. ColorPickerToggle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  824. ColorPickerToggle.BackgroundTransparency = 1.000
  825. ColorPickerToggle.Position = UDim2.new(0, 139, 0, 5)
  826. ColorPickerToggle.Size = UDim2.new(0, 42, 0, 20)
  827. ColorPickerToggle.ZIndex = 5
  828. ColorPickerToggle.Image = "rbxassetid://3570695787"
  829. ColorPickerToggle.ImageColor3 = presetcolor
  830. ColorPickerToggle.ScaleType = Enum.ScaleType.Slice
  831. ColorPickerToggle.SliceCenter = Rect.new(100, 100, 100, 100)
  832. ColorPickerToggle.SliceScale = 0.030
  833.  
  834. ColorPicker.Name = "ColorPicker"
  835. ColorPicker.Parent = NameColorPicker
  836. ColorPicker.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  837. ColorPicker.BackgroundTransparency = 1.000
  838. ColorPicker.ClipsDescendants = true
  839. ColorPicker.Position = UDim2.new(0.0599999987, 0, 0, 30)
  840. ColorPicker.Size = UDim2.new(0, 169, 0, 175)
  841. ColorPicker.ZIndex = 10
  842. ColorPicker.Image = "rbxassetid://3570695787"
  843. ColorPicker.ImageColor3 = Color3.fromRGB(45, 45, 45)
  844. ColorPicker.ScaleType = Enum.ScaleType.Slice
  845. ColorPicker.SliceCenter = Rect.new(100, 100, 100, 100)
  846. ColorPicker.SliceScale = 0.070
  847. ColorPicker.ImageTransparency = 1
  848.  
  849. Color.Name = "Color"
  850. Color.Parent = ColorPicker
  851. Color.BackgroundColor3 = presetcolor
  852. Color.BorderSizePixel = 0
  853. Color.Position = UDim2.new(0, 9, 0, 10)
  854. Color.Size = UDim2.new(0, 124, 0, 105)
  855. Color.ZIndex = 10
  856. Color.Image = "rbxassetid://4155801252"
  857.  
  858. ColorRound.Name = "ColorRound"
  859. ColorRound.Parent = Color
  860. ColorRound.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  861. ColorRound.BackgroundTransparency = 1.000
  862. ColorRound.ClipsDescendants = true
  863. ColorRound.Size = UDim2.new(1, 0, 1, 0)
  864. ColorRound.ZIndex = 10
  865. ColorRound.Image = "rbxassetid://4695575676"
  866. ColorRound.ImageColor3 = Color3.fromRGB(45, 45, 45)
  867. ColorRound.ScaleType = Enum.ScaleType.Slice
  868. ColorRound.SliceCenter = Rect.new(128, 128, 128, 128)
  869. ColorRound.SliceScale = 0.050
  870.  
  871. ColorSelection.Name = "ColorSelection"
  872. ColorSelection.Parent = Color
  873. ColorSelection.AnchorPoint = Vector2.new(0.5, 0.5)
  874. ColorSelection.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  875. ColorSelection.BackgroundTransparency = 1.000
  876. ColorSelection.Position = UDim2.new(presetcolor and select(3, Color3.toHSV(presetcolor)))
  877. ColorSelection.Size = UDim2.new(0, 18, 0, 18)
  878. ColorSelection.ZIndex = 25
  879. ColorSelection.Image = "rbxassetid://4953646208"
  880. ColorSelection.ScaleType = Enum.ScaleType.Fit
  881.  
  882. RValue.Name = "RValue"
  883. RValue.Parent = ColorPicker
  884. RValue.BackgroundColor3 = Color3.fromRGB(65, 65, 65)
  885. RValue.BackgroundTransparency = 1.000
  886. RValue.Position = UDim2.new(0, 10, 0, 123)
  887. RValue.Size = UDim2.new(0, 42, 0, 19)
  888. RValue.ZIndex = 10
  889. RValue.Image = "rbxassetid://3570695787"
  890. RValue.ImageColor3 = Color3.fromRGB(65, 65, 65)
  891. RValue.ScaleType = Enum.ScaleType.Slice
  892. RValue.SliceCenter = Rect.new(100, 100, 100, 100)
  893. RValue.SliceScale = 0.030
  894.  
  895. ValueR.Name = "ValueR"
  896. ValueR.Parent = RValue
  897. ValueR.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  898. ValueR.BackgroundTransparency = 1.000
  899. ValueR.Size = UDim2.new(1, 0, 1, 0)
  900. ValueR.ZIndex = 11
  901. ValueR.Font = Library.Theme.TextFont
  902. ValueR.Text = "R: 255"
  903. ValueR.TextColor3 = Color3.fromRGB(255, 255, 255)
  904. ValueR.TextSize = 14.000
  905.  
  906. GValue.Name = "GValue"
  907. GValue.Parent = ColorPicker
  908. GValue.BackgroundColor3 = Color3.fromRGB(65, 65, 65)
  909. GValue.BackgroundTransparency = 1.000
  910. GValue.Position = UDim2.new(0, 64, 0, 123)
  911. GValue.Size = UDim2.new(0, 42, 0, 19)
  912. GValue.ZIndex = 10
  913. GValue.Image = "rbxassetid://3570695787"
  914. GValue.ImageColor3 = Color3.fromRGB(65, 65, 65)
  915. GValue.ScaleType = Enum.ScaleType.Slice
  916. GValue.SliceCenter = Rect.new(100, 100, 100, 100)
  917. GValue.SliceScale = 0.030
  918.  
  919. ValueG.Name = "ValueG"
  920. ValueG.Parent = GValue
  921. ValueG.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  922. ValueG.BackgroundTransparency = 1.000
  923. ValueG.Size = UDim2.new(1, 0, 1, 0)
  924. ValueG.ZIndex = 11
  925. ValueG.Font = Library.Theme.TextFont
  926. ValueG.Text = "G: 255"
  927. ValueG.TextColor3 = Color3.fromRGB(255, 255, 255)
  928. ValueG.TextSize = 14.000
  929.  
  930. BValue.Name = "BValue"
  931. BValue.Parent = ColorPicker
  932. BValue.BackgroundColor3 = Color3.fromRGB(65, 65, 65)
  933. BValue.BackgroundTransparency = 1.000
  934. BValue.Position = UDim2.new(0, 119, 0, 123)
  935. BValue.Size = UDim2.new(0, 42, 0, 19)
  936. BValue.ZIndex = 10
  937. BValue.Image = "rbxassetid://3570695787"
  938. BValue.ImageColor3 = Color3.fromRGB(65, 65, 65)
  939. BValue.ScaleType = Enum.ScaleType.Slice
  940. BValue.SliceCenter = Rect.new(100, 100, 100, 100)
  941. BValue.SliceScale = 0.030
  942.  
  943. ValueB.Name = "ValueB"
  944. ValueB.Parent = BValue
  945. ValueB.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  946. ValueB.BackgroundTransparency = 1.000
  947. ValueB.Size = UDim2.new(1, 0, 1, 0)
  948. ValueB.ZIndex = 11
  949. ValueB.Font = Library.Theme.TextFont
  950. ValueB.Text = "B: 255"
  951. ValueB.TextColor3 = Color3.fromRGB(255, 255, 255)
  952. ValueB.TextSize = 14.000
  953.  
  954. RainbowToggle.Name = "RainbowToggle"
  955. RainbowToggle.Parent = ColorPicker
  956. RainbowToggle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  957. RainbowToggle.BackgroundTransparency = 1.000
  958. RainbowToggle.Position = UDim2.new(0, 10, 0, 143)
  959. RainbowToggle.Size = UDim2.new(0, 160, 0, 35)
  960. RainbowToggle.ZIndex = 10
  961.  
  962. RainbowToggleTitle.Name = "RainbowToggleTitle"
  963. RainbowToggleTitle.Parent = RainbowToggle
  964. RainbowToggleTitle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  965. RainbowToggleTitle.BackgroundTransparency = 1.000
  966. RainbowToggleTitle.Size = UDim2.new(0, 124, 0, 30)
  967. RainbowToggleTitle.ZIndex = 10
  968. RainbowToggleTitle.Font = Library.Theme.TextFont
  969. RainbowToggleTitle.Text = "Rainbow"
  970. RainbowToggleTitle.TextColor3 = Color3.fromRGB(185, 185, 185)
  971. RainbowToggleTitle.TextSize = 15
  972. RainbowToggleTitle.TextXAlignment = Enum.TextXAlignment.Left
  973.  
  974. Toggle.Name = "Toggle"
  975. Toggle.Parent = RainbowToggle
  976. Toggle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  977. Toggle.BackgroundTransparency = 1.000
  978. Toggle.Position = UDim2.new(0, 131, 0, 5)
  979. Toggle.Size = UDim2.new(0, 20, 0, 20)
  980. Toggle.ZIndex = 10
  981. Toggle.AutoButtonColor = false
  982. Toggle.Font = Library.Theme.TextFont
  983. Toggle.Text = ""
  984. Toggle.TextColor3 = Color3.fromRGB(0, 0, 0)
  985. Toggle.TextSize = 14.000
  986.  
  987. CheckboxOutline.Name = "CheckboxOutline"
  988. CheckboxOutline.Parent = Toggle
  989. CheckboxOutline.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  990. CheckboxOutline.BackgroundTransparency = 1.000
  991. CheckboxOutline.Position = UDim2.new(0.5, -12, 0.5, -12)
  992. CheckboxOutline.Size = UDim2.new(0, 24, 0, 24)
  993. CheckboxOutline.ZIndex = 10
  994. CheckboxOutline.Image = "http://www.roblox.com/asset/?id=5416796047"
  995. CheckboxOutline.ImageColor3 = Color3.fromRGB(65, 65, 65)
  996.  
  997. CheckboxTicked.Name = "CheckboxTicked"
  998. CheckboxTicked.Parent = Toggle
  999. CheckboxTicked.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1000. CheckboxTicked.BackgroundTransparency = 1.000
  1001. CheckboxTicked.Position = UDim2.new(0.5, -12, 0.5, -12)
  1002. CheckboxTicked.Size = UDim2.new(0, 24, 0, 24)
  1003. CheckboxTicked.ZIndex = 10
  1004. CheckboxTicked.Image = "http://www.roblox.com/asset/?id=5416796675"
  1005. CheckboxTicked.ImageColor3 = Color3.fromRGB(65, 65, 65)
  1006.  
  1007. TickCover.Name = "TickCover"
  1008. TickCover.Parent = Toggle
  1009. TickCover.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  1010. TickCover.BorderSizePixel = 0
  1011. TickCover.Position = UDim2.new(0.5, -7, 0.5, -7)
  1012. TickCover.Size = UDim2.new(0, 14, 0, 14)
  1013. TickCover.ZIndex = 10
  1014.  
  1015. Hue.Name = "Hue"
  1016. Hue.Parent = ColorPicker
  1017. Hue.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1018. Hue.BackgroundTransparency = 1.000
  1019. Hue.Position = UDim2.new(0, 136, 0, 10)
  1020. Hue.Size = UDim2.new(0, 25, 0, 105)
  1021. Hue.ZIndex = 10
  1022. Hue.Image = "rbxassetid://3570695787"
  1023. Hue.ScaleType = Enum.ScaleType.Slice
  1024. Hue.SliceCenter = Rect.new(100, 100, 100, 100)
  1025. Hue.SliceScale = 0.050
  1026.  
  1027. UIGradient.Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, Color3.fromRGB(255, 0, 4)), ColorSequenceKeypoint.new(0.20, Color3.fromRGB(234, 255, 0)), ColorSequenceKeypoint.new(0.40, Color3.fromRGB(21, 255, 0)), ColorSequenceKeypoint.new(0.60, Color3.fromRGB(0, 255, 255)), ColorSequenceKeypoint.new(0.80, Color3.fromRGB(0, 17, 255)), ColorSequenceKeypoint.new(0.90, Color3.fromRGB(255, 0, 251)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(255, 0, 4))}
  1028. UIGradient.Rotation = 270
  1029. UIGradient.Parent = Hue
  1030.  
  1031. HueSelection.Name = "HueSelection"
  1032. HueSelection.Parent = Hue
  1033. HueSelection.AnchorPoint = Vector2.new(0.5, 0.5)
  1034. HueSelection.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1035. HueSelection.BackgroundTransparency = 1.000
  1036. HueSelection.Position = UDim2.new(0.48, 0, 1 - select(1, Color3.toHSV(presetcolor)))
  1037. HueSelection.Size = UDim2.new(0, 18, 0, 18)
  1038. HueSelection.ZIndex = 10
  1039. HueSelection.Image = "rbxassetid://4953646208"
  1040. HueSelection.ScaleType = Enum.ScaleType.Fit
  1041.  
  1042. local function SetRGBValues()
  1043. ValueR.Text = ("R: " .. math.floor(ColorPickerToggle.ImageColor3.r * 255))
  1044. ValueG.Text = ("G: " .. math.floor(ColorPickerToggle.ImageColor3.g * 255))
  1045. ValueB.Text = ("B: " .. math.floor(ColorPickerToggle.ImageColor3.b * 255))
  1046. end
  1047.  
  1048. local function UpdateColorPicker(nope)
  1049. ColorPickerToggle.ImageColor3 = Color3.fromHSV(ColorH, ColorS, ColorV)
  1050. Color.BackgroundColor3 = Color3.fromHSV(ColorH, 1, 1)
  1051.  
  1052. SetRGBValues()
  1053. callback(ColorPickerToggle.ImageColor3)
  1054. end
  1055.  
  1056. ColorH = 1 - (math.clamp(HueSelection.AbsolutePosition.Y - Hue.AbsolutePosition.Y, 0, Hue.AbsoluteSize.Y) / Hue.AbsoluteSize.Y)
  1057. ColorS = (math.clamp(ColorSelection.AbsolutePosition.X - Color.AbsolutePosition.X, 0, Color.AbsoluteSize.X) / Color.AbsoluteSize.X)
  1058. ColorV = 1 - (math.clamp(ColorSelection.AbsolutePosition.Y - Color.AbsolutePosition.Y, 0, Color.AbsoluteSize.Y) / Color.AbsoluteSize.Y)
  1059.  
  1060. ColorPickerToggle.ImageColor3 = presetcolor
  1061. Color.BackgroundColor3 = presetcolor
  1062. SetRGBValues()
  1063. callback(Color.BackgroundColor3)
  1064.  
  1065. Color.InputBegan:Connect(function(input)
  1066. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1067. if RainbowColorPicker then return end
  1068.  
  1069. if ColorInput then
  1070. ColorInput:Disconnect()
  1071. end
  1072.  
  1073. ColorInput = RunService.RenderStepped:Connect(function()
  1074. local ColorX = (math.clamp(Mouse.X - Color.AbsolutePosition.X, 0, Color.AbsoluteSize.X) / Color.AbsoluteSize.X)
  1075. local ColorY = (math.clamp(Mouse.Y - Color.AbsolutePosition.Y, 0, Color.AbsoluteSize.Y) / Color.AbsoluteSize.Y)
  1076.  
  1077. ColorSelection.Position = UDim2.new(ColorX, 0, ColorY, 0)
  1078. ColorS = ColorX
  1079. ColorV = 1 - ColorY
  1080.  
  1081. UpdateColorPicker(true)
  1082. end)
  1083. end
  1084. end)
  1085.  
  1086. Color.InputEnded:Connect(function(input)
  1087. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1088. if ColorInput then
  1089. ColorInput:Disconnect()
  1090. end
  1091. end
  1092. end)
  1093.  
  1094. Hue.InputBegan:Connect(function(input)
  1095. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1096. if RainbowColorPicker then return end
  1097.  
  1098. if HueInput then
  1099. HueInput:Disconnect()
  1100. end
  1101.  
  1102. HueInput = RunService.RenderStepped:Connect(function()
  1103. local HueY = (math.clamp(Mouse.Y - Hue.AbsolutePosition.Y, 0, Hue.AbsoluteSize.Y) / Hue.AbsoluteSize.Y)
  1104.  
  1105. HueSelection.Position = UDim2.new(0.48, 0, HueY, 0)
  1106. ColorH = 1 - HueY
  1107.  
  1108. UpdateColorPicker(true)
  1109. end)
  1110. end
  1111. end)
  1112.  
  1113. Hue.InputEnded:Connect(function(input)
  1114. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1115. if HueInput then
  1116. HueInput:Disconnect()
  1117. end
  1118. end
  1119. end)
  1120.  
  1121. Toggle.MouseButton1Down:Connect(function()
  1122. RainbowColorPicker = not RainbowColorPicker
  1123.  
  1124. if ColorInput then
  1125. ColorInput:Disconnect()
  1126. end
  1127.  
  1128. if HueInput then
  1129. HueInput:Disconnect()
  1130. end
  1131.  
  1132. if RainbowColorPicker then
  1133. TweenService:Create(RainbowToggleTitle, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {TextColor3 = Color3.fromRGB(255, 255, 255)}):Play()
  1134. TweenService:Create(TickCover, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {Position = UDim2.new(0.5, 0, 0.5, 0), Size = UDim2.new(0, 0, 0, 0)}):Play()
  1135. TweenService:Create(CheckboxOutline, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {ImageColor3 = Library.Theme.MainColor}):Play()
  1136. TweenService:Create(CheckboxTicked, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {ImageColor3 = Library.Theme.MainColor}):Play()
  1137.  
  1138. OldToggleColor = ColorPickerToggle.ImageColor3
  1139. OldColor = Color.BackgroundColor3
  1140. OldColorSelectionPosition = ColorSelection.Position
  1141. OldHueSelectionPosition = HueSelection.Position
  1142.  
  1143. while RainbowColorPicker do
  1144. ColorPickerToggle.ImageColor3 = Color3.fromHSV(Library.RainbowColorValue, 1, 1)
  1145. Color.BackgroundColor3 = Color3.fromHSV(Library.RainbowColorValue, 1, 1)
  1146.  
  1147. ColorSelection.Position = UDim2.new(1, 0, 0, 0)
  1148. HueSelection.Position = UDim2.new(0.48, 0, 0, Library.HueSelectionPosition)
  1149.  
  1150. SetRGBValues()
  1151. callback(Color.BackgroundColor3)
  1152. wait()
  1153. end
  1154. elseif not RainbowColorPicker then
  1155. ColorPickerToggle.ImageColor3 = OldToggleColor
  1156. Color.BackgroundColor3 = OldColor
  1157.  
  1158. ColorSelection.Position = OldColorSelectionPosition
  1159. HueSelection.Position = OldHueSelectionPosition
  1160.  
  1161. SetRGBValues()
  1162. callback(ColorPickerToggle.ImageColor3)
  1163.  
  1164. TweenService:Create(RainbowToggleTitle, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {TextColor3 = Color3.fromRGB(185, 185, 185)}):Play()
  1165. TweenService:Create(TickCover, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {Position = UDim2.new(0.5, -7, 0.5, -7), Size = UDim2.new(0, 14, 0, 14)}):Play()
  1166. TweenService:Create(CheckboxOutline, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {ImageColor3 = Color3.fromRGB(65, 65, 65)}):Play()
  1167. TweenService:Create(CheckboxTicked, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {ImageColor3 = Color3.fromRGB(65, 65, 65)}):Play()
  1168. end
  1169. end)
  1170.  
  1171. ColorPickerToggle.MouseButton1Down:Connect(function()
  1172. ColorPickerToggled = not ColorPickerToggled
  1173.  
  1174. if ColorPickerToggled then
  1175. TweenService:Create(NameColorPicker, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 197, 0, 210)}):Play()
  1176. TweenService:Create(ColorPicker, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {ImageTransparency = 0}):Play()
  1177. elseif not ColorPickerToggled then
  1178. TweenService:Create(NameColorPicker, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 197, 0, 32)}):Play()
  1179. TweenService:Create(ColorPicker, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {ImageTransparency = 1}):Play()
  1180. end
  1181. end)
  1182.  
  1183. table.insert(Library.LibraryColorTable, CheckboxOutline)
  1184. table.insert(Library.LibraryColorTable, CheckboxTicked)
  1185. end
  1186.  
  1187. function SectionElements:CreateDropdown(name, options, presetoption, callback)
  1188. local NameDropdown = Instance.new("Frame")
  1189. local TitleToggle = Instance.new("TextButton")
  1190. local Dropdown = Instance.new("ImageLabel")
  1191. local DropdownContentLayout = Instance.new("UIListLayout")
  1192.  
  1193. local DropdownToggled = true
  1194. local SelectedOption = options[presetoption]
  1195.  
  1196. NameDropdown.Name = (name .. "Dropdown")
  1197. NameDropdown.Parent = SectionContent
  1198. NameDropdown.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1199. NameDropdown.BackgroundTransparency = 1.000
  1200. NameDropdown.Position = UDim2.new(0, 0, 0.773480654, 0)
  1201. NameDropdown.Size = UDim2.new(0, 197, 0, 35)
  1202. NameDropdown.ZIndex = 5
  1203.  
  1204. TitleToggle.Archivable = false
  1205. TitleToggle.Name = "TitleToggle"
  1206. TitleToggle.Parent = NameDropdown
  1207. TitleToggle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1208. TitleToggle.BackgroundTransparency = 1.000
  1209. TitleToggle.BorderSizePixel = 0
  1210. TitleToggle.Position = UDim2.new(0, 13, 0, 0)
  1211. TitleToggle.Size = UDim2.new(0, 167, 0, 30)
  1212. TitleToggle.ZIndex = 7
  1213. TitleToggle.Font = Library.Theme.TextFont
  1214. TitleToggle.Text = (name .. " - " .. SelectedOption)
  1215. TitleToggle.TextColor3 = Color3.fromRGB(255, 255, 255)
  1216. TitleToggle.TextSize = 15.000
  1217. TitleToggle.TextXAlignment = Enum.TextXAlignment.Left
  1218.  
  1219. Dropdown.Name = "Dropdown"
  1220. Dropdown.Parent = NameDropdown
  1221. Dropdown.BackgroundColor3 = Library.Theme.BackgroundColor
  1222. Dropdown.BackgroundTransparency = 1.000
  1223. Dropdown.Position = UDim2.new(0, 15, 0, 30)
  1224. Dropdown.Size = UDim2.new(0, 165, 0, 0)
  1225. Dropdown.ZIndex = 15
  1226. Dropdown.Image = "rbxassetid://3570695787"
  1227. Dropdown.ImageColor3 = Color3.fromRGB(45, 45, 45)
  1228. Dropdown.ScaleType = Enum.ScaleType.Slice
  1229. Dropdown.SliceCenter = Rect.new(100, 100, 100, 100)
  1230. Dropdown.SliceScale = 0.050
  1231. Dropdown.ClipsDescendants = true
  1232.  
  1233. DropdownContentLayout.Name = "DropdownContentLayout"
  1234. DropdownContentLayout.Parent = Dropdown
  1235. DropdownContentLayout.SortOrder = Enum.SortOrder.LayoutOrder
  1236.  
  1237. local function ResetAllDropdownItems()
  1238. for i, v in pairs(Dropdown:GetChildren()) do
  1239. if v:IsA("TextButton") then
  1240. TweenService:Create(v, TweenInfo.new(0.25, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)}):Play()
  1241. end
  1242. end
  1243. end
  1244.  
  1245. local function ClearAllDropdownItems()
  1246. for i, v in pairs(Dropdown:GetChildren()) do
  1247. if v:IsA("TextButton") then
  1248. v:Destroy()
  1249. end
  1250. end
  1251.  
  1252. DropdownToggled = true
  1253. TweenService:Create(TitleToggle, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)}):Play()
  1254. TweenService:Create(NameDropdown, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 197, 0, 35)}):Play()
  1255. TweenService:Create(Dropdown, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 165, 0, 0)}):Play()
  1256. end
  1257.  
  1258. for i, v in pairs(options) do
  1259. local NameButton = Instance.new("TextButton")
  1260.  
  1261. NameButton.Name = (v .. "DropdownButton")
  1262. NameButton.Parent = Dropdown
  1263. NameButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1264. NameButton.BackgroundTransparency = 1.000
  1265. NameButton.BorderSizePixel = 0
  1266. NameButton.Size = UDim2.new(0, 165, 0, 25)
  1267. NameButton.ZIndex = 15
  1268. NameButton.AutoButtonColor = false
  1269. NameButton.Font = Library.Theme.TextFont
  1270. NameButton.Text = v
  1271. NameButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  1272. NameButton.TextSize = 15.000
  1273.  
  1274. table.insert(Library.LibraryColorTable, NameButton)
  1275.  
  1276. if v == SelectedOption then
  1277. NameButton.TextColor3 = Library.Theme.MainColor
  1278. end
  1279.  
  1280. NameButton.MouseButton1Down:Connect(function()
  1281. SelectedOption = v
  1282. ResetAllDropdownItems()
  1283. TitleToggle.Text = (name .. " - " .. SelectedOption)
  1284. TweenService:Create(NameButton, TweenInfo.new(0.35, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {TextColor3 = Library.Theme.MainColor}):Play()
  1285. callback(NameButton.Text)
  1286. end)
  1287.  
  1288. NameButton.InputBegan:Connect(function(input)
  1289. if input.UserInputType == Enum.UserInputType.MouseMovement then
  1290. TweenService:Create(NameButton, TweenInfo.new(0.35, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {BackgroundTransparency = 0.95}):Play()
  1291. end
  1292. end)
  1293.  
  1294. NameButton.InputEnded:Connect(function(input)
  1295. if input.UserInputType == Enum.UserInputType.MouseMovement then
  1296. TweenService:Create(NameButton, TweenInfo.new(0.35, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  1297. end
  1298. end)
  1299. end
  1300.  
  1301. TitleToggle.MouseButton1Down:Connect(function()
  1302. DropdownToggled = not DropdownToggled
  1303.  
  1304. if DropdownToggled then
  1305. TweenService:Create(TitleToggle, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)}):Play()
  1306. TweenService:Create(NameDropdown, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 197, 0, 35)}):Play()
  1307. TweenService:Create(Dropdown, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 165, 0, 0)}):Play()
  1308. elseif not DropdownToggled then
  1309. TweenService:Create(TitleToggle, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(185, 185, 185)}):Play()
  1310. TweenService:Create(NameDropdown, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 197, 0, 35 + DropdownContentLayout.AbsoluteContentSize.Y)}):Play()
  1311. TweenService:Create(Dropdown, TweenInfo.new(0.5, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 165, 0, DropdownContentLayout.AbsoluteContentSize.Y)}):Play()
  1312. end
  1313. end)
  1314.  
  1315. local function Refresh(newoptions, newpresetoption, newcallback)
  1316. ClearAllDropdownItems()
  1317.  
  1318. local SelectedOption = newoptions[newpresetoption]
  1319. TitleToggle.Text = (name .. " - " .. SelectedOption)
  1320.  
  1321. for i, v in pairs(newoptions) do
  1322. local NameButton = Instance.new("TextButton")
  1323.  
  1324. NameButton.Name = (v .. "Button")
  1325. NameButton.Parent = Dropdown
  1326. NameButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1327. NameButton.BackgroundTransparency = 1.000
  1328. NameButton.BorderSizePixel = 0
  1329. NameButton.Size = UDim2.new(0, 165, 0, 25)
  1330. NameButton.ZIndex = 15
  1331. NameButton.AutoButtonColor = false
  1332. NameButton.Font = Library.Theme.TextFont
  1333. NameButton.Text = v
  1334. NameButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  1335. NameButton.TextSize = 15.000
  1336.  
  1337. if v == SelectedOption then
  1338. NameButton.TextColor3 = Library.Theme.MainColor
  1339. end
  1340.  
  1341. NameButton.MouseButton1Down:Connect(function()
  1342. SelectedOption = v
  1343. ResetAllDropdownItems()
  1344. TitleToggle.Text = (name .. " - " .. SelectedOption)
  1345. TweenService:Create(NameButton, TweenInfo.new(0.35, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {TextColor3 = Library.Theme.MainColor}):Play()
  1346. newcallback(NameButton.Text)
  1347. end)
  1348.  
  1349. NameButton.InputBegan:Connect(function(input)
  1350. if input.UserInputType == Enum.UserInputType.MouseMovement then
  1351. TweenService:Create(NameButton, TweenInfo.new(0.35, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {BackgroundTransparency = 0.95}):Play()
  1352. end
  1353. end)
  1354.  
  1355. NameButton.InputEnded:Connect(function(input)
  1356. if input.UserInputType == Enum.UserInputType.MouseMovement then
  1357. TweenService:Create(NameButton, TweenInfo.new(0.35, Library.Theme.EasingStyle, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  1358. end
  1359. end)
  1360. end
  1361. end
  1362.  
  1363. return {
  1364. Refresh = Refresh
  1365. }
  1366. end
  1367.  
  1368. function SectionElements:CreateKeybind(name, presetbind, keyboardonly, holdmode, callback)
  1369. local NameKeybind = Instance.new("Frame")
  1370. local Title = Instance.new("TextLabel")
  1371. local KeybindButtonBorder = Instance.new("ImageLabel")
  1372. local KeybindButton = Instance.new("TextButton")
  1373.  
  1374. local OldBind = presetbind.Name
  1375. local LoadFromPreset = false
  1376. local JustBinded = false
  1377.  
  1378. local NotAllowedKeys = {
  1379. Return = true,
  1380. Space = true,
  1381. Tab = true,
  1382. Unknown = true,
  1383. MouseButton1 = true
  1384. }
  1385.  
  1386. local AllowedMouseTypes = {
  1387. MouseButton2 = true,
  1388. MouseButton3 = true
  1389. }
  1390.  
  1391. local ShortenedNames = {
  1392. LeftShift = "LShift",
  1393. RightShift = "RShift",
  1394. LeftControl = "LCtrl",
  1395. RightControl = "RCtrl",
  1396. LeftAlt = "LAlt",
  1397. RightAlt = "RAlt",
  1398. CapsLock = "Caps",
  1399. One = "1",
  1400. Two = "2",
  1401. Three = "3",
  1402. Four = "4",
  1403. Five = "5",
  1404. Six = "6",
  1405. Seven = "7",
  1406. Eight = "8",
  1407. Nine = "9",
  1408. Zero = "0",
  1409. KeypadOne = "Num-1",
  1410. KeypadTwo = "Num-2",
  1411. KeypadThree = "Num-3",
  1412. KeypadFour = "Num-4",
  1413. KeypadFive = "Num-5",
  1414. KeypadSix = "Num-6",
  1415. KeypadSeven = "Num-7",
  1416. KeypadEight = "Num-8",
  1417. KeypadNine = "Num-9",
  1418. KeypadZero = "Num-0",
  1419. Minus = "-",
  1420. Equals = "=",
  1421. Tilde = "~",
  1422. LeftBracket = "[",
  1423. RightBracket = "]",
  1424. RightParenthesis = ")",
  1425. LeftParenthesis = "(",
  1426. Semicolon = ";",
  1427. Quote = "'",
  1428. BackSlash = "\\",
  1429. Comma = ",",
  1430. Period = ".",
  1431. Slash = "/",
  1432. Asterisk = "*",
  1433. Plus = "+",
  1434. Period = ".",
  1435. Backquote = "`",
  1436. MouseButton1 = "M1",
  1437. MouseButton2 = "M2",
  1438. MouseButton3 = "M3"
  1439. }
  1440.  
  1441. NameKeybind.Name = (name .. "Keybind")
  1442. NameKeybind.Parent = SectionContent
  1443. NameKeybind.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1444. NameKeybind.BackgroundTransparency = 1.000
  1445. NameKeybind.Position = UDim2.new(0, 0, 0.138121545, 0)
  1446. NameKeybind.Size = UDim2.new(0, 197, 0, 35)
  1447.  
  1448. Title.Name = "Title"
  1449. Title.Parent = NameKeybind
  1450. Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1451. Title.BackgroundTransparency = 1.000
  1452. Title.Position = UDim2.new(0, 13, 0, 0)
  1453. Title.Size = UDim2.new(0, 151, 0, 30)
  1454. Title.ZIndex = 5
  1455. Title.Font = Library.Theme.TextFont
  1456. Title.Text = name
  1457. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  1458. Title.TextSize = 15.000
  1459. Title.TextXAlignment = Enum.TextXAlignment.Left
  1460.  
  1461. KeybindButtonBorder.Name = "KeybindButtonBorder"
  1462. KeybindButtonBorder.Parent = NameKeybind
  1463. KeybindButtonBorder.BackgroundColor3 = Color3.fromRGB(65, 65, 65)
  1464. KeybindButtonBorder.BackgroundTransparency = 1.000
  1465. KeybindButtonBorder.Position = UDim2.new(0, 139, 0, 5)
  1466. KeybindButtonBorder.Size = UDim2.new(0, 42, 0, 20)
  1467. KeybindButtonBorder.ZIndex = 5
  1468. KeybindButtonBorder.Image = "rbxassetid://3570695787"
  1469. KeybindButtonBorder.ImageColor3 = Color3.fromRGB(65, 65, 65)
  1470. KeybindButtonBorder.ScaleType = Enum.ScaleType.Slice
  1471. KeybindButtonBorder.SliceCenter = Rect.new(100, 100, 100, 100)
  1472. KeybindButtonBorder.SliceScale = 0.030
  1473.  
  1474. KeybindButton.Name = "KeybindButton"
  1475. KeybindButton.Parent = KeybindButtonBorder
  1476. KeybindButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  1477. KeybindButton.BackgroundTransparency = 1.000
  1478. KeybindButton.Size = UDim2.new(1, 0, 1, 0)
  1479. KeybindButton.ZIndex = 5
  1480. KeybindButton.Font = Library.Theme.TextFont
  1481. KeybindButton.Text = (ShortenedNames[presetbind.Name] or ShortenedNames[presetbind] or presetbind.Name or "None")
  1482. KeybindButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  1483. KeybindButton.TextSize = 15.000
  1484. KeybindButton.TextWrapped = true
  1485.  
  1486. if LoadFromPreset then
  1487. KeybindButton.Text = presetbind
  1488. end
  1489.  
  1490. if presetbind == Enum.KeyCode.Unknown or presetbind == "Unknown" then
  1491. KeybindButton.Text = "None"
  1492. end
  1493.  
  1494. KeybindButton.MouseButton1Click:Connect(function()
  1495. if Library.CurrentlyBinding then return end
  1496.  
  1497. KeybindButton.Text = "..."
  1498.  
  1499. local Input, Bruh = UserInputService.InputBegan:wait()
  1500. Library.CurrentlyBinding = true
  1501.  
  1502. if Input.KeyCode.Name == "Backspace" or Input.KeyCode.Name == "Delete" then
  1503. KeybindButton.Text = "None"
  1504. OldBind = Enum.KeyCode.Unknown.Name
  1505. Library.CurrentlyBinding = false
  1506. JustBinded = false
  1507. return
  1508. end
  1509.  
  1510. if (Input.UserInputType ~= Enum.UserInputType.Keyboard and (AllowedMouseTypes[Input.UserInputType.Name]) and (not keyboardonly)) or (Input.KeyCode and (not NotAllowedKeys[Input.KeyCode.Name])) then
  1511. local BindName = ((Input.UserInputType ~= Enum.UserInputType.Keyboard and Input.UserInputType.Name) or Input.KeyCode.Name)
  1512. KeybindButton.Text = ShortenedNames[BindName] or BindName
  1513. OldBind = BindName
  1514. Library.CurrentlyBinding = false
  1515. JustBinded = true
  1516. else
  1517. KeybindButton.Text = ShortenedNames[OldBind] or OldBind
  1518. Library.CurrentlyBinding = false
  1519. end
  1520. end)
  1521.  
  1522. if not holdmode then
  1523. UserInputService.InputBegan:Connect(function(input, gameprocessedevent)
  1524. if not gameprocessedevent then
  1525. if UserInputService:GetFocusedTextBox() then return end
  1526. if OldBind == Enum.KeyCode.Unknown.Name then return end
  1527. if JustBinded then JustBinded = false return end
  1528.  
  1529. local BindName = ((input.UserInputType ~= Enum.UserInputType.Keyboard and input.UserInputType.Name) or input.KeyCode.Name)
  1530.  
  1531. if BindName == OldBind then
  1532. callback()
  1533. end
  1534. end
  1535. end)
  1536. else
  1537. UserInputService.InputBegan:Connect(function(input, gameprocessedevent)
  1538. if not gameprocessedevent then
  1539. if UserInputService:GetFocusedTextBox() then return end
  1540. if OldBind == Enum.KeyCode.Unknown.Name then return end
  1541. if JustBinded then JustBinded = false return end
  1542.  
  1543. local BindName = ((input.UserInputType ~= Enum.UserInputType.Keyboard and input.UserInputType.Name) or input.KeyCode.Name)
  1544.  
  1545. if BindName == OldBind then
  1546. callback(true)
  1547. end
  1548. end
  1549. end)
  1550.  
  1551. UserInputService.InputEnded:Connect(function(input, gameprocessedevent)
  1552. if not gameprocessedevent then
  1553. if UserInputService:GetFocusedTextBox() then return end
  1554. if OldBind == Enum.KeyCode.Unknown.Name then return end
  1555. if JustBinded then JustBinded = false return end
  1556.  
  1557. HoldModeToggled = false
  1558. local BindName = ((input.UserInputType ~= Enum.UserInputType.Keyboard and input.UserInputType.Name) or input.KeyCode.Name)
  1559.  
  1560. if BindName == OldBind then
  1561. callback(false)
  1562. end
  1563. end
  1564. end)
  1565. end
  1566. end
  1567.  
  1568. SectionContent.CanvasSize = UDim2.new(0, 0, 0, SectionContentLayout.AbsoluteContentSize.Y + 15)
  1569.  
  1570. return SectionElements
  1571. end
  1572.  
  1573. return TabElements
  1574. end
  1575.  
  1576. return Library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement