eruaaaaaaa

Untitled

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