Advertisement
unknownexploits

chungus

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