M0nkePr0

Untitled

Dec 25th, 2022
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 58.80 KB | None | 0 0
  1. local library = {flags = {}, windows = {}, open = true}
  2.  
  3. --Services
  4. local runService = game:GetService"RunService"
  5. local tweenService = game:GetService"TweenService"
  6. local textService = game:GetService"TextService"
  7. local inputService = game:GetService"UserInputService"
  8.  
  9. --Locals
  10. local dragging, dragInput, dragStart, startPos, dragObject
  11.  
  12. local blacklistedKeys = { --add or remove keys if you find the need to
  13. Enum.KeyCode.Unknown,Enum.KeyCode.W,Enum.KeyCode.A,Enum.KeyCode.S,Enum.KeyCode.D,Enum.KeyCode.Slash,Enum.KeyCode.Tab,Enum.KeyCode.Backspace,Enum.KeyCode.Escape
  14. }
  15. local whitelistedMouseinputs = { --add or remove mouse inputs if you find the need to
  16. Enum.UserInputType.MouseButton1,Enum.UserInputType.MouseButton2,Enum.UserInputType.MouseButton3
  17. }
  18.  
  19. --Functions
  20. local function round(num, bracket)
  21. bracket = bracket or 1
  22. local a = math.floor(num/bracket + (math.sign(num) * 0.5)) * bracket
  23. if a < 0 then
  24. a = a + bracket
  25. end
  26. return a
  27. end
  28.  
  29. local function keyCheck(x,x1)
  30. for _,v in next, x1 do
  31. if v == x then
  32. return true
  33. end
  34. end
  35. end
  36.  
  37. local function update(input)
  38. local delta = input.Position - dragStart
  39. local yPos = (startPos.Y.Offset + delta.Y) < -36 and -36 or startPos.Y.Offset + delta.Y
  40. dragObject:TweenPosition(UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, yPos), "Out", "Quint", 0.1, true)
  41. end
  42.  
  43. --From: https://devforum.roblox.com/t/how-to-create-a-simple-rainbow-effect-using-tweenService/221849/2
  44. local chromaColor
  45. local rainbowTime = 5
  46. spawn(function()
  47. while wait() do
  48. chromaColor = Color3.fromHSV(tick() % rainbowTime / rainbowTime, 1, 1)
  49. end
  50. end)
  51.  
  52. function library:Create(class, properties)
  53. properties = typeof(properties) == "table" and properties or {}
  54. local inst = Instance.new(class)
  55. for property, value in next, properties do
  56. inst[property] = value
  57. end
  58. return inst
  59. end
  60.  
  61. local function createOptionHolder(holderTitle, parent, parentTable, subHolder)
  62. local size = subHolder and 34 or 40
  63. parentTable.main = library:Create("ImageButton", {
  64. LayoutOrder = subHolder and parentTable.position or 0,
  65. Position = UDim2.new(0, 20 + (250 * (parentTable.position or 0)), 0, 20),
  66. Size = UDim2.new(0, 230, 0, size),
  67. BackgroundTransparency = 1,
  68. Image = "rbxassetid://3570695787",
  69. ImageColor3 = Color3.fromRGB(20, 20, 20),
  70. ScaleType = Enum.ScaleType.Slice,
  71. SliceCenter = Rect.new(100, 100, 100, 100),
  72. SliceScale = 0.04,
  73. ClipsDescendants = true,
  74. Parent = parent
  75. })
  76.  
  77. local round
  78. if not subHolder then
  79. round = library:Create("ImageLabel", {
  80. Size = UDim2.new(1, 0, 0, size),
  81. BackgroundTransparency = 1,
  82. Image = "rbxassetid://3570695787",
  83. ImageColor3 = parentTable.open and (subHolder and Color3.fromRGB(16, 16, 16) or Color3.fromRGB(10, 10, 10)) or (subHolder and Color3.fromRGB(10, 10, 10) or Color3.fromRGB(6, 6, 6)),
  84. ScaleType = Enum.ScaleType.Slice,
  85. SliceCenter = Rect.new(100, 100, 100, 100),
  86. SliceScale = 0.04,
  87. Parent = parentTable.main
  88. })
  89. end
  90.  
  91. local title = library:Create("TextLabel", {
  92. Size = UDim2.new(1, 0, 0, size),
  93. BackgroundTransparency = subHolder and 0 or 1,
  94. BackgroundColor3 = Color3.fromRGB(10, 10, 10),
  95. BorderSizePixel = 0,
  96. Text = holderTitle,
  97. TextSize = subHolder and 16 or 17,
  98. Font = Enum.Font.GothamBold,
  99. TextColor3 = Color3.fromRGB(255, 255, 255),
  100. Parent = parentTable.main
  101. })
  102.  
  103. local closeHolder = library:Create("Frame", {
  104. Position = UDim2.new(1, 0, 0, 0),
  105. Size = UDim2.new(-1, 0, 1, 0),
  106. SizeConstraint = Enum.SizeConstraint.RelativeYY,
  107. BackgroundTransparency = 1,
  108. Parent = title
  109. })
  110.  
  111. local close = library:Create("ImageLabel", {
  112. AnchorPoint = Vector2.new(0.5, 0.5),
  113. Position = UDim2.new(0.5, 0, 0.5, 0),
  114. Size = UDim2.new(1, -size - 10, 1, -size - 10),
  115. Rotation = parentTable.open and 90 or 180,
  116. BackgroundTransparency = 1,
  117. Image = "rbxassetid://4918373417",
  118. ImageColor3 = parentTable.open and Color3.fromRGB(50, 50, 50) or Color3.fromRGB(30, 30, 30),
  119. ScaleType = Enum.ScaleType.Fit,
  120. Parent = closeHolder
  121. })
  122.  
  123. parentTable.content = library:Create("Frame", {
  124. Position = UDim2.new(0, 0, 0, size),
  125. Size = UDim2.new(1, 0, 1, -size),
  126. BackgroundTransparency = 1,
  127. Parent = parentTable.main
  128. })
  129.  
  130. local layout = library:Create("UIListLayout", {
  131. SortOrder = Enum.SortOrder.LayoutOrder,
  132. Parent = parentTable.content
  133. })
  134.  
  135. layout.Changed:connect(function()
  136. parentTable.content.Size = UDim2.new(1, 0, 0, layout.AbsoluteContentSize.Y)
  137. parentTable.main.Size = #parentTable.options > 0 and parentTable.open and UDim2.new(0, 230, 0, layout.AbsoluteContentSize.Y + size) or UDim2.new(0, 230, 0, size)
  138. end)
  139.  
  140. if not subHolder then
  141. library:Create("UIPadding", {
  142. Parent = parentTable.content
  143. })
  144.  
  145. title.InputBegan:connect(function(input)
  146. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  147. dragObject = parentTable.main
  148. dragging = true
  149. dragStart = input.Position
  150. startPos = dragObject.Position
  151. end
  152. end)
  153. title.InputChanged:connect(function(input)
  154. if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  155. dragInput = input
  156. end
  157. end)
  158. title.InputEnded:connect(function(input)
  159. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  160. dragging = false
  161. end
  162. end)
  163. end
  164.  
  165. closeHolder.InputBegan:connect(function(input)
  166. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  167. parentTable.open = not parentTable.open
  168. tweenService:Create(close, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Rotation = parentTable.open and 90 or 180, ImageColor3 = parentTable.open and Color3.fromRGB(50, 50, 50) or Color3.fromRGB(30, 30, 30)}):Play()
  169. if subHolder then
  170. tweenService:Create(title, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = parentTable.open and Color3.fromRGB(16, 16, 16) or Color3.fromRGB(10, 10, 10)}):Play()
  171. else
  172. tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = parentTable.open and Color3.fromRGB(10, 10, 10) or Color3.fromRGB(6, 6, 6)}):Play()
  173. end
  174. parentTable.main:TweenSize(#parentTable.options > 0 and parentTable.open and UDim2.new(0, 230, 0, layout.AbsoluteContentSize.Y + size) or UDim2.new(0, 230, 0, size), "Out", "Quad", 0.2, true)
  175. end
  176. end)
  177.  
  178. function parentTable:SetTitle(newTitle)
  179. title.Text = tostring(newTitle)
  180. end
  181.  
  182. return parentTable
  183. end
  184.  
  185. local function createLabel(option, parent)
  186. local main = library:Create("TextLabel", {
  187. LayoutOrder = option.position,
  188. Size = UDim2.new(1, 0, 0, 26),
  189. BackgroundTransparency = 1,
  190. Text = " " .. option.text,
  191. TextSize = 17,
  192. Font = Enum.Font.Gotham,
  193. TextColor3 = Color3.fromRGB(255, 255, 255),
  194. TextXAlignment = Enum.TextXAlignment.Left,
  195. Parent = parent.content
  196. })
  197.  
  198. setmetatable(option, {__newindex = function(t, i, v)
  199. if i == "Text" then
  200. main.Text = " " .. tostring(v)
  201. end
  202. end})
  203. end
  204.  
  205. function createToggle(option, parent)
  206. local main = library:Create("TextLabel", {
  207. LayoutOrder = option.position,
  208. Size = UDim2.new(1, 0, 0, 31),
  209. BackgroundTransparency = 1,
  210. Text = " " .. option.text,
  211. TextSize = 17,
  212. Font = Enum.Font.Gotham,
  213. TextColor3 = Color3.fromRGB(255, 255, 255),
  214. TextXAlignment = Enum.TextXAlignment.Left,
  215. Parent = parent.content
  216. })
  217.  
  218. local tickboxOutline = library:Create("ImageLabel", {
  219. Position = UDim2.new(1, -6, 0, 4),
  220. Size = UDim2.new(-1, 10, 1, -10),
  221. SizeConstraint = Enum.SizeConstraint.RelativeYY,
  222. BackgroundTransparency = 1,
  223. Image = "rbxassetid://3570695787",
  224. ImageColor3 = option.state and Color3.fromRGB(255, 65, 65) or Color3.fromRGB(100, 100, 100),
  225. ScaleType = Enum.ScaleType.Slice,
  226. SliceCenter = Rect.new(100, 100, 100, 100),
  227. SliceScale = 0.02,
  228. Parent = main
  229. })
  230.  
  231. local tickboxInner = library:Create("ImageLabel", {
  232. Position = UDim2.new(0, 2, 0, 2),
  233. Size = UDim2.new(1, -4, 1, -4),
  234. BackgroundTransparency = 1,
  235. Image = "rbxassetid://3570695787",
  236. ImageColor3 = option.state and Color3.fromRGB(255, 65, 65) or Color3.fromRGB(20, 20, 20),
  237. ScaleType = Enum.ScaleType.Slice,
  238. SliceCenter = Rect.new(100, 100, 100, 100),
  239. SliceScale = 0.02,
  240. Parent = tickboxOutline
  241. })
  242.  
  243. local checkmarkHolder = library:Create("Frame", {
  244. Position = UDim2.new(0, 4, 0, 4),
  245. Size = option.state and UDim2.new(1, -8, 1, -8) or UDim2.new(0, 0, 1, -8),
  246. BackgroundTransparency = 1,
  247. ClipsDescendants = true,
  248. Parent = tickboxOutline
  249. })
  250.  
  251. local checkmark = library:Create("ImageLabel", {
  252. Size = UDim2.new(1, 0, 1, 0),
  253. SizeConstraint = Enum.SizeConstraint.RelativeYY,
  254. BackgroundTransparency = 1,
  255. Image = "rbxassetid://4919148038",
  256. ImageColor3 = Color3.fromRGB(20, 20, 20),
  257. Parent = checkmarkHolder
  258. })
  259.  
  260. local inContact
  261. main.InputBegan:connect(function(input)
  262. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  263. option:SetState(not option.state)
  264. end
  265. if input.UserInputType == Enum.UserInputType.MouseMovement then
  266. inContact = true
  267. if not option.state then
  268. tweenService:Create(tickboxOutline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(140, 140, 140)}):Play()
  269. end
  270. end
  271. end)
  272.  
  273. main.InputEnded:connect(function(input)
  274. if input.UserInputType == Enum.UserInputType.MouseMovement then
  275. inContact = true
  276. if not option.state then
  277. tweenService:Create(tickboxOutline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
  278. end
  279. end
  280. end)
  281.  
  282. function option:SetState(state)
  283. library.flags[self.flag] = state
  284. self.state = state
  285. checkmarkHolder:TweenSize(option.state and UDim2.new(1, -8, 1, -8) or UDim2.new(0, 0, 1, -8), "Out", "Quad", 0.2, true)
  286. tweenService:Create(tickboxInner, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = state and Color3.fromRGB(255, 65, 65) or Color3.fromRGB(20, 20, 20)}):Play()
  287. if state then
  288. tweenService:Create(tickboxOutline, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
  289. else
  290. if inContact then
  291. tweenService:Create(tickboxOutline, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(140, 140, 140)}):Play()
  292. else
  293. tweenService:Create(tickboxOutline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
  294. end
  295. end
  296. self.callback(state)
  297. end
  298.  
  299. if option.state then
  300. delay(1, function() option.callback(true) end)
  301. end
  302.  
  303. setmetatable(option, {__newindex = function(t, i, v)
  304. if i == "Text" then
  305. main.Text = " " .. tostring(v)
  306. end
  307. end})
  308. end
  309.  
  310. function createButton(option, parent)
  311. local main = library:Create("TextLabel", {
  312. ZIndex = 2,
  313. LayoutOrder = option.position,
  314. Size = UDim2.new(1, 0, 0, 34),
  315. BackgroundTransparency = 1,
  316. Text = " " .. option.text,
  317. TextSize = 17,
  318. Font = Enum.Font.Gotham,
  319. TextColor3 = Color3.fromRGB(255, 255, 255),
  320. Parent = parent.content
  321. })
  322.  
  323. local round = library:Create("ImageLabel", {
  324. AnchorPoint = Vector2.new(0.5, 0.5),
  325. Position = UDim2.new(0.5, 0, 0.5, 0),
  326. Size = UDim2.new(1, -12, 1, -10),
  327. BackgroundTransparency = 1,
  328. Image = "rbxassetid://3570695787",
  329. ImageColor3 = Color3.fromRGB(40, 40, 40),
  330. ScaleType = Enum.ScaleType.Slice,
  331. SliceCenter = Rect.new(100, 100, 100, 100),
  332. SliceScale = 0.02,
  333. Parent = main
  334. })
  335.  
  336. local inContact
  337. local clicking
  338. main.InputBegan:connect(function(input)
  339. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  340. library.flags[option.flag] = true
  341. clicking = true
  342. tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
  343. option.callback()
  344. end
  345. if input.UserInputType == Enum.UserInputType.MouseMovement then
  346. inContact = true
  347. tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  348. end
  349. end)
  350.  
  351. main.InputEnded:connect(function(input)
  352. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  353. clicking = false
  354. if inContact then
  355. tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  356. else
  357. tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(40, 40, 40)}):Play()
  358. end
  359. end
  360. if input.UserInputType == Enum.UserInputType.MouseMovement then
  361. inContact = false
  362. if not clicking then
  363. tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(40, 40, 40)}):Play()
  364. end
  365. end
  366. end)
  367. end
  368.  
  369. local function createBind(option, parent)
  370. local binding
  371. local holding
  372. local loop
  373. local text = string.match(option.key, "Mouse") and string.sub(option.key, 1, 5) .. string.sub(option.key, 12, 13) or option.key
  374.  
  375. local main = library:Create("TextLabel", {
  376. LayoutOrder = option.position,
  377. Size = UDim2.new(1, 0, 0, 33),
  378. BackgroundTransparency = 1,
  379. Text = " " .. option.text,
  380. TextSize = 17,
  381. Font = Enum.Font.Gotham,
  382. TextColor3 = Color3.fromRGB(255, 255, 255),
  383. TextXAlignment = Enum.TextXAlignment.Left,
  384. Parent = parent.content
  385. })
  386.  
  387. local round = library:Create("ImageLabel", {
  388. Position = UDim2.new(1, -6, 0, 4),
  389. Size = UDim2.new(0, -textService:GetTextSize(text, 16, Enum.Font.Gotham, Vector2.new(9e9, 9e9)).X - 16, 1, -10),
  390. SizeConstraint = Enum.SizeConstraint.RelativeYY,
  391. BackgroundTransparency = 1,
  392. Image = "rbxassetid://3570695787",
  393. ImageColor3 = Color3.fromRGB(40, 40, 40),
  394. ScaleType = Enum.ScaleType.Slice,
  395. SliceCenter = Rect.new(100, 100, 100, 100),
  396. SliceScale = 0.02,
  397. Parent = main
  398. })
  399.  
  400. local bindinput = library:Create("TextLabel", {
  401. Size = UDim2.new(1, 0, 1, 0),
  402. BackgroundTransparency = 1,
  403. Text = text,
  404. TextSize = 16,
  405. Font = Enum.Font.Gotham,
  406. TextColor3 = Color3.fromRGB(255, 255, 255),
  407. Parent = round
  408. })
  409.  
  410. local inContact
  411. main.InputBegan:connect(function(input)
  412. if input.UserInputType == Enum.UserInputType.MouseMovement then
  413. inContact = true
  414. if not binding then
  415. tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  416. end
  417. end
  418. end)
  419.  
  420. main.InputEnded:connect(function(input)
  421. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  422. binding = true
  423. bindinput.Text = "..."
  424. tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
  425. end
  426. if input.UserInputType == Enum.UserInputType.MouseMovement then
  427. inContact = false
  428. if not binding then
  429. tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(40, 40, 40)}):Play()
  430. end
  431. end
  432. end)
  433.  
  434. inputService.InputBegan:connect(function(input)
  435. if inputService:GetFocusedTextBox() then return end
  436. if (input.KeyCode.Name == option.key or input.UserInputType.Name == option.key) and not binding then
  437. if option.hold then
  438. loop = runService.Heartbeat:connect(function()
  439. if binding then
  440. option.callback(true)
  441. loop:Disconnect()
  442. loop = nil
  443. else
  444. option.callback()
  445. end
  446. end)
  447. else
  448. option.callback()
  449. end
  450. elseif binding then
  451. local key
  452. pcall(function()
  453. if not keyCheck(input.KeyCode, blacklistedKeys) then
  454. key = input.KeyCode
  455. end
  456. end)
  457. pcall(function()
  458. if keyCheck(input.UserInputType, whitelistedMouseinputs) and not key then
  459. key = input.UserInputType
  460. end
  461. end)
  462. key = key or option.key
  463. option:SetKey(key)
  464. end
  465. end)
  466.  
  467. inputService.InputEnded:connect(function(input)
  468. if input.KeyCode.Name == option.key or input.UserInputType.Name == option.key or input.UserInputType.Name == "MouseMovement" then
  469. if loop then
  470. loop:Disconnect()
  471. loop = nil
  472. option.callback(true)
  473. end
  474. end
  475. end)
  476.  
  477. function option:SetKey(key)
  478. binding = false
  479. if loop then
  480. loop:Disconnect()
  481. loop = nil
  482. end
  483. self.key = key or self.key
  484. self.key = self.key.Name or self.key
  485. library.flags[self.flag] = self.key
  486. if string.match(self.key, "Mouse") then
  487. bindinput.Text = string.sub(self.key, 1, 5) .. string.sub(self.key, 12, 13)
  488. else
  489. bindinput.Text = self.key
  490. end
  491. tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = inContact and Color3.fromRGB(60, 60, 60) or Color3.fromRGB(40, 40, 40)}):Play()
  492. round.Size = UDim2.new(0, -textService:GetTextSize(bindinput.Text, 15, Enum.Font.Gotham, Vector2.new(9e9, 9e9)).X - 16, 1, -10)
  493. end
  494. end
  495.  
  496. local function createSlider(option, parent)
  497. local main = library:Create("Frame", {
  498. LayoutOrder = option.position,
  499. Size = UDim2.new(1, 0, 0, 50),
  500. BackgroundTransparency = 1,
  501. Parent = parent.content
  502. })
  503.  
  504. local title = library:Create("TextLabel", {
  505. Position = UDim2.new(0, 0, 0, 4),
  506. Size = UDim2.new(1, 0, 0, 20),
  507. BackgroundTransparency = 1,
  508. Text = " " .. option.text,
  509. TextSize = 17,
  510. Font = Enum.Font.Gotham,
  511. TextColor3 = Color3.fromRGB(255, 255, 255),
  512. TextXAlignment = Enum.TextXAlignment.Left,
  513. Parent = main
  514. })
  515.  
  516. local slider = library:Create("ImageLabel", {
  517. Position = UDim2.new(0, 10, 0, 34),
  518. Size = UDim2.new(1, -20, 0, 5),
  519. BackgroundTransparency = 1,
  520. Image = "rbxassetid://3570695787",
  521. ImageColor3 = Color3.fromRGB(30, 30, 30),
  522. ScaleType = Enum.ScaleType.Slice,
  523. SliceCenter = Rect.new(100, 100, 100, 100),
  524. SliceScale = 0.02,
  525. Parent = main
  526. })
  527.  
  528. local fill = library:Create("ImageLabel", {
  529. BackgroundTransparency = 1,
  530. Image = "rbxassetid://3570695787",
  531. ImageColor3 = Color3.fromRGB(60, 60, 60),
  532. ScaleType = Enum.ScaleType.Slice,
  533. SliceCenter = Rect.new(100, 100, 100, 100),
  534. SliceScale = 0.02,
  535. Parent = slider
  536. })
  537.  
  538. local circle = library:Create("ImageLabel", {
  539. AnchorPoint = Vector2.new(0.5, 0.5),
  540. Position = UDim2.new((option.value - option.min) / (option.max - option.min), 0, 0.5, 0),
  541. SizeConstraint = Enum.SizeConstraint.RelativeYY,
  542. BackgroundTransparency = 1,
  543. Image = "rbxassetid://3570695787",
  544. ImageColor3 = Color3.fromRGB(60, 60, 60),
  545. ScaleType = Enum.ScaleType.Slice,
  546. SliceCenter = Rect.new(100, 100, 100, 100),
  547. SliceScale = 1,
  548. Parent = slider
  549. })
  550.  
  551. local valueRound = library:Create("ImageLabel", {
  552. Position = UDim2.new(1, -6, 0, 4),
  553. Size = UDim2.new(0, -60, 0, 18),
  554. BackgroundTransparency = 1,
  555. Image = "rbxassetid://3570695787",
  556. ImageColor3 = Color3.fromRGB(40, 40, 40),
  557. ScaleType = Enum.ScaleType.Slice,
  558. SliceCenter = Rect.new(100, 100, 100, 100),
  559. SliceScale = 0.02,
  560. Parent = main
  561. })
  562.  
  563. local inputvalue = library:Create("TextBox", {
  564. Size = UDim2.new(1, 0, 1, 0),
  565. BackgroundTransparency = 1,
  566. Text = option.value,
  567. TextColor3 = Color3.fromRGB(235, 235, 235),
  568. TextSize = 15,
  569. TextWrapped = true,
  570. Font = Enum.Font.Gotham,
  571. Parent = valueRound
  572. })
  573.  
  574. if option.min >= 0 then
  575. fill.Size = UDim2.new((option.value - option.min) / (option.max - option.min), 0, 1, 0)
  576. else
  577. fill.Position = UDim2.new((0 - option.min) / (option.max - option.min), 0, 0, 0)
  578. fill.Size = UDim2.new(option.value / (option.max - option.min), 0, 1, 0)
  579. end
  580.  
  581. local sliding
  582. local inContact
  583. main.InputBegan:connect(function(input)
  584. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  585. tweenService:Create(fill, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
  586. tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(3.5, 0, 3.5, 0), ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
  587. sliding = true
  588. option:SetValue(option.min + ((input.Position.X - slider.AbsolutePosition.X) / slider.AbsoluteSize.X) * (option.max - option.min))
  589. end
  590. if input.UserInputType == Enum.UserInputType.MouseMovement then
  591. inContact = true
  592. if not sliding then
  593. tweenService:Create(fill, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
  594. tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(2.8, 0, 2.8, 0), ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
  595. end
  596. end
  597. end)
  598.  
  599. inputService.InputChanged:connect(function(input)
  600. if input.UserInputType == Enum.UserInputType.MouseMovement and sliding then
  601. option:SetValue(option.min + ((input.Position.X - slider.AbsolutePosition.X) / slider.AbsoluteSize.X) * (option.max - option.min))
  602. end
  603. end)
  604.  
  605. main.InputEnded:connect(function(input)
  606. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  607. sliding = false
  608. if inContact then
  609. tweenService:Create(fill, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
  610. tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(2.8, 0, 2.8, 0), ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
  611. else
  612. tweenService:Create(fill, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  613. tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, 0), ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  614. end
  615. end
  616. if input.UserInputType == Enum.UserInputType.MouseMovement then
  617. inContact = false
  618. inputvalue:ReleaseFocus()
  619. if not sliding then
  620. tweenService:Create(fill, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  621. tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, 0), ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  622. end
  623. end
  624. end)
  625.  
  626. inputvalue.FocusLost:connect(function()
  627. tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, 0), ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  628. option:SetValue(tonumber(inputvalue.Text) or option.value)
  629. end)
  630.  
  631. function option:SetValue(value)
  632. value = round(value, option.float)
  633. value = math.clamp(value, self.min, self.max)
  634. circle:TweenPosition(UDim2.new((value - self.min) / (self.max - self.min), 0, 0.5, 0), "Out", "Quad", 0.1, true)
  635. if self.min >= 0 then
  636. fill:TweenSize(UDim2.new((value - self.min) / (self.max - self.min), 0, 1, 0), "Out", "Quad", 0.1, true)
  637. else
  638. fill:TweenPosition(UDim2.new((0 - self.min) / (self.max - self.min), 0, 0, 0), "Out", "Quad", 0.1, true)
  639. fill:TweenSize(UDim2.new(value / (self.max - self.min), 0, 1, 0), "Out", "Quad", 0.1, true)
  640. end
  641. library.flags[self.flag] = value
  642. self.value = value
  643. inputvalue.Text = value
  644. self.callback(value)
  645. end
  646. end
  647.  
  648. local function createList(option, parent, holder)
  649. local valueCount = 0
  650.  
  651. local main = library:Create("Frame", {
  652. LayoutOrder = option.position,
  653. Size = UDim2.new(1, 0, 0, 52),
  654. BackgroundTransparency = 1,
  655. Parent = parent.content
  656. })
  657.  
  658. local round = library:Create("ImageLabel", {
  659. Position = UDim2.new(0, 6, 0, 4),
  660. Size = UDim2.new(1, -12, 1, -10),
  661. BackgroundTransparency = 1,
  662. Image = "rbxassetid://3570695787",
  663. ImageColor3 = Color3.fromRGB(40, 40, 40),
  664. ScaleType = Enum.ScaleType.Slice,
  665. SliceCenter = Rect.new(100, 100, 100, 100),
  666. SliceScale = 0.02,
  667. Parent = main
  668. })
  669.  
  670. local title = library:Create("TextLabel", {
  671. Position = UDim2.new(0, 12, 0, 8),
  672. Size = UDim2.new(1, -24, 0, 14),
  673. BackgroundTransparency = 1,
  674. Text = option.text,
  675. TextSize = 14,
  676. Font = Enum.Font.GothamBold,
  677. TextColor3 = Color3.fromRGB(140, 140, 140),
  678. TextXAlignment = Enum.TextXAlignment.Left,
  679. Parent = main
  680. })
  681.  
  682. local listvalue = library:Create("TextLabel", {
  683. Position = UDim2.new(0, 12, 0, 20),
  684. Size = UDim2.new(1, -24, 0, 24),
  685. BackgroundTransparency = 1,
  686. Text = option.value,
  687. TextSize = 18,
  688. Font = Enum.Font.Gotham,
  689. TextColor3 = Color3.fromRGB(255, 255, 255),
  690. TextXAlignment = Enum.TextXAlignment.Left,
  691. Parent = main
  692. })
  693.  
  694. library:Create("ImageLabel", {
  695. Position = UDim2.new(1, -16, 0, 16),
  696. Size = UDim2.new(-1, 32, 1, -32),
  697. SizeConstraint = Enum.SizeConstraint.RelativeYY,
  698. Rotation = 90,
  699. BackgroundTransparency = 1,
  700. Image = "rbxassetid://4918373417",
  701. ImageColor3 = Color3.fromRGB(140, 140, 140),
  702. ScaleType = Enum.ScaleType.Fit,
  703. Parent = round
  704. })
  705.  
  706. option.mainHolder = library:Create("ImageButton", {
  707. ZIndex = 3,
  708. Size = UDim2.new(0, 240, 0, 52),
  709. BackgroundTransparency = 1,
  710. Image = "rbxassetid://3570695787",
  711. ImageTransparency = 1,
  712. ImageColor3 = Color3.fromRGB(30, 30, 30),
  713. ScaleType = Enum.ScaleType.Slice,
  714. SliceCenter = Rect.new(100, 100, 100, 100),
  715. SliceScale = 0.02,
  716. Visible = false,
  717. Parent = library.base
  718. })
  719.  
  720. local content = library:Create("ScrollingFrame", {
  721. ZIndex = 3,
  722. Size = UDim2.new(1, 0, 1, 0),
  723. BackgroundTransparency = 1,
  724. BorderSizePixel = 0,
  725. ScrollBarImageColor3 = Color3.fromRGB(),
  726. ScrollBarThickness = 0,
  727. ScrollingDirection = Enum.ScrollingDirection.Y,
  728. Parent = option.mainHolder
  729. })
  730.  
  731. library:Create("UIPadding", {
  732. PaddingTop = UDim.new(0, 6),
  733. Parent = content
  734. })
  735.  
  736. local layout = library:Create("UIListLayout", {
  737. Parent = content
  738. })
  739.  
  740. layout.Changed:connect(function()
  741. option.mainHolder.Size = UDim2.new(0, 240, 0, (valueCount > 4 and (4 * 40) or layout.AbsoluteContentSize.Y) + 12)
  742. content.CanvasSize = UDim2.new(0, 0, 0, layout.AbsoluteContentSize.Y + 12)
  743. end)
  744.  
  745. local inContact
  746. round.InputBegan:connect(function(input)
  747. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  748. if library.activePopup then
  749. library.activePopup:Close()
  750. end
  751. local position = main.AbsolutePosition
  752. option.mainHolder.Position = UDim2.new(0, position.X - 5, 0, position.Y - 10)
  753. option.open = true
  754. option.mainHolder.Visible = true
  755. library.activePopup = option
  756. content.ScrollBarThickness = 6
  757. tweenService:Create(option.mainHolder, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {ImageTransparency = 0, Position = UDim2.new(0, position.X - 5, 0, position.Y - 4)}):Play()
  758. tweenService:Create(option.mainHolder, TweenInfo.new(0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0.1), {Position = UDim2.new(0, position.X - 5, 0, position.Y + 1)}):Play()
  759. for _,label in next, content:GetChildren() do
  760. if label:IsA"TextLabel" then
  761. tweenService:Create(label, TweenInfo.new(0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundTransparency = 0, TextTransparency = 0}):Play()
  762. end
  763. end
  764. end
  765. if input.UserInputType == Enum.UserInputType.MouseMovement then
  766. inContact = true
  767. if not option.open then
  768. tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  769. end
  770. end
  771. end)
  772.  
  773. round.InputEnded:connect(function(input)
  774. if input.UserInputType == Enum.UserInputType.MouseMovement then
  775. inContact = false
  776. if not option.open then
  777. tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(40, 40, 40)}):Play()
  778. end
  779. end
  780. end)
  781.  
  782. function option:AddValue(value)
  783. valueCount = valueCount + 1
  784. local label = library:Create("TextLabel", {
  785. ZIndex = 3,
  786. Size = UDim2.new(1, 0, 0, 40),
  787. BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  788. BorderSizePixel = 0,
  789. Text = " " .. value,
  790. TextSize = 14,
  791. TextTransparency = self.open and 0 or 1,
  792. Font = Enum.Font.Gotham,
  793. TextColor3 = Color3.fromRGB(255, 255, 255),
  794. TextXAlignment = Enum.TextXAlignment.Left,
  795. Parent = content
  796. })
  797.  
  798. local inContact
  799. local clicking
  800. label.InputBegan:connect(function(input)
  801. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  802. clicking = true
  803. tweenService:Create(label, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(10, 10, 10)}):Play()
  804. self:SetValue(value)
  805. end
  806. if input.UserInputType == Enum.UserInputType.MouseMovement then
  807. inContact = true
  808. if not clicking then
  809. tweenService:Create(label, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(20, 20, 20)}):Play()
  810. end
  811. end
  812. end)
  813.  
  814. label.InputEnded:connect(function(input)
  815. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  816. clicking = false
  817. tweenService:Create(label, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = inContact and Color3.fromRGB(20, 20, 20) or Color3.fromRGB(30, 30, 30)}):Play()
  818. end
  819. if input.UserInputType == Enum.UserInputType.MouseMovement then
  820. inContact = false
  821. if not clicking then
  822. tweenService:Create(label, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(30, 30, 30)}):Play()
  823. end
  824. end
  825. end)
  826. end
  827.  
  828. if not table.find(option.values, option.value) then
  829. option:AddValue(option.value)
  830. end
  831.  
  832. for _, value in next, option.values do
  833. option:AddValue(tostring(value))
  834. end
  835.  
  836. function option:RemoveValue(value)
  837. for _,label in next, content:GetChildren() do
  838. if label:IsA"TextLabel" and label.Text == " " .. value then
  839. label:Destroy()
  840. valueCount = valueCount - 1
  841. break
  842. end
  843. end
  844. if self.value == value then
  845. self:SetValue("")
  846. end
  847. end
  848.  
  849. function option:SetValue(value)
  850. library.flags[self.flag] = tostring(value)
  851. self.value = tostring(value)
  852. listvalue.Text = self.value
  853. self.callback(value)
  854. end
  855.  
  856. function option:Close()
  857. library.activePopup = nil
  858. self.open = false
  859. content.ScrollBarThickness = 0
  860. local position = main.AbsolutePosition
  861. tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = inContact and Color3.fromRGB(60, 60, 60) or Color3.fromRGB(40, 40, 40)}):Play()
  862. tweenService:Create(self.mainHolder, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageTransparency = 1, Position = UDim2.new(0, position.X - 5, 0, position.Y -10)}):Play()
  863. for _,label in next, content:GetChildren() do
  864. if label:IsA"TextLabel" then
  865. tweenService:Create(label, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundTransparency = 1, TextTransparency = 1}):Play()
  866. end
  867. end
  868. wait(0.3)
  869. --delay(0.3, function()
  870. if not self.open then
  871. self.mainHolder.Visible = false
  872. end
  873. --end)
  874. end
  875.  
  876. return option
  877. end
  878.  
  879. local function createBox(option, parent)
  880. local main = library:Create("Frame", {
  881. LayoutOrder = option.position,
  882. Size = UDim2.new(1, 0, 0, 52),
  883. BackgroundTransparency = 1,
  884. Parent = parent.content
  885. })
  886.  
  887. local outline = library:Create("ImageLabel", {
  888. Position = UDim2.new(0, 6, 0, 4),
  889. Size = UDim2.new(1, -12, 1, -10),
  890. BackgroundTransparency = 1,
  891. Image = "rbxassetid://3570695787",
  892. ImageColor3 = Color3.fromRGB(60, 60, 60),
  893. ScaleType = Enum.ScaleType.Slice,
  894. SliceCenter = Rect.new(100, 100, 100, 100),
  895. SliceScale = 0.02,
  896. Parent = main
  897. })
  898.  
  899. local round = library:Create("ImageLabel", {
  900. Position = UDim2.new(0, 8, 0, 6),
  901. Size = UDim2.new(1, -16, 1, -14),
  902. BackgroundTransparency = 1,
  903. Image = "rbxassetid://3570695787",
  904. ImageColor3 = Color3.fromRGB(20, 20, 20),
  905. ScaleType = Enum.ScaleType.Slice,
  906. SliceCenter = Rect.new(100, 100, 100, 100),
  907. SliceScale = 0.01,
  908. Parent = main
  909. })
  910.  
  911. local title = library:Create("TextLabel", {
  912. Position = UDim2.new(0, 12, 0, 8),
  913. Size = UDim2.new(1, -24, 0, 14),
  914. BackgroundTransparency = 1,
  915. Text = option.text,
  916. TextSize = 14,
  917. Font = Enum.Font.GothamBold,
  918. TextColor3 = Color3.fromRGB(100, 100, 100),
  919. TextXAlignment = Enum.TextXAlignment.Left,
  920. Parent = main
  921. })
  922.  
  923. local inputvalue = library:Create("TextBox", {
  924. Position = UDim2.new(0, 12, 0, 20),
  925. Size = UDim2.new(1, -24, 0, 24),
  926. BackgroundTransparency = 1,
  927. Text = option.value,
  928. TextSize = 18,
  929. Font = Enum.Font.Gotham,
  930. TextColor3 = Color3.fromRGB(255, 255, 255),
  931. TextXAlignment = Enum.TextXAlignment.Left,
  932. TextWrapped = true,
  933. Parent = main
  934. })
  935.  
  936. local inContact
  937. local focused
  938. main.InputBegan:connect(function(input)
  939. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  940. if not focused then inputvalue:CaptureFocus() end
  941. end
  942. if input.UserInputType == Enum.UserInputType.MouseMovement then
  943. inContact = true
  944. if not focused then
  945. tweenService:Create(outline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
  946. end
  947. end
  948. end)
  949.  
  950. main.InputEnded:connect(function(input)
  951. if input.UserInputType == Enum.UserInputType.MouseMovement then
  952. inContact = false
  953. if not focused then
  954. tweenService:Create(outline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  955. end
  956. end
  957. end)
  958.  
  959. inputvalue.Focused:connect(function()
  960. focused = true
  961. tweenService:Create(outline, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
  962. end)
  963.  
  964. inputvalue.FocusLost:connect(function(enter)
  965. focused = false
  966. tweenService:Create(outline, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
  967. option:SetValue(inputvalue.Text, enter)
  968. end)
  969.  
  970. function option:SetValue(value, enter)
  971. library.flags[self.flag] = tostring(value)
  972. self.value = tostring(value)
  973. inputvalue.Text = self.value
  974. self.callback(value, enter)
  975. end
  976. end
  977.  
  978. local function createColorPickerWindow(option)
  979. option.mainHolder = library:Create("ImageButton", {
  980. ZIndex = 3,
  981. Size = UDim2.new(0, 240, 0, 180),
  982. BackgroundTransparency = 1,
  983. Image = "rbxassetid://3570695787",
  984. ImageTransparency = 1,
  985. ImageColor3 = Color3.fromRGB(30, 30, 30),
  986. ScaleType = Enum.ScaleType.Slice,
  987. SliceCenter = Rect.new(100, 100, 100, 100),
  988. SliceScale = 0.02,
  989. Parent = library.base
  990. })
  991.  
  992. local hue, sat, val = Color3.toHSV(option.color)
  993. hue, sat, val = hue == 0 and 1 or hue, sat + 0.005, val - 0.005
  994. local editinghue
  995. local editingsatval
  996. local currentColor = option.color
  997. local previousColors = {[1] = option.color}
  998. local originalColor = option.color
  999. local rainbowEnabled
  1000. local rainbowLoop
  1001.  
  1002. function option:updateVisuals(Color)
  1003. currentColor = Color
  1004. self.visualize2.ImageColor3 = Color
  1005. hue, sat, val = Color3.toHSV(Color)
  1006. hue = hue == 0 and 1 or hue
  1007. self.satval.BackgroundColor3 = Color3.fromHSV(hue, 1, 1)
  1008. self.hueSlider.Position = UDim2.new(1 - hue, 0, 0, 0)
  1009. self.satvalSlider.Position = UDim2.new(sat, 0, 1 - val, 0)
  1010. end
  1011.  
  1012. option.hue = library:Create("ImageLabel", {
  1013. ZIndex = 3,
  1014. AnchorPoint = Vector2.new(0, 1),
  1015. Position = UDim2.new(0, 8, 1, -8),
  1016. Size = UDim2.new(1, -100, 0, 22),
  1017. BackgroundTransparency = 1,
  1018. Image = "rbxassetid://3570695787",
  1019. ImageTransparency = 1,
  1020. ScaleType = Enum.ScaleType.Slice,
  1021. SliceCenter = Rect.new(100, 100, 100, 100),
  1022. SliceScale = 0.02,
  1023. Parent = option.mainHolder
  1024. })
  1025.  
  1026. local Gradient = library:Create("UIGradient", {
  1027. Color = ColorSequence.new({
  1028. ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 0)),
  1029. ColorSequenceKeypoint.new(0.157, Color3.fromRGB(255, 0, 255)),
  1030. ColorSequenceKeypoint.new(0.323, Color3.fromRGB(0, 0, 255)),
  1031. ColorSequenceKeypoint.new(0.488, Color3.fromRGB(0, 255, 255)),
  1032. ColorSequenceKeypoint.new(0.66, Color3.fromRGB(0, 255, 0)),
  1033. ColorSequenceKeypoint.new(0.817, Color3.fromRGB(255, 255, 0)),
  1034. ColorSequenceKeypoint.new(1, Color3.fromRGB(255, 0, 0)),
  1035. }),
  1036. Parent = option.hue
  1037. })
  1038.  
  1039. option.hueSlider = library:Create("Frame", {
  1040. ZIndex = 3,
  1041. Position = UDim2.new(1 - hue, 0, 0, 0),
  1042. Size = UDim2.new(0, 2, 1, 0),
  1043. BackgroundTransparency = 1,
  1044. BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  1045. BorderColor3 = Color3.fromRGB(255, 255, 255),
  1046. Parent = option.hue
  1047. })
  1048.  
  1049. option.hue.InputBegan:connect(function(Input)
  1050. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1051. editinghue = true
  1052. X = (option.hue.AbsolutePosition.X + option.hue.AbsoluteSize.X) - option.hue.AbsolutePosition.X
  1053. X = (Input.Position.X - option.hue.AbsolutePosition.X) / X
  1054. X = X < 0 and 0 or X > 0.995 and 0.995 or X
  1055. option:updateVisuals(Color3.fromHSV(1 - X, sat, val))
  1056. end
  1057. end)
  1058.  
  1059. inputService.InputChanged:connect(function(Input)
  1060. if Input.UserInputType == Enum.UserInputType.MouseMovement and editinghue then
  1061. X = (option.hue.AbsolutePosition.X + option.hue.AbsoluteSize.X) - option.hue.AbsolutePosition.X
  1062. X = (Input.Position.X - option.hue.AbsolutePosition.X) / X
  1063. X = X <= 0 and 0 or X >= 0.995 and 0.995 or X
  1064. option:updateVisuals(Color3.fromHSV(1 - X, sat, val))
  1065. end
  1066. end)
  1067.  
  1068. option.hue.InputEnded:connect(function(Input)
  1069. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1070. editinghue = false
  1071. end
  1072. end)
  1073.  
  1074. option.satval = library:Create("ImageLabel", {
  1075. ZIndex = 3,
  1076. Position = UDim2.new(0, 8, 0, 8),
  1077. Size = UDim2.new(1, -100, 1, -42),
  1078. BackgroundTransparency = 1,
  1079. BackgroundColor3 = Color3.fromHSV(hue, 1, 1),
  1080. BorderSizePixel = 0,
  1081. Image = "rbxassetid://4155801252",
  1082. ImageTransparency = 1,
  1083. ClipsDescendants = true,
  1084. Parent = option.mainHolder
  1085. })
  1086.  
  1087. option.satvalSlider = library:Create("Frame", {
  1088. ZIndex = 3,
  1089. AnchorPoint = Vector2.new(0.5, 0.5),
  1090. Position = UDim2.new(sat, 0, 1 - val, 0),
  1091. Size = UDim2.new(0, 4, 0, 4),
  1092. Rotation = 45,
  1093. BackgroundTransparency = 1,
  1094. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1095. Parent = option.satval
  1096. })
  1097.  
  1098. option.satval.InputBegan:connect(function(Input)
  1099. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1100. editingsatval = true
  1101. X = (option.satval.AbsolutePosition.X + option.satval.AbsoluteSize.X) - option.satval.AbsolutePosition.X
  1102. Y = (option.satval.AbsolutePosition.Y + option.satval.AbsoluteSize.Y) - option.satval.AbsolutePosition.Y
  1103. X = (Input.Position.X - option.satval.AbsolutePosition.X) / X
  1104. Y = (Input.Position.Y - option.satval.AbsolutePosition.Y) / Y
  1105. X = X <= 0.005 and 0.005 or X >= 1 and 1 or X
  1106. Y = Y <= 0 and 0 or Y >= 0.995 and 0.995 or Y
  1107. option:updateVisuals(Color3.fromHSV(hue, X, 1 - Y))
  1108. end
  1109. end)
  1110.  
  1111. inputService.InputChanged:connect(function(Input)
  1112. if Input.UserInputType == Enum.UserInputType.MouseMovement and editingsatval then
  1113. X = (option.satval.AbsolutePosition.X + option.satval.AbsoluteSize.X) - option.satval.AbsolutePosition.X
  1114. Y = (option.satval.AbsolutePosition.Y + option.satval.AbsoluteSize.Y) - option.satval.AbsolutePosition.Y
  1115. X = (Input.Position.X - option.satval.AbsolutePosition.X) / X
  1116. Y = (Input.Position.Y - option.satval.AbsolutePosition.Y) / Y
  1117. X = X <= 0.005 and 0.005 or X >= 1 and 1 or X
  1118. Y = Y <= 0 and 0 or Y >= 0.995 and 0.995 or Y
  1119. option:updateVisuals(Color3.fromHSV(hue, X, 1 - Y))
  1120. end
  1121. end)
  1122.  
  1123. option.satval.InputEnded:connect(function(Input)
  1124. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1125. editingsatval = false
  1126. end
  1127. end)
  1128.  
  1129. option.visualize2 = library:Create("ImageLabel", {
  1130. ZIndex = 3,
  1131. Position = UDim2.new(1, -8, 0, 8),
  1132. Size = UDim2.new(0, -80, 0, 80),
  1133. BackgroundTransparency = 1,
  1134. Image = "rbxassetid://3570695787",
  1135. ImageColor3 = currentColor,
  1136. ScaleType = Enum.ScaleType.Slice,
  1137. SliceCenter = Rect.new(100, 100, 100, 100),
  1138. SliceScale = 0.02,
  1139. Parent = option.mainHolder
  1140. })
  1141.  
  1142. option.resetColor = library:Create("ImageLabel", {
  1143. ZIndex = 3,
  1144. Position = UDim2.new(1, -8, 0, 92),
  1145. Size = UDim2.new(0, -80, 0, 18),
  1146. BackgroundTransparency = 1,
  1147. Image = "rbxassetid://3570695787",
  1148. ImageTransparency = 1,
  1149. ImageColor3 = Color3.fromRGB(20, 20, 20),
  1150. ScaleType = Enum.ScaleType.Slice,
  1151. SliceCenter = Rect.new(100, 100, 100, 100),
  1152. SliceScale = 0.02,
  1153. Parent = option.mainHolder
  1154. })
  1155.  
  1156. option.resetText = library:Create("TextLabel", {
  1157. ZIndex = 3,
  1158. Size = UDim2.new(1, 0, 1, 0),
  1159. BackgroundTransparency = 1,
  1160. Text = "Reset",
  1161. TextTransparency = 1,
  1162. Font = Enum.Font.Code,
  1163. TextSize = 15,
  1164. TextColor3 = Color3.fromRGB(255, 255, 255),
  1165. Parent = option.resetColor
  1166. })
  1167.  
  1168. option.resetColor.InputBegan:connect(function(Input)
  1169. if Input.UserInputType == Enum.UserInputType.MouseButton1 and not rainbowEnabled then
  1170. previousColors = {originalColor}
  1171. option:SetColor(originalColor)
  1172. end
  1173. if Input.UserInputType == Enum.UserInputType.MouseMovement and not dragging then
  1174. tweenService:Create(option.resetColor, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(10, 10, 10)}):Play()
  1175. end
  1176. end)
  1177.  
  1178. option.resetColor.InputEnded:connect(function(Input)
  1179. if Input.UserInputType == Enum.UserInputType.MouseMovement and not dragging then
  1180. tweenService:Create(option.resetColor, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(20, 20, 20)}):Play()
  1181. end
  1182. end)
  1183.  
  1184. option.undoColor = library:Create("ImageLabel", {
  1185. ZIndex = 3,
  1186. Position = UDim2.new(1, -8, 0, 112),
  1187. Size = UDim2.new(0, -80, 0, 18),
  1188. BackgroundTransparency = 1,
  1189. Image = "rbxassetid://3570695787",
  1190. ImageTransparency = 1,
  1191. ImageColor3 = Color3.fromRGB(20, 20, 20),
  1192. ScaleType = Enum.ScaleType.Slice,
  1193. SliceCenter = Rect.new(100, 100, 100, 100),
  1194. SliceScale = 0.02,
  1195. Parent = option.mainHolder
  1196. })
  1197.  
  1198. option.undoText = library:Create("TextLabel", {
  1199. ZIndex = 3,
  1200. Size = UDim2.new(1, 0, 1, 0),
  1201. BackgroundTransparency = 1,
  1202. Text = "Undo",
  1203. TextTransparency = 1,
  1204. Font = Enum.Font.Code,
  1205. TextSize = 15,
  1206. TextColor3 = Color3.fromRGB(255, 255, 255),
  1207. Parent = option.undoColor
  1208. })
  1209.  
  1210. option.undoColor.InputBegan:connect(function(Input)
  1211. if Input.UserInputType == Enum.UserInputType.MouseButton1 and not rainbowEnabled then
  1212. local Num = #previousColors == 1 and 0 or 1
  1213. option:SetColor(previousColors[#previousColors - Num])
  1214. if #previousColors ~= 1 then
  1215. table.remove(previousColors, #previousColors)
  1216. end
  1217. end
  1218. if Input.UserInputType == Enum.UserInputType.MouseMovement and not dragging then
  1219. tweenService:Create(option.undoColor, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(10, 10, 10)}):Play()
  1220. end
  1221. end)
  1222.  
  1223. option.undoColor.InputEnded:connect(function(Input)
  1224. if Input.UserInputType == Enum.UserInputType.MouseMovement and not dragging then
  1225. tweenService:Create(option.undoColor, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(20, 20, 20)}):Play()
  1226. end
  1227. end)
  1228.  
  1229. option.setColor = library:Create("ImageLabel", {
  1230. ZIndex = 3,
  1231. Position = UDim2.new(1, -8, 0, 132),
  1232. Size = UDim2.new(0, -80, 0, 18),
  1233. BackgroundTransparency = 1,
  1234. Image = "rbxassetid://3570695787",
  1235. ImageTransparency = 1,
  1236. ImageColor3 = Color3.fromRGB(20, 20, 20),
  1237. ScaleType = Enum.ScaleType.Slice,
  1238. SliceCenter = Rect.new(100, 100, 100, 100),
  1239. SliceScale = 0.02,
  1240. Parent = option.mainHolder
  1241. })
  1242.  
  1243. option.setText = library:Create("TextLabel", {
  1244. ZIndex = 3,
  1245. Size = UDim2.new(1, 0, 1, 0),
  1246. BackgroundTransparency = 1,
  1247. Text = "Set",
  1248. TextTransparency = 1,
  1249. Font = Enum.Font.Code,
  1250. TextSize = 15,
  1251. TextColor3 = Color3.fromRGB(255, 255, 255),
  1252. Parent = option.setColor
  1253. })
  1254.  
  1255. option.setColor.InputBegan:connect(function(Input)
  1256. if Input.UserInputType == Enum.UserInputType.MouseButton1 and not rainbowEnabled then
  1257. table.insert(previousColors, currentColor)
  1258. option:SetColor(currentColor)
  1259. end
  1260. if Input.UserInputType == Enum.UserInputType.MouseMovement and not dragging then
  1261. tweenService:Create(option.setColor, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(10, 10, 10)}):Play()
  1262. end
  1263. end)
  1264.  
  1265. option.setColor.InputEnded:connect(function(Input)
  1266. if Input.UserInputType == Enum.UserInputType.MouseMovement and not dragging then
  1267. tweenService:Create(option.setColor, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(20, 20, 20)}):Play()
  1268. end
  1269. end)
  1270.  
  1271. option.rainbow = library:Create("ImageLabel", {
  1272. ZIndex = 3,
  1273. Position = UDim2.new(1, -8, 0, 152),
  1274. Size = UDim2.new(0, -80, 0, 18),
  1275. BackgroundTransparency = 1,
  1276. Image = "rbxassetid://3570695787",
  1277. ImageTransparency = 1,
  1278. ImageColor3 = Color3.fromRGB(20, 20, 20),
  1279. ScaleType = Enum.ScaleType.Slice,
  1280. SliceCenter = Rect.new(100, 100, 100, 100),
  1281. SliceScale = 0.02,
  1282. Parent = option.mainHolder
  1283. })
  1284.  
  1285. option.rainbowText = library:Create("TextLabel", {
  1286. ZIndex = 3,
  1287. Size = UDim2.new(1, 0, 1, 0),
  1288. BackgroundTransparency = 1,
  1289. Text = "Rainbow",
  1290. TextTransparency = 1,
  1291. Font = Enum.Font.Code,
  1292. TextSize = 15,
  1293. TextColor3 = Color3.fromRGB(255, 255, 255),
  1294. Parent = option.rainbow
  1295. })
  1296.  
  1297. option.rainbow.InputBegan:connect(function(Input)
  1298. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1299. rainbowEnabled = not rainbowEnabled
  1300. if rainbowEnabled then
  1301. rainbowLoop = runService.Heartbeat:connect(function()
  1302. option:SetColor(chromaColor)
  1303. option.rainbowText.TextColor3 = chromaColor
  1304. end)
  1305. else
  1306. rainbowLoop:Disconnect()
  1307. option:SetColor(previousColors[#previousColors])
  1308. option.rainbowText.TextColor3 = Color3.fromRGB(255, 255, 255)
  1309. end
  1310. end
  1311. if Input.UserInputType == Enum.UserInputType.MouseMovement and not dragging then
  1312. tweenService:Create(option.rainbow, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(10, 10, 10)}):Play()
  1313. end
  1314. end)
  1315.  
  1316. option.rainbow.InputEnded:connect(function(Input)
  1317. if Input.UserInputType == Enum.UserInputType.MouseMovement and not dragging then
  1318. tweenService:Create(option.rainbow, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(20, 20, 20)}):Play()
  1319. end
  1320. end)
  1321.  
  1322. return option
  1323. end
  1324.  
  1325. local function createColor(option, parent, holder)
  1326. option.main = library:Create("TextLabel", {
  1327. LayoutOrder = option.position,
  1328. Size = UDim2.new(1, 0, 0, 31),
  1329. BackgroundTransparency = 1,
  1330. Text = " " .. option.text,
  1331. TextSize = 17,
  1332. Font = Enum.Font.Gotham,
  1333. TextColor3 = Color3.fromRGB(255, 255, 255),
  1334. TextXAlignment = Enum.TextXAlignment.Left,
  1335. Parent = parent.content
  1336. })
  1337.  
  1338. local colorBoxOutline = library:Create("ImageLabel", {
  1339. Position = UDim2.new(1, -6, 0, 4),
  1340. Size = UDim2.new(-1, 10, 1, -10),
  1341. SizeConstraint = Enum.SizeConstraint.RelativeYY,
  1342. BackgroundTransparency = 1,
  1343. Image = "rbxassetid://3570695787",
  1344. ImageColor3 = Color3.fromRGB(100, 100, 100),
  1345. ScaleType = Enum.ScaleType.Slice,
  1346. SliceCenter = Rect.new(100, 100, 100, 100),
  1347. SliceScale = 0.02,
  1348. Parent = option.main
  1349. })
  1350.  
  1351. option.visualize = library:Create("ImageLabel", {
  1352. Position = UDim2.new(0, 2, 0, 2),
  1353. Size = UDim2.new(1, -4, 1, -4),
  1354. BackgroundTransparency = 1,
  1355. Image = "rbxassetid://3570695787",
  1356. ImageColor3 = option.color,
  1357. ScaleType = Enum.ScaleType.Slice,
  1358. SliceCenter = Rect.new(100, 100, 100, 100),
  1359. SliceScale = 0.02,
  1360. Parent = colorBoxOutline
  1361. })
  1362.  
  1363. local inContact
  1364. option.main.InputBegan:connect(function(input)
  1365. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1366. if not option.mainHolder then createColorPickerWindow(option) end
  1367. if library.activePopup then
  1368. library.activePopup:Close()
  1369. end
  1370. local position = option.main.AbsolutePosition
  1371. option.mainHolder.Position = UDim2.new(0, position.X - 5, 0, position.Y - 10)
  1372. option.open = true
  1373. option.mainHolder.Visible = true
  1374. library.activePopup = option
  1375. tweenService:Create(option.mainHolder, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {ImageTransparency = 0, Position = UDim2.new(0, position.X - 5, 0, position.Y - 4)}):Play()
  1376. tweenService:Create(option.mainHolder, TweenInfo.new(0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0.1), {Position = UDim2.new(0, position.X - 5, 0, position.Y + 1)}):Play()
  1377. tweenService:Create(option.satval, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  1378. for _,object in next, option.mainHolder:GetDescendants() do
  1379. if object:IsA"TextLabel" then
  1380. tweenService:Create(object, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
  1381. elseif object:IsA"ImageLabel" then
  1382. tweenService:Create(object, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageTransparency = 0}):Play()
  1383. elseif object:IsA"Frame" then
  1384. tweenService:Create(object, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
  1385. end
  1386. end
  1387. end
  1388. if input.UserInputType == Enum.UserInputType.MouseMovement then
  1389. inContact = true
  1390. if not option.open then
  1391. tweenService:Create(colorBoxOutline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(140, 140, 140)}):Play()
  1392. end
  1393. end
  1394. end)
  1395.  
  1396. option.main.InputEnded:connect(function(input)
  1397. if input.UserInputType == Enum.UserInputType.MouseMovement then
  1398. inContact = true
  1399. if not option.open then
  1400. tweenService:Create(colorBoxOutline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
  1401. end
  1402. end
  1403. end)
  1404.  
  1405. function option:SetColor(newColor)
  1406. if self.mainHolder then
  1407. self:updateVisuals(newColor)
  1408. end
  1409. self.visualize.ImageColor3 = newColor
  1410. library.flags[self.flag] = newColor
  1411. self.color = newColor
  1412. self.callback(newColor)
  1413. end
  1414.  
  1415. function option:Close()
  1416. library.activePopup = nil
  1417. self.open = false
  1418. local position = self.main.AbsolutePosition
  1419. tweenService:Create(self.mainHolder, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageTransparency = 1, Position = UDim2.new(0, position.X - 5, 0, position.Y - 10)}):Play()
  1420. tweenService:Create(self.satval, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  1421. for _,object in next, self.mainHolder:GetDescendants() do
  1422. if object:IsA"TextLabel" then
  1423. tweenService:Create(object, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextTransparency = 1}):Play()
  1424. elseif object:IsA"ImageLabel" then
  1425. tweenService:Create(object, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageTransparency = 1}):Play()
  1426. elseif object:IsA"Frame" then
  1427. tweenService:Create(object, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  1428. end
  1429. end
  1430. delay(0.3, function()
  1431. if not self.open then
  1432. self.mainHolder.Visible = false
  1433. end
  1434. end)
  1435. end
  1436. end
  1437.  
  1438. local function loadOptions(option, holder)
  1439. for _,newOption in next, option.options do
  1440. if newOption.type == "label" then
  1441. createLabel(newOption, option)
  1442. elseif newOption.type == "toggle" then
  1443. createToggle(newOption, option)
  1444. elseif newOption.type == "button" then
  1445. createButton(newOption, option)
  1446. elseif newOption.type == "list" then
  1447. createList(newOption, option, holder)
  1448. elseif newOption.type == "box" then
  1449. createBox(newOption, option)
  1450. elseif newOption.type == "bind" then
  1451. createBind(newOption, option)
  1452. elseif newOption.type == "slider" then
  1453. createSlider(newOption, option)
  1454. elseif newOption.type == "color" then
  1455. createColor(newOption, option, holder)
  1456. elseif newOption.type == "folder" then
  1457. newOption:init()
  1458. end
  1459. end
  1460. end
  1461.  
  1462. local function getFnctions(parent)
  1463. function parent:AddLabel(option)
  1464. option = typeof(option) == "table" and option or {}
  1465. option.text = tostring(option.text)
  1466. option.type = "label"
  1467. option.position = #self.options
  1468. table.insert(self.options, option)
  1469.  
  1470. return option
  1471. end
  1472.  
  1473. function parent:AddToggle(option)
  1474. option = typeof(option) == "table" and option or {}
  1475. option.text = tostring(option.text)
  1476. option.state = typeof(option.state) == "boolean" and option.state or false
  1477. option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1478. option.type = "toggle"
  1479. option.position = #self.options
  1480. option.flag = option.flag or option.text
  1481. library.flags[option.flag] = option.state
  1482. table.insert(self.options, option)
  1483.  
  1484. return option
  1485. end
  1486.  
  1487. function parent:AddButton(option)
  1488. option = typeof(option) == "table" and option or {}
  1489. option.text = tostring(option.text)
  1490. option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1491. option.type = "button"
  1492. option.position = #self.options
  1493. option.flag = option.flag or option.text
  1494. table.insert(self.options, option)
  1495.  
  1496. return option
  1497. end
  1498.  
  1499. function parent:AddBind(option)
  1500. option = typeof(option) == "table" and option or {}
  1501. option.text = tostring(option.text)
  1502. option.key = (option.key and option.key.Name) or option.key or "F"
  1503. option.hold = typeof(option.hold) == "boolean" and option.hold or false
  1504. option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1505. option.type = "bind"
  1506. option.position = #self.options
  1507. option.flag = option.flag or option.text
  1508. library.flags[option.flag] = option.key
  1509. table.insert(self.options, option)
  1510.  
  1511. return option
  1512. end
  1513.  
  1514. function parent:AddSlider(option)
  1515. option = typeof(option) == "table" and option or {}
  1516. option.text = tostring(option.text)
  1517. option.min = typeof(option.min) == "number" and option.min or 0
  1518. option.max = typeof(option.max) == "number" and option.max or 0
  1519. option.dual = typeof(option.dual) == "boolean" and option.dual or false
  1520. option.value = math.clamp(typeof(option.value) == "number" and option.value or option.min, option.min, option.max)
  1521. option.value2 = typeof(option.value2) == "number" and option.value2 or option.max
  1522. option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1523. option.float = typeof(option.value) == "number" and option.float or 1
  1524. option.type = "slider"
  1525. option.position = #self.options
  1526. option.flag = option.flag or option.text
  1527. library.flags[option.flag] = option.value
  1528. table.insert(self.options, option)
  1529.  
  1530. return option
  1531. end
  1532.  
  1533. function parent:AddList(option)
  1534. option = typeof(option) == "table" and option or {}
  1535. option.text = tostring(option.text)
  1536. option.values = typeof(option.values) == "table" and option.values or {}
  1537. option.value = tostring(option.value or option.values[1] or "")
  1538. option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1539. option.open = false
  1540. option.type = "list"
  1541. option.position = #self.options
  1542. option.flag = option.flag or option.text
  1543. library.flags[option.flag] = option.value
  1544. table.insert(self.options, option)
  1545.  
  1546. return option
  1547. end
  1548.  
  1549. function parent:AddBox(option)
  1550. option = typeof(option) == "table" and option or {}
  1551. option.text = tostring(option.text)
  1552. option.value = tostring(option.value or "")
  1553. option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1554. option.type = "box"
  1555. option.position = #self.options
  1556. option.flag = option.flag or option.text
  1557. library.flags[option.flag] = option.value
  1558. table.insert(self.options, option)
  1559.  
  1560. return option
  1561. end
  1562.  
  1563. function parent:AddColor(option)
  1564. option = typeof(option) == "table" and option or {}
  1565. option.text = tostring(option.text)
  1566. option.color = typeof(option.color) == "table" and Color3.new(tonumber(option.color[1]), tonumber(option.color[2]), tonumber(option.color[3])) or option.color or Color3.new(255, 255, 255)
  1567. option.callback = typeof(option.callback) == "function" and option.callback or function() end
  1568. option.open = false
  1569. option.type = "color"
  1570. option.position = #self.options
  1571. option.flag = option.flag or option.text
  1572. library.flags[option.flag] = option.color
  1573. table.insert(self.options, option)
  1574.  
  1575. return option
  1576. end
  1577.  
  1578. function parent:AddFolder(title)
  1579. local option = {}
  1580. option.title = tostring(title)
  1581. option.options = {}
  1582. option.open = false
  1583. option.type = "folder"
  1584. option.position = #self.options
  1585. table.insert(self.options, option)
  1586.  
  1587. getFnctions(option)
  1588.  
  1589. function option:init()
  1590. createOptionHolder(self.title, parent.content, self, true)
  1591. loadOptions(self, parent)
  1592. end
  1593.  
  1594. return option
  1595. end
  1596. end
  1597.  
  1598. function library:CreateWindow(title)
  1599. local window = {title = tostring(title), options = {}, open = true, canInit = true, init = false, position = #self.windows}
  1600. getFnctions(window)
  1601.  
  1602. table.insert(library.windows, window)
  1603.  
  1604. return window
  1605. end
  1606.  
  1607. local UIToggle
  1608. local UnlockMouse
  1609. function library:Init()
  1610.  
  1611. self.base = self.base or self:Create("ScreenGui")
  1612. self.base.Parent = game:GetService"CoreGui"
  1613.  
  1614. self.cursor = self.cursor or self:Create("Frame", {
  1615. ZIndex = 100,
  1616. AnchorPoint = Vector2.new(0, 0),
  1617. Size = UDim2.new(0, 5, 0, 5),
  1618. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1619. Parent = self.base
  1620. })
  1621.  
  1622. for _, window in next, self.windows do
  1623. if window.canInit and not window.init then
  1624. window.init = true
  1625. createOptionHolder(window.title, self.base, window)
  1626. loadOptions(window)
  1627. end
  1628. end
  1629. end
  1630.  
  1631. function library:Close()
  1632. self.open = not self.open
  1633. self.cursor.Visible = self.open
  1634. if self.activePopup then
  1635. self.activePopup:Close()
  1636. end
  1637. for _, window in next, self.windows do
  1638. if window.main then
  1639. window.main.Visible = self.open
  1640. end
  1641. end
  1642. end
  1643.  
  1644. inputService.InputBegan:connect(function(input)
  1645. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1646. if library.activePopup then
  1647. if input.Position.X < library.activePopup.mainHolder.AbsolutePosition.X or input.Position.Y < library.activePopup.mainHolder.AbsolutePosition.Y then
  1648. library.activePopup:Close()
  1649. end
  1650. end
  1651. if library.activePopup then
  1652. if input.Position.X > library.activePopup.mainHolder.AbsolutePosition.X + library.activePopup.mainHolder.AbsoluteSize.X or input.Position.Y > library.activePopup.mainHolder.AbsolutePosition.Y + library.activePopup.mainHolder.AbsoluteSize.Y then
  1653. library.activePopup:Close()
  1654. end
  1655. end
  1656. end
  1657. end)
  1658.  
  1659. inputService.InputChanged:connect(function(input)
  1660. if input.UserInputType == Enum.UserInputType.MouseMovement and library.cursor then
  1661. local mouse = inputService:GetMouseLocation() + Vector2.new(0, -36)
  1662. library.cursor.Position = UDim2.new(0, mouse.X - 2, 0, mouse.Y - 2)
  1663. end
  1664. if input == dragInput and dragging then
  1665. update(input)
  1666. end
  1667. end)
  1668.  
  1669. return library
Add Comment
Please, Sign In to add comment