Advertisement
unknownexploits

uilibtest

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