Advertisement
Guest User

Untitled

a guest
Nov 16th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.29 KB | None | 0 0
  1.  
  2. local TweenService, RunService, UserInputService,gui,dragging,dragInput,dragStart,startPos,cpt,cpf,cppicking,cppickingVal,cppickingAlpha,cphue,cpsat,cpval,focused,highest,focusedBox = game:GetService("TweenService"),game:GetService("RunService"), game:GetService("UserInputService")
  3. local cpalpha = 0
  4.  
  5. --custom functions used for all the options
  6.  
  7. --drag function
  8. local function updateDrag(input)
  9. local delta = input.Position - dragStart
  10. gui.Position = UDim2.new(0, startPos.X.Offset + delta.X, 0, startPos.Y.Offset + delta.Y)
  11. end
  12.  
  13. --color picker
  14. local function updateHueSat(input, obj, hue, sat)
  15. hue = (obj.AbsoluteSize.X-(input.Position.X-obj.AbsolutePosition.X))/obj.AbsoluteSize.X
  16. sat = (obj.AbsoluteSize.Y-(input.Position.Y-obj.AbsolutePosition.Y))/obj.AbsoluteSize.Y
  17. return (input.Position.X-obj.AbsolutePosition.X)/obj.AbsoluteSize.X, (input.Position.Y-obj.AbsolutePosition.Y)/obj.AbsoluteSize.Y, hue, sat
  18. end
  19.  
  20. local function updateValue(input, obj, val)
  21. val = (obj.AbsoluteSize.Y-(input.Position.Y-obj.AbsolutePosition.Y))/obj.AbsoluteSize.Y
  22. return (input.Position.Y-obj.AbsolutePosition.Y)/obj.AbsoluteSize.Y, val
  23. end
  24.  
  25. local function updateAlpha(input, obj, alpha)
  26. alpha = (obj.AbsoluteSize.X-(input.Position.X-obj.AbsolutePosition.X))/obj.AbsoluteSize.X
  27. return (input.Position.X-obj.AbsolutePosition.X)/obj.AbsoluteSize.X, alpha
  28. end
  29.  
  30. local function rgbToHsv(r, g, b)
  31. r, g, b = r / 255, g / 255, b / 255
  32. local max, min = math.max(r, g, b), math.min(r, g, b)
  33. local h, s, v
  34. v = max
  35.  
  36. local d = max - min
  37. if max == 0 then
  38. s = 0
  39. else
  40. s = d / max
  41. end
  42.  
  43. if max == min then
  44. h = 0 -- achromatic
  45. else
  46. if max == r then
  47. h = (g - b) / d
  48. if g < b then
  49. h = h + 6
  50. end
  51. elseif max == g then
  52. h = (b - r) / d + 2
  53. elseif max == b then
  54. h = (r - g) / d + 4
  55. end
  56. h = h / 6
  57. end
  58.  
  59. return h, s, v
  60. end
  61.  
  62. --drag function and color picker
  63. UserInputService.InputChanged:connect(function(input)
  64. if input == dragInput and dragging then
  65. updateDrag(input)
  66. end
  67. if input.UserInputType == Enum.UserInputType.MouseMovement then
  68. if cppicking then
  69. x, y, cphue, cpsat = updateHueSat(input, cpt.HueSat, cphue, cpsat)
  70. if x <= 0 then
  71. x = 0
  72. cphue = 1
  73. end
  74. if x >= 1 then
  75. x = 1
  76. cphue = 0
  77. end
  78. if y <= 0 then
  79. y = 0
  80. cpsat = 1
  81. end
  82. if y >= 1 then
  83. y = 1
  84. cpsat = 0
  85. end
  86. cpt.pointer.Position = UDim2.new(x,0,y,0)
  87. cpt.color = Color3.fromHSV(cphue,cpsat,cpval)
  88. cpt.visualize.BackgroundColor3 = cpt.color
  89. cpt.Alpha.ImageColor3 = cpt.color
  90. return cpf(cpt.color, cpt.alpha)
  91. end
  92. if cppickingVal then
  93. y, cpval = updateValue(input, cpt.Value, cpval)
  94. if y <= 0 then
  95. y = 0
  96. cpval = 1
  97. end
  98. if y >= 1 then
  99. y = 1
  100. cpval = 0
  101. end
  102. cpt.pointer2.Position = UDim2.new(1,-10,y,0)
  103. cpt.color = Color3.fromHSV(cphue,cpsat,cpval)
  104. cpt.visualize.BackgroundColor3 = cpt.color
  105. cpt.Alpha.ImageColor3 = cpt.color
  106. return cpf(cpt.color, cpt.alpha)
  107. end
  108. if cppickingAlpha then
  109. x, cpalpha = updateAlpha(input, cpt.Alpha, cpalpha)
  110. if x <= 0 then
  111. x = 0
  112. cpalpha = 1
  113. end
  114. if x >= 1 then
  115. x = 1
  116. cpalpha = 0
  117. end
  118. cpt.pointer3.Position = UDim2.new(x,0,1,-10)
  119. cpt.alpha = 1-cpalpha
  120. cpt.visualize.BackgroundTransparency = cpt.alpha
  121. return cpf(cpt.color, cpt.alpha)
  122. end
  123. end
  124. end)
  125.  
  126. --slider
  127. local function round(num, bracket)
  128. bracket = bracket or 1
  129. return math.floor(num/bracket + math.sign(num) * 0.5) * bracket
  130. end
  131.  
  132. --keybind
  133. local blacklistedKeys = { --add or remove keys if you find the need to
  134. 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.One,Enum.KeyCode.Two,Enum.KeyCode.Three,Enum.KeyCode.Four,Enum.KeyCode.Five,Enum.KeyCode.Six,Enum.KeyCode.Seven,Enum.KeyCode.Eight,Enum.KeyCode.Nine,Enum.KeyCode.Zero,Enum.KeyCode.Escape,Enum.KeyCode.F1,Enum.KeyCode.F2,Enum.KeyCode.F3,Enum.KeyCode.F4,Enum.KeyCode.F5,Enum.KeyCode.F6,Enum.KeyCode.F7,Enum.KeyCode.F8,Enum.KeyCode.F9,Enum.KeyCode.F10,Enum.KeyCode.F11,Enum.KeyCode.F12
  135. }
  136.  
  137. local whitelistedMouse = { --add or remove mouse inputs if you find the need to
  138. Enum.UserInputType.MouseButton1,Enum.UserInputType.MouseButton2,Enum.UserInputType.MouseButton3
  139. }
  140.  
  141. local function keyCheck(x,x1) -- used for keybinding
  142. for _,v in next, x1 do
  143. if v == x then
  144. return true
  145. end
  146. end
  147. end
  148.  
  149. --zindex stuff
  150. local function focusOnOption(obj)
  151. if highest then
  152. highest.ZIndex = highest.ZIndex - 5
  153. for _,v in next, highest:GetDescendants() do
  154. pcall(function()
  155. v.ZIndex = v.ZIndex +- 5
  156. end)
  157. end
  158. end
  159. highest = obj
  160. highest.ZIndex = highest.ZIndex + 5
  161. for _,v in next, highest:GetDescendants() do
  162. pcall(function()
  163. v.ZIndex = v.ZIndex + 5
  164. end)
  165. end
  166. end
  167.  
  168. local function focusOnWindow(obj)
  169. if focused then
  170. focused.ZIndex = focused.ZIndex - 10
  171. for _,v in next, focused:GetDescendants() do
  172. pcall(function()
  173. v.ZIndex = v.ZIndex - 10
  174. end)
  175. end
  176. end
  177. focused = obj
  178. focused.ZIndex = focused.ZIndex + 10
  179. for _,v in next, focused:GetDescendants() do
  180. pcall(function()
  181. v.ZIndex = v.ZIndex + 10
  182. end)
  183. end
  184. end
  185.  
  186. local ddcheck
  187. local extframes = {}
  188. for i=1,4 do
  189. local frame = Instance.new("Frame")
  190. frame.ZIndex = 50
  191. frame.BackgroundTransparency = 1
  192. frame.Visible = false
  193. if i == 1 then
  194. frame.Size = UDim2.new(0,1000,0,-1000)
  195. elseif i == 2 then
  196. frame.Size = UDim2.new(0,1000,0,1000)
  197. frame.Position = UDim2.new(1,0,0,0)
  198. elseif i == 3 then
  199. frame.Size = UDim2.new(0,-1000,0,1000)
  200. frame.Position = UDim2.new(1,0,1,0)
  201. elseif i == 4 then
  202. frame.Size = UDim2.new(0,-1000,0,-1000)
  203. frame.Position = UDim2.new(0,0,1,0)
  204. end
  205. table.insert(extframes, frame)
  206. frame.InputBegan:connect(function(input)
  207. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  208. frame.Parent.Visible = false
  209. if ddcheck then
  210. ddcheck.arrow.Text = ">"
  211. ddcheck.closed = not ddcheck.closed
  212. end
  213. for _,v in next, extframes do
  214. v.Visible = false
  215. end
  216. end
  217. end)
  218. end
  219.  
  220. local function closeWindow(obj)
  221. for _,v in next, extframes do
  222. v.Visible = true
  223. v.Parent = obj
  224. end
  225. end
  226.  
  227. --start of library
  228. local library = {windows = {}}
  229.  
  230. library.settings = {
  231. title = "Title text",
  232. footer = "",
  233. modal = true,
  234. toggle = Enum.KeyCode.F1,
  235. font = Enum.Font.SourceSans,
  236. textsize = 16,
  237. textstroke = false
  238. }
  239.  
  240. library.colors = {
  241. mainoutline = Color3.fromRGB(10,10,10),
  242. secondaryoutline = Color3.fromRGB(30,30,30),
  243. mainbg = Color3.fromRGB(20,20,20),
  244. maintext = Color3.fromRGB(255,255,255),
  245. title = Color3.fromRGB(255,255,255),
  246. titlebg = Color3.fromRGB(40,40,40),
  247. footer = Color3.fromRGB(240,240,240),
  248. footerbg = Color3.fromRGB(35,35,35),
  249. tabbutton = Color3.fromRGB(60,60,60),
  250. tabbg = Color3.fromRGB(40,40,40),
  251. sectiontext = Color3.fromRGB(255,255,255),
  252. optionbg = Color3.fromRGB(50,50,50),
  253. optiontext = Color3.fromRGB(250,250,250),
  254. toggle = Color3.fromRGB(255,67,67),
  255. sliderfill = Color3.fromRGB(255,67,67),
  256. }
  257.  
  258. function library:create(class, properties)
  259. local inst = Instance.new(class)
  260. for property, value in pairs(properties) do
  261. inst[property] = value
  262. end
  263. return inst
  264. end
  265.  
  266. function library:CreateWindow(ctitle, csize, cpos)
  267. if ctitle then
  268. if typeof(ctitle) == "Vector2" then
  269. cpos = csize
  270. csize = ctitle
  271. ctitle = library.settings.title
  272. end
  273. end
  274. cpos = cpos or Vector2.new(40,40)
  275. csize = csize or Vector2.new(600,420)
  276. local window = {ypos = 4, close = true, draggable = true}
  277. table.insert(self.windows, window)
  278.  
  279. self.base = self.base or self:create("ScreenGui", {
  280. Parent = game.Players.LocalPlayer.PlayerGui
  281. })
  282.  
  283. self.pointer = self.pointer or self:create("Frame", {
  284. ZIndex = 100,
  285. Size = UDim2.new(0,4,0,4),
  286. BackgroundColor3 = Color3.fromRGB(255,255,255),
  287. Parent = self.base
  288. })
  289.  
  290. self.pointer1 = self.pointer1 or self:create("Frame", {
  291. ZIndex = 100,
  292. Size = UDim2.new(0,1,0,1),
  293. BackgroundColor3 = Color3.fromRGB(255,0,0),
  294. BorderColor3 = Color3.fromRGB(255,0,0),
  295. Parent = self.pointer
  296. })
  297.  
  298. window.main = self:create("TextButton", {
  299.  
  300. Position = UDim2.new(0,cpos.X,0,cpos.Y),
  301. Size = UDim2.new(0,csize.X,0,csize.Y),
  302. BackgroundColor3 = self.colors.mainbg,
  303. BorderColor3 = self.colors.mainoutline,
  304. Text = "",
  305. AutoButtonColor = false,
  306. Parent = self.base
  307. })
  308.  
  309. window.title = self:create("TextLabel", {
  310. Size = UDim2.new(1,0,0,18),
  311. BackgroundColor3 = self.colors.titlebg,
  312. BorderColor3 = library.colors.mainoutline,
  313. Text = ctitle or self.settings.title,
  314. TextColor3 = self.colors.title,
  315. TextStrokeTransparency = self.settings.textstroke and 0 or 1,
  316. Font = self.settings.font,
  317. TextSize = self.settings.textsize,
  318. Parent = window.main
  319. })
  320.  
  321. window.title.InputBegan:connect(function(input)
  322. if input.UserInputType == Enum.UserInputType.MouseButton1 and window.draggable then
  323. gui = window.main
  324. dragging = true
  325. dragStart = input.Position
  326. startPos = gui.Position
  327.  
  328. input.Changed:Connect(function()
  329. if input.UserInputState == Enum.UserInputState.End then
  330. dragging = false
  331. end
  332. end)
  333. end
  334. end)
  335.  
  336. window.title.InputChanged:connect(function(input)
  337. if input.UserInputType == Enum.UserInputType.MouseMovement then
  338. dragInput = input
  339. end
  340. end)
  341.  
  342. window.main.InputBegan:connect(function(input)
  343. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  344. focusOnWindow(window.main)
  345. end
  346. end)
  347.  
  348. function window:CreateTab(name)
  349. local tab = {}
  350. tab.rows = {}
  351.  
  352. local function createNewRow()
  353. tab.row = library:create("Frame", {
  354. Position = UDim2.new(0,csize.X/2 * #tab.rows - (1 - #tab.rows * - 67),0,0),
  355. Size = UDim2.new(0,csize.X/2 - 68,1,0),
  356. BackgroundTransparency = 1,
  357. Parent = tab.main
  358. })
  359. tab.layout = library:create("UIListLayout", {
  360. Padding = UDim.new(0,8),
  361. Parent = tab.row
  362. })
  363.  
  364. tab.padding = library:create("UIPadding", {
  365. PaddingLeft = UDim.new(0,4),
  366. PaddingRight = UDim.new(0,4),
  367. PaddingTop = UDim.new(0,12),
  368. Parent = tab.row
  369. })
  370. table.insert(tab.rows, tab)
  371. if #tab.rows > 2 then
  372. self.main.Size = self.main.Size + UDim2.new(0,csize.X/2 - 67,0,0)
  373. end
  374. end
  375. local function checkRow()
  376. if tab.row then
  377. for _,row in pairs(tab.rows) do
  378. if row.layout.AbsoluteContentSize.Y > row.row.AbsoluteSize.Y - 20 then
  379. createNewRow()
  380. else
  381. tab = row
  382. end
  383. end
  384. else
  385. createNewRow()
  386. end
  387. end
  388.  
  389. self.tabholder = self.tabholder or library:create("Frame", {
  390. Position = UDim2.new(0,5,0,24),
  391. Size = UDim2.new(0,120,1,-48),
  392. BackgroundColor3 = library.colors.tabbg,
  393. BorderColor3 = library.colors.mainoutline,
  394. Parent = self.main
  395. })
  396.  
  397. self.footer = self.footer or library:create("TextLabel", {
  398. Position = UDim2.new(0,0,1,0),
  399. Size = UDim2.new(1,0,0,-18),
  400. BackgroundColor3 = library.colors.footerbg,
  401. BorderColor3 = library.colors.mainoutline,
  402. Text = " "..library.settings.footer,
  403. TextColor3 = library.colors.footer,
  404. TextStrokeTransparency = library.settings.textstroke and 0 or 1,
  405. Font = library.settings.font,
  406. TextSize = library.settings.textsize,
  407. TextXAlignment = Enum.TextXAlignment.Left,
  408. Parent = self.main
  409. })
  410.  
  411. tab.main = library:create("Frame", {
  412. Position = UDim2.new(0,130,0,24),
  413. Size = UDim2.new(1,-135,1,-48),
  414. BackgroundColor3 = library.colors.tabbg,
  415. BorderColor3 = library.colors.mainoutline,
  416. Visible = false,
  417. Parent = self.main
  418. })
  419.  
  420. tab.button = library:create("TextLabel", {
  421. Position = UDim2.new(0,4,0,self.ypos),
  422. Size = UDim2.new(1,-8,0,20),
  423. BackgroundColor3 = library.colors.tabbutton,
  424. BorderColor3 = library.colors.secondaryoutline,
  425. Text = name,
  426. TextColor3 = library.colors.maintext,
  427. TextStrokeTransparency = library.settings.textstroke and 0 or 1,
  428. Font = library.settings.font,
  429. TextSize = library.settings.textsize,
  430. Parent = self.tabholder
  431. })
  432.  
  433. if self.ypos == 4 then
  434. self.focused = tab
  435. self.focused.main.Visible = true
  436. end
  437. self.ypos = self.ypos + 24
  438.  
  439. tab.button.InputBegan:connect(function(input)
  440. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  441. self.focused.main.Visible = false
  442. self.focused = tab
  443. self.focused.main.Visible = true
  444. end
  445. end)
  446.  
  447. function tab:AddSection(title)
  448. local section = {order = 0}
  449. local bounds = game:GetService('TextService'):GetTextSize(title, library.settings.textsize, library.settings.font, Vector2.new(math.huge, math.huge))
  450. checkRow()
  451.  
  452. section.main = library:create("Frame", {
  453. Size = UDim2.new(1,0,0,0),
  454. BackgroundColor3 = library.colors.tabbg,
  455. BorderColor3 = library.colors.secondaryoutline,
  456. Parent = self.row
  457. })
  458.  
  459. section.title = library:create("TextLabel", {
  460. AnchorPoint = Vector2.new(0,0.5),
  461. Position = UDim2.new(0,12,0,0),
  462. Size = UDim2.new(0,bounds.X + 8,0,2),
  463. BackgroundColor3 = library.colors.tabbg,
  464. BorderSizePixel = 0,
  465. Text = title,
  466. TextColor3 = library.colors.sectiontext,
  467. TextStrokeTransparency = library.settings.textstroke and 0 or 1,
  468. Font = library.settings.font,
  469. TextSize = library.settings.textsize,
  470. Parent = section.main
  471. })
  472.  
  473. section.content = library:create("Frame", {
  474.  
  475. Size = UDim2.new(1,0,1,0),
  476. BackgroundTransparency = 1,
  477. Parent = section.main
  478. })
  479.  
  480. section.layout = library:create("UIListLayout", {
  481. Padding = UDim.new(0,4),
  482. SortOrder = Enum.SortOrder.LayoutOrder,
  483. Parent = section.content
  484. })
  485.  
  486. section.padding = library:create("UIPadding", {
  487. PaddingLeft = UDim.new(0,6),
  488. PaddingRight = UDim.new(0,6),
  489. PaddingTop = UDim.new(0,12),
  490. Parent = section.content
  491. })
  492.  
  493. function section:AddLabel(text)
  494. local label = {}
  495. label.text = text
  496. checkRow()
  497. section.main.Parent = tab.row
  498.  
  499. label.label = library:create("TextLabel", {
  500. LayoutOrder = self.order,
  501. Size = UDim2.new(1,0,0,library.settings.textsize + 2),
  502. BackgroundTransparency = 1,
  503. Text = tostring(text),
  504. TextColor3 = library.colors.optiontext,
  505. Font = library.settings.font,
  506. TextSize = library.settings.textsize,
  507. TextStrokeTransparency = library.settings.textstroke and 0 or 1,
  508. TextWrapped = true,
  509. TextXAlignment = Enum.TextXAlignment.Left,
  510. Parent = section.content
  511. })
  512.  
  513. section.main.Size = UDim2.new(1,0,0,self.layout.AbsoluteContentSize.Y+16)
  514.  
  515. self.order = self.order + 1
  516.  
  517. return label
  518. end
  519.  
  520. function section:AddButton(text, _function)
  521. local button = {}
  522. _function = _function or function() end
  523. checkRow()
  524. section.main.Parent = tab.row
  525.  
  526. button.button = library:create("TextButton", {
  527. LayoutOrder = self.order,
  528. Size = UDim2.new(1,0,0,library.settings.textsize + 2),
  529. BackgroundTransparency = 1,
  530. Text = tostring(text),
  531. TextColor3 = library.colors.optiontext,
  532. Font = library.settings.font,
  533. TextSize = library.settings.textsize,
  534. TextStrokeTransparency = library.settings.textstroke and 0 or 1,
  535. TextXAlignment = Enum.TextXAlignment.Left,
  536. Parent = self.content,
  537. })
  538.  
  539. self.order = self.order + 1
  540.  
  541. button.button.InputBegan:connect(function(input)
  542. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  543. _function()
  544. end
  545. end)
  546.  
  547. section.main.Size = UDim2.new(1,0,0,self.layout.AbsoluteContentSize.Y+16)
  548.  
  549. return button
  550. end
  551.  
  552. function section:AddToggle(text, _function)
  553. local toggle = {state = false}
  554. _function = _function or function() end
  555. checkRow()
  556. section.main.Parent = tab.row
  557.  
  558. toggle.button = library:create("TextButton", {
  559. LayoutOrder = self.order,
  560. Size = UDim2.new(1,0,0,library.settings.textsize + 2),
  561. BackgroundTransparency = 1,
  562. Text = tostring(text),
  563. TextColor3 = library.colors.optiontext,
  564. Font = library.settings.font,
  565. TextSize = library.settings.textsize,
  566. TextStrokeTransparency = library.settings.textstroke and 0 or 1,
  567. TextXAlignment = Enum.TextXAlignment.Left,
  568. Parent = self.content,
  569. })
  570.  
  571. toggle.holder = library:create("Frame", {
  572. AnchorPoint = Vector2.new(0,0.5),
  573. Position = UDim2.new(1,-1,0.5,0),
  574. Size = UDim2.new(0,-library.settings.textsize+4,0,library.settings.textsize-4),
  575. BackgroundColor3 = library.colors.optionbg,
  576. BorderSizePixel = 2,
  577. BorderColor3 = library.colors.secondaryoutline,
  578. Parent = toggle.button,
  579. })
  580.  
  581. toggle.visualize = library:create("Frame", {
  582. Position = UDim2.new(0,0,0,0),
  583. Size = UDim2.new(1,0,1,0),
  584. BackgroundTransparency = 1,
  585. BackgroundColor3 = library.colors.toggle,
  586. BorderSizePixel = 0,
  587. Parent = toggle.holder,
  588. })
  589.  
  590. self.order = self.order + 1
  591.  
  592. function toggle:SetToggle(state)
  593. toggle.state = state
  594. if toggle.state then
  595. toggle.visualize.BackgroundTransparency = 0
  596. else
  597. toggle.visualize.BackgroundTransparency = 1
  598. end
  599. return _function(toggle.state)
  600. end
  601.  
  602. toggle.button.InputBegan:connect(function(input)
  603. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  604. toggle.state = not toggle.state
  605. toggle:SetToggle(toggle.state)
  606. end
  607. end)
  608.  
  609. section.main.Size = UDim2.new(1,0,0,self.layout.AbsoluteContentSize.Y+16)
  610.  
  611. return toggle
  612. end
  613.  
  614. function section:AddBox(text, txtval, _function, keep)
  615. local box = {value = ""}
  616. if txtval then
  617. if typeof(txtval) == "function" then
  618. _function = txtval
  619. txtval = ""
  620. elseif typeof(txtval) == "string" then
  621. box.value = txtval
  622. end
  623. end
  624. if keep then
  625. if typeof(keep) == "string" then
  626. keep = false
  627. end
  628. end
  629. _function = _function or function() end
  630. checkRow()
  631. section.main.Parent = tab.row
  632.  
  633. box.button = library:create("TextButton", {
  634. LayoutOrder = self.order,
  635. Size = UDim2.new(1,0,0,library.settings.textsize + 22),
  636. BackgroundTransparency = 1,
  637. Text = tostring(text),
  638. TextColor3 = library.colors.optiontext,
  639. Font = library.settings.font,
  640. TextSize = library.settings.textsize,
  641. TextStrokeTransparency = library.settings.textstroke and 0 or 1,
  642. TextXAlignment = Enum.TextXAlignment.Left,
  643. TextYAlignment = Enum.TextYAlignment.Top,
  644. Parent = self.content,
  645. })
  646.  
  647. box.box = library:create("TextBox", {
  648. Position = UDim2.new(0,0,0,19),
  649. Size = UDim2.new(1,0,0,17),
  650. BackgroundTransparency = 0,
  651. BackgroundColor3 = library.colors.optionbg,
  652. BorderColor3 = library.colors.secondaryoutline,
  653. Text = txtval,
  654. TextColor3 = library.colors.optiontext,
  655. PlaceholderText = "",
  656. PlaceholderColor3 = library.colors.mainoutline,
  657. Font = library.settings.font,
  658. TextSize = library.settings.textsize-2,
  659. TextWrapped = true,
  660. Parent = box.button,
  661. })
  662.  
  663. self.order = self.order + 1
  664.  
  665. box.button.InputBegan:connect(function(input)
  666. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  667. box.box:CaptureFocus()
  668. end
  669. end)
  670.  
  671. box.box.FocusLost:connect(function(enter)
  672. if keep then
  673. if box.box.Text == "" then
  674. box.box.Text = box.value
  675. return
  676. else
  677. box.value = box.box.Text
  678. end
  679. end
  680. return _function(box.box.Text, enter)
  681. end)
  682.  
  683. UserInputService.InputBegan:connect(function(input)
  684. if input.KeyCode == Enum.KeyCode.Escape and box.box:IsFocused() then
  685. box.box:ReleaseFocus()
  686. end
  687. end)
  688.  
  689. function box:SetValue(value)
  690. box.value = value
  691. box.box.Text = box.value
  692. return _function(box)
  693. end
  694.  
  695. section.main.Size = UDim2.new(1,0,0,self.layout.AbsoluteContentSize.Y+18)
  696.  
  697. return box
  698. end
  699.  
  700. function section:AddDropdown(text, options, _function, push)
  701. _function = _function or function() end
  702. local dropdown = {order = 0, closed = true, value = options[1]}
  703. dropdown.content = {}
  704. checkRow()
  705. section.main.Parent = tab.row
  706.  
  707. dropdown.button = library:create("TextButton", {
  708. LayoutOrder = self.order,
  709. Size = UDim2.new(1,0,0,library.settings.textsize + 22),
  710. BackgroundTransparency = 1,
  711. Text = tostring(text),
  712. TextColor3 = library.colors.optiontext,
  713. TextStrokeTransparency = library.settings.textstroke and 0 or 1,
  714. Font = library.settings.font,
  715. TextSize = library.settings.textsize,
  716. TextXAlignment = Enum.TextXAlignment.Left,
  717. TextYAlignment = Enum.TextYAlignment.Top,
  718. Parent = self.content,
  719. })
  720.  
  721. dropdown.label = library:create("TextLabel", {
  722. Position = UDim2.new(0,0,0,19),
  723. Size = UDim2.new(1,0,0,17),
  724. BackgroundTransparency = 0,
  725. BackgroundColor3 = library.colors.optionbg,
  726. BorderColor3 = library.colors.secondaryoutline,
  727. Text = dropdown.value,
  728. TextColor3 = library.colors.optiontext,
  729. Font = library.settings.font,
  730. TextSize = library.settings.textsize,
  731. Parent = dropdown.button,
  732. })
  733.  
  734. dropdown.arrow = library:create("TextLabel", {
  735. Position = UDim2.new(1,0,0,2),
  736. Size = UDim2.new(0,-16,0,16),
  737. Rotation = 90,
  738. BackgroundTransparency = 1,
  739. Text = ">",
  740. TextColor3 = library.colors.mainoutline,
  741. Font = Enum.Font.Arcade,
  742. TextSize = 18,
  743. Parent = dropdown.label,
  744. })
  745.  
  746. dropdown.container = library:create("Frame", {
  747. ZIndex = 2,
  748. Position = UDim2.new(0,0,1,3),
  749. BackgroundTransparency = 1,
  750. Visfible = false,
  751. Parent = dropdown.label,
  752. })
  753.  
  754. dropdown.contentholder = library:create("ScrollingFrame", {
  755. ZIndex = 2,
  756. ClipsDescendants = true,
  757. Size = UDim2.new(1,0,1,0),
  758. BackgroundTransparency = 0,
  759. BorderSizePixel = 1,
  760. BackgroundColor3 = library.colors.mainbg,
  761. BorderColor3 = library.colors.mainoutline,
  762. CanvasSize = UDim2.new(0,0,0,0),
  763. ScrollBarThickness = 0,
  764. Visible = true,
  765. Parent = dropdown.container,
  766. })
  767.  
  768. dropdown.layout = library:create("UIListLayout", {
  769. Padding = UDim.new(0,0),
  770. SortOrder = Enum.SortOrder.LayoutOrder,
  771. Parent = dropdown.contentholder
  772. })
  773.  
  774. self.order = self.order + 1
  775.  
  776. dropdown.button.InputBegan:connect(function(input)
  777. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  778. focusOnOption(dropdown.container)
  779. closeWindow(dropdown.container)
  780. ddcheck = dropdown
  781. dropdown.closed = not dropdown.closed
  782. if dropdown.closed then
  783. dropdown.arrow.Text = ">"
  784. dropdown.container.Visible = false
  785. else
  786. dropdown.arrow.Text = "<"
  787. dropdown.container.Visible = true
  788. end
  789. end
  790. end)
  791.  
  792. local function addOptions(options)
  793. for _,value in pairs(options) do
  794. dropdown.order = dropdown.order+1
  795.  
  796. local option = library:create("TextButton", {
  797. ZIndex = dropdown.contentholder.ZIndex,
  798. LayoutOrder = dropdown.order,
  799. Size = UDim2.new(1,0,0,18),
  800. BackgroundTransparency = 0,
  801. BackgroundColor3 = library.colors.tabbg,
  802. BorderColor3 = library.colors.secondaryoutline,
  803. Text = value,
  804. TextColor3 = library.colors.optiontext,
  805. Font = library.settings.font,
  806. TextSize = library.settings.textsize,
  807. AutoButtonColor = false,
  808. Parent = dropdown.contentholder,
  809. })
  810.  
  811. option.MouseButton1Click:connect(function()
  812. dropdown.value = value
  813. if push then
  814. for _,v in pairs(dropdown.content) do
  815. if v.LayoutOrder < option.LayoutOrder then
  816. v.LayoutOrder = v.LayoutOrder + 1
  817. end
  818. end
  819. option.LayoutOrder = 1
  820. end
  821. dropdown.label.Text = dropdown.value
  822. dropdown.closed = true
  823. dropdown.arrow.Text = ">"
  824. dropdown.container.Visible = false
  825. return _function(dropdown.value)
  826. end)
  827.  
  828. if dropdown.order > 5 then
  829. dropdown.contentholder.CanvasSize = UDim2.new(0,0,0,dropdown.layout.AbsoluteContentSize.Y)
  830. else
  831. dropdown.container.Size = UDim2.new(1,0,0,dropdown.layout.AbsoluteContentSize.Y)
  832. end
  833.  
  834. table.insert(dropdown.content, dropdown.order, option)
  835. end
  836. end
  837.  
  838. addOptions(options)
  839.  
  840. function dropdown:Refresh(options, keep)
  841. if not keep then
  842. for _,v in pairs(dropdown.contentholder:GetChildren()) do
  843. if v:IsA"TextButton" then
  844. v:Destroy()
  845. dropdown.order = dropdown.order - 1
  846. dropdown.contentholder.CanvasSize = UDim2.new(0,0,0,dropdown.layout.AbsoluteContentSize.Y)
  847. end
  848. end
  849. end
  850. addOptions(options)
  851. end
  852.  
  853. function dropdown:SetValue(value)
  854. dropdown.value = value
  855. dropdown.label.Text = dropdown.value
  856. return _function(dropdown.value)
  857. end
  858.  
  859. section.main.Size = UDim2.new(1,0,0,self.layout.AbsoluteContentSize.Y+18)
  860.  
  861. return dropdown
  862. end
  863.  
  864. function section:AddSlider(text, maxVal, setVal, _function, float, incrementalMode)
  865. if setVal then
  866. if typeof(setVal) == "function" then
  867. if _function then
  868. if typeof(_function) == "number" then
  869. incrementalMode = float
  870. float = _function
  871. elseif typeof(_function) == "boolean" then
  872. incrementalMode = _function
  873. float = nil
  874. end
  875. end
  876. _function = setVal
  877. setVal = 0
  878. else
  879. if float then
  880. if typeof(float) == "boolean" then
  881. incrementalMode = float
  882. float = nil
  883. end
  884. end
  885. end
  886. end
  887. if setVal > maxVal then
  888. setVal = maxVal
  889. end
  890. if setVal < 0 then
  891. setVal = 0
  892. end
  893. _function = _function or function() end
  894. local slider = {value = setVal}
  895. checkRow()
  896. section.main.Parent = tab.row
  897.  
  898. slider.button = library:create("TextButton", {
  899. LayoutOrder = self.order,
  900. Size = UDim2.new(1,0,0,library.settings.textsize + 22),
  901. BackgroundTransparency = 1,
  902. Text = tostring(text),
  903. TextColor3 = library.colors.optiontext,
  904. TextStrokeTransparency = library.settings.textstroke and 0 or 1,
  905. Font = library.settings.font,
  906. TextSize = library.settings.textsize,
  907. TextXAlignment = Enum.TextXAlignment.Left,
  908. TextYAlignment = Enum.TextYAlignment.Top,
  909. Parent = self.content,
  910. })
  911.  
  912. slider.holder = library:create("Frame", {
  913. Position = UDim2.new(0,0,0,18),
  914. Size = UDim2.new(1,0,0,17),
  915. BackgroundTransparency = 1,
  916. Parent = slider.button,
  917. })
  918.  
  919. slider.visualize = library:create("TextBox", {
  920. Position = UDim2.new(0,0,0.5,0),
  921. Size = UDim2.new(1,0,0.5,0),
  922. BackgroundTransparency = 1,
  923. Text = tostring(slider.value),
  924. TextColor3 = library.colors.optiontext,
  925. Font = library.settings.font,
  926. TextSize = library.settings.textsize-2,
  927. TextWrapped = true,
  928. Parent = slider.holder,
  929. })
  930.  
  931. slider.sliderbar = library:create("Frame", {
  932. AnchorPoint = Vector2.new(0.5,0.5),
  933. Position = UDim2.new(0.5,0,0.2,0),
  934. Size = UDim2.new(1,-6,0,4),
  935. BackgroundColor3 = library.colors.optionbg,
  936. BorderColor3 = library.colors.secondaryoutline,
  937. Parent = slider.holder,
  938. })
  939.  
  940. slider.sliderfill = library:create("Frame", {
  941. Size = UDim2.new(slider.value/maxVal,0,1,0),
  942. BackgroundColor3 = library.colors.sliderfill,
  943. BorderSizePixel = 0,
  944. Parent = slider.sliderbar,
  945. })
  946.  
  947. slider.sliderbox = library:create("Frame", {
  948. AnchorPoint = Vector2.new(0.5,0.5),
  949. Position = UDim2.new(slider.value/maxVal,0,0.5,0),
  950. Size = UDim2.new(0,4,0,12),
  951. BackgroundColor3 = library.colors.mainbg,
  952. BorderSizePixel = 0,
  953. Parent = slider.sliderbar,
  954. })
  955.  
  956. self.order = self.order + 1
  957.  
  958. local function updateValue()
  959. slider.value = round(slider.value*maxVal, float)
  960. if slider.value > maxVal then
  961. slider.value = maxVal
  962. end
  963. if slider.value < 0 then
  964. slider.value = 0
  965. end
  966. if incrementalMode then
  967. slider.sliderbox.Position = UDim2.new(slider.value/maxVal,0,0.5,0)
  968. slider.sliderfill.Size = UDim2.new(slider.value/maxVal,0,1,0)
  969. else
  970. slider.sliderbox:TweenPosition(UDim2.new(slider.value/maxVal,0,0.5,0), "Out", "Quad", 0.1, true)
  971. slider.sliderfill:TweenSize(UDim2.new(slider.value/maxVal,0,1,0), "Out", "Quad", 0.1, true)
  972. end
  973. slider.visualize.Text = slider.value
  974. _function(slider.value)
  975. end
  976.  
  977. local function updateSlider(input)
  978. local relativePos = input.Position.X- slider.sliderbar.AbsolutePosition.X
  979. if input.Position.X < slider.sliderbar.AbsolutePosition.X then
  980. relativePos = 0
  981. end
  982. if relativePos > slider.sliderbar.AbsoluteSize.X then
  983. relativePos = slider.sliderbar.AbsoluteSize.X
  984. end
  985. slider.value = relativePos/slider.sliderbar.AbsoluteSize.X
  986. updateValue()
  987. end
  988.  
  989. local sliding
  990. local modifying
  991. slider.button.InputBegan:connect(function(input)
  992. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  993. if UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) then
  994. modifying = true
  995. slider.visualize:CaptureFocus()
  996. else
  997. sliding = true
  998. updateSlider(input)
  999. end
  1000. end
  1001. end)
  1002.  
  1003. slider.visualize.Focused:connect(function()
  1004. if not modifying then
  1005. slider.visualize:ReleaseFocus()
  1006. end
  1007. end)
  1008.  
  1009. slider.visualize.FocusLost:connect(function()
  1010. if modifying then
  1011. slider.value = (tonumber(slider.visualize.Text) or 0)/maxVal
  1012. updateValue()
  1013. end
  1014. modifying = false
  1015. end)
  1016.  
  1017. slider.button.InputEnded:connect(function(input)
  1018. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1019. sliding = false
  1020. end
  1021. end)
  1022.  
  1023. UserInputService.InputChanged:connect(function(input)
  1024. if modifying then
  1025. if input == Enum.KeyCode.Escape or input.KeyCode == Enum.KeyCode.Space then
  1026. slider.visualize:ReleaseFocus()
  1027. end
  1028. end
  1029. if input.UserInputType == Enum.UserInputType.MouseMovement then
  1030. if sliding then
  1031. updateSlider(input)
  1032. end
  1033. end
  1034. end)
  1035.  
  1036. function slider:SetValue(num)
  1037. slider.value = num/maxVal
  1038. updateValue()
  1039. end
  1040.  
  1041. section.main.Size = UDim2.new(1,0,0,self.layout.AbsoluteContentSize.Y+18)
  1042.  
  1043. return slider
  1044. end
  1045.  
  1046. function section:AddKeybind(text, key, _function, hold)
  1047. if key and typeof(key) == "function" then
  1048. hold = _function
  1049. _function = key
  1050. key = Enum.KeyCode.F
  1051. end
  1052. if typeof(key) == "string" then
  1053. if not keyCheck(Enum.KeyCode[key:upper()], blacklistedKeys) then
  1054. key = Enum.KeyCode[key:upper()]
  1055. end
  1056. if keyCheck(key, whitelistedMouse) then
  1057. key = Enum.UserInputType[key:upper()]
  1058. end
  1059. end
  1060. _function = _function or function() end
  1061. local bind = {binding = false, holding = false, key = key, hold = hold}
  1062. local bounds = game:GetService('TextService'):GetTextSize(bind.key.Name, library.settings.textsize, library.settings.font, Vector2.new(math.huge, math.huge))
  1063. checkRow()
  1064. section.main.Parent = tab.row
  1065.  
  1066. bind.button = library:create("TextButton", {
  1067. LayoutOrder = self.order,
  1068. Size = UDim2.new(1,0,0,library.settings.textsize + 4),
  1069. BackgroundTransparency = 1,
  1070. Text = tostring(text),
  1071. TextColor3 = library.colors.optiontext,
  1072. TextStrokeTransparency = library.settings.textstroke and 0 or 1,
  1073. Font = library.settings.font,
  1074. TextSize = library.settings.textsize,
  1075. TextXAlignment = Enum.TextXAlignment.Left,
  1076. AutoButtonColor = false,
  1077. Parent = self.content,
  1078. })
  1079.  
  1080. bind.label = library:create("TextLabel", {
  1081. Position = UDim2.new(1,0,0,2),
  1082. Size = UDim2.new(0,-bounds.X-8,1,-4),
  1083. BackgroundColor3 = library.colors.optionbg,
  1084. BorderColor3 = library.colors.secondaryoutline,
  1085. Text = bind.key.Name,
  1086. TextColor3 = library.colors.optiontext,
  1087. Font = library.settings.font,
  1088. TextSize = library.settings.textsize,
  1089. Parent = bind.button,
  1090. })
  1091.  
  1092. self.order = self.order + 1
  1093.  
  1094. bind.button.InputBegan:connect(function(input)
  1095. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1096. bind.label.Text = "..."
  1097. bind.label.Size = UDim2.new(0,-bind.label.TextBounds.X-8,1,-4)
  1098. end
  1099. end)
  1100.  
  1101. bind.button.InputEnded:connect(function(input)
  1102. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1103. bind.binding = true
  1104. end
  1105. end)
  1106. local function setKey(key)
  1107. bind.key = key
  1108. bind.label.Text = bind.key.Name
  1109. bind.label.Size = UDim2.new(0,-bind.label.TextBounds.X-8,1,-4)
  1110. end
  1111.  
  1112. local a = tick()
  1113. local function holdKey()
  1114. RunService:BindToRenderStep(a .. bind.key.Name, 1, function()
  1115. if bind.holding == false or not bind.hold then
  1116. RunService:UnbindFromRenderStep(a .. bind.key.Name)
  1117. end
  1118. _function()
  1119. end)
  1120. return _function(true)
  1121. end
  1122.  
  1123. UserInputService.InputBegan:connect(function(input)
  1124. if bind.binding then
  1125. if input.KeyCode == Enum.KeyCode.Backspace then
  1126. setKey(bind.key)
  1127. bind.binding = false
  1128. else
  1129. if not keyCheck(input.KeyCode, blacklistedKeys) then
  1130. setKey(input.KeyCode)
  1131. bind.binding = false
  1132. end
  1133. if keyCheck(input.UserInputType, whitelistedMouse) then
  1134. setKey(input.UserInputType)
  1135. bind.binding = false
  1136. end
  1137. end
  1138. else
  1139. if library.settings.modal and window.main.Visible then
  1140. return
  1141. end
  1142. if input.KeyCode.Name == bind.key.Name or input.UserInputType.Name == bind.key.Name then
  1143. bind.holding = true
  1144. if bind.hold then
  1145. holdKey()
  1146. else
  1147. _function()
  1148. end
  1149. end
  1150. end
  1151. end)
  1152.  
  1153. UserInputService.InputEnded:connect(function(input)
  1154. if input.KeyCode.Name == bind.key.Name then
  1155. bind.holding = false
  1156. end
  1157. if input.UserInputType.Name == bind.key.Name then
  1158. bind.holding = false
  1159. end
  1160. end)
  1161.  
  1162. function bind:SetKeybind(key)
  1163. if typeof(key) == "string" then
  1164. if not keyCheck(Enum.KeyCode[key:upper()], blacklistedKeys) then
  1165. key = Enum.KeyCode[key:upper()]
  1166. end
  1167. if keyCheck(key, whitelistedMouse) then
  1168. key = Enum.UserInputType[key:upper()]
  1169. end
  1170. end
  1171. if key ~= bind.key then
  1172. RunService:UnbindFromRenderStep(a .. bind.key.Name)
  1173. end
  1174. setKey(key)
  1175. end
  1176.  
  1177. section.main.Size = UDim2.new(1,0,0,self.layout.AbsoluteContentSize.Y+16)
  1178.  
  1179. return bind
  1180. end
  1181.  
  1182. function section:AddCP(text, color3, _function, alpha)
  1183. if color3 then
  1184. if typeof(color3) == "function" then
  1185. _function = color3
  1186. color3 = Color3.fromRGB()
  1187. end
  1188. end
  1189. _function = _function or function() end
  1190. local red, green, blue = color3.r*255, color3.g*255, color3.b*255
  1191. _function = _function or function() end
  1192. local color = {color = color3, alpha = alpha}
  1193. cphue, cpsat, cpval = rgbToHsv(red,green,blue)
  1194. checkRow()
  1195. section.main.Parent = tab.row
  1196.  
  1197. color.button = library:create("TextButton", {
  1198. LayoutOrder = self.order,
  1199. Size = UDim2.new(1,0,0,library.settings.textsize + 4),
  1200. BackgroundTransparency = 1,
  1201. Text = tostring(text),
  1202. TextColor3 = library.colors.optiontext,
  1203. TextStrokeTransparency = library.settings.textstroke and 0 or 1,
  1204. Font = library.settings.font,
  1205. TextSize = library.settings.textsize,
  1206. TextXAlignment = Enum.TextXAlignment.Left,
  1207. AutoButtonColor = false,
  1208. Parent = self.content,
  1209. })
  1210.  
  1211. color.visualizebg = library:create("ImageLabel", {
  1212. Position = UDim2.new(1,-1,0,3),
  1213. Size = UDim2.new(0,-24,0,12),
  1214. BorderSizePixel = 2,
  1215. BorderColor3 = library.colors.secondaryoutline,
  1216. Image = "rbxassetid://3887014957",
  1217. ScaleType = Enum.ScaleType.Tile,
  1218. TileSize = UDim2.new(0,8,0,8),
  1219. Parent = color.button
  1220. })
  1221.  
  1222. color.visualize = library:create("Frame", {
  1223. Size = UDim2.new(1,0,1,0),
  1224. BackgroundTransparency = color.alpha,
  1225. BackgroundColor3 = color.color,
  1226. BorderSizePixel = 0,
  1227. Parent = color.visualizebg,
  1228. })
  1229.  
  1230. color.container = library:create("TextButton", {
  1231. ZIndex = 2,
  1232. Position = UDim2.new(0,-3,0,0),
  1233. Size = UDim2.new(0,-150,0,150),
  1234. BackgroundColor3 = library.colors.tabbg,
  1235. BorderColor3 = library.colors.mainoutline,
  1236. AutoButtonColor = false,
  1237. Visible = false,
  1238. Parent = color.visualize
  1239. })
  1240.  
  1241. color.HueSat = library:create("ImageLabel", {
  1242. ZIndex = 2,
  1243. Position = UDim2.new(0,5,0,5),
  1244. Size = UDim2.new(1,-25,1,-25),
  1245. BorderColor3 = library.colors.secondaryoutline,
  1246. Image = "rbxassetid://698052001",
  1247. Parent = color.container
  1248. })
  1249.  
  1250. color.pointer = library:create("Frame", {
  1251. ZIndex = 2,
  1252. AnchorPoint = Vector2.new(0.5,0.5),
  1253. Position = UDim2.new(1-cphue,0,1-cpsat,0),
  1254. Size = UDim2.new(0,4,0,4),
  1255. Rotation = 45,
  1256. BackgroundColor3 = Color3.fromRGB(255,255,255),
  1257. BorderColor3 = Color3.fromRGB(0,0,0),
  1258. Parent = color.HueSat
  1259. })
  1260.  
  1261. color.Value = library:create("ImageLabel", {
  1262. ZIndex = 2,
  1263. Position = UDim2.new(1,-15,0,5),
  1264. Size = UDim2.new(0,10,1,-25),
  1265. BorderColor3 = library.colors.secondaryoutline,
  1266. Image = "rbxassetid://3641079629",
  1267. Parent = color.container
  1268. })
  1269.  
  1270. color.pointer2 = library:create("TextLabel", {
  1271. ZIndex = 2,
  1272. AnchorPoint = Vector2.new(0,0.5),
  1273. Position = UDim2.new(1,-10,1-cpval,0),
  1274. Size = UDim2.new(0,16,0,16),
  1275. BackgroundTransparency = 1,
  1276. Text = "◄",
  1277. TextColor3 = Color3.fromRGB(0,0,0),
  1278. TextStrokeTransparency = 0,
  1279. TextStrokeColor3 = Color3.fromRGB(130,130,130),
  1280. TextSize = 6,
  1281. Parent = color.Value
  1282. })
  1283.  
  1284. color.alphabg = library:create("ImageLabel", {
  1285. ZIndex = 2,
  1286. Position = UDim2.new(0,5,1,-15),
  1287. Size = UDim2.new(1,-25,0,10),
  1288. BorderColor3 = library.colors.secondaryoutline,
  1289. Image = "rbxassetid://3887014957",
  1290. ScaleType = Enum.ScaleType.Tile,
  1291. TileSize = UDim2.new(0,10,0,10),
  1292. Parent = color.container
  1293. })
  1294.  
  1295. color.Alpha = library:create("ImageLabel", {
  1296. ZIndex = 2,
  1297. Size = UDim2.new(1,0,1,0),
  1298. BackgroundTransparency = 1,
  1299. Image = "rbxassetid://3887017050",
  1300. ImageColor3 = color3,
  1301. Parent = color.alphabg
  1302. })
  1303.  
  1304. color.pointer3 = library:create("TextLabel", {
  1305. ZIndex = 2,
  1306. AnchorPoint = Vector2.new(0.5,0),
  1307. Position = UDim2.new(color.alpha,0,1,-10),
  1308. Size = UDim2.new(0,16,0,16),
  1309. BackgroundTransparency = 1,
  1310. Text = "▲",
  1311. TextColor3 = Color3.fromRGB(0,0,0),
  1312. TextStrokeTransparency = 0,
  1313. TextStrokeColor3 = Color3.fromRGB(130,130,130),
  1314. TextSize = 6,
  1315. Parent = color.Alpha
  1316. })
  1317.  
  1318. self.order = self.order + 1
  1319.  
  1320. color.button.InputBegan:connect(function(input)
  1321. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1322. focusOnOption(color.container)
  1323. closeWindow(color.container)
  1324. color.container.Visible = not color.container.Visible
  1325. if color.container.Visible then
  1326. cphue, cpsat, cpval = rgbToHsv(red,green,blue)
  1327. end
  1328. end
  1329. end)
  1330.  
  1331. color.container.InputBegan:connect(function(input)
  1332. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1333. focusOnOption(color.container)
  1334. end
  1335. end)
  1336.  
  1337. color.HueSat.InputBegan:connect(function(input)
  1338. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1339. cppicking = true
  1340. input.Changed:connect(function()
  1341. if input.UserInputState == Enum.UserInputState.End then
  1342. cppicking = false
  1343. end
  1344. end)
  1345. x, y, cphue, cpsat = updateHueSat(input, color.HueSat, cphue, cpsat)
  1346. color.pointer.Position = UDim2.new(x,0,y,0)
  1347. color.color = Color3.fromHSV(cphue,cpsat,cpval)
  1348. color.visualize.BackgroundColor3 = color.color
  1349. color.Alpha.ImageColor3 = color.color
  1350. cpt = color
  1351. cpf = _function
  1352. return _function(color.color)
  1353. end
  1354. end)
  1355.  
  1356. color.Value.InputBegan:connect(function(input)
  1357. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1358. cppickingVal = true
  1359. input.Changed:connect(function()
  1360. if input.UserInputState == Enum.UserInputState.End then
  1361. cppickingVal = false
  1362. end
  1363. end)
  1364. local y, cpval = updateValue(input, color.Value, cpval)
  1365. color.pointer2.Position = UDim2.new(1,-10,y,0)
  1366. color.color = Color3.fromHSV(cphue,cpsat,cpval)
  1367. color.visualize.BackgroundColor3 = color.color
  1368. color.Alpha.ImageColor3 = color.color
  1369. cpt = color
  1370. cpf = _function
  1371. return _function(color.color)
  1372. end
  1373. end)
  1374.  
  1375. color.Alpha.InputBegan:connect(function(input)
  1376. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1377. cppickingAlpha = true
  1378. input.Changed:connect(function()
  1379. if input.UserInputState == Enum.UserInputState.End then
  1380. cppickingAlpha = false
  1381. end
  1382. end)
  1383. local x, cpalpha = updateAlpha(input, color.Alpha, cpalpha)
  1384. color.pointer3.Position = UDim2.new(x,0,1,-10)
  1385. color.alpha = 1-cpalpha
  1386. cpt = color
  1387. cpf = _function
  1388. return _function(color.color, color.alpha)
  1389. end
  1390. end)
  1391.  
  1392. function color:SetColor(newColor)
  1393. color.color = newColor
  1394. local red, green, blue = newColor.r*255, newColor.g*255, newColor.b*255
  1395. local hue, sat, val = rgbToHsv(red,green,blue)
  1396. color.pointer.Position = UDim2.new(1-hue,0,1-sat,0)
  1397. color.pointer2.Position = UDim2.new(1,-10,1-val,0)
  1398. color.visualize.BackgroundColor3 = color.color
  1399. color.Alpha.ImageColor3 = color.color
  1400. _function(color.color)
  1401. end
  1402.  
  1403. function color:SetAlpha(newAlpha)
  1404. color.alpha = newAlpha
  1405. color.pointer3.Position = UDim2.new(color.alpha,0,1,-10)
  1406. color.visualize.BackgroundTransparency = color.alpha
  1407. _function(color.color, color.alpha)
  1408. end
  1409.  
  1410. section.main.Size = UDim2.new(1,0,0,self.layout.AbsoluteContentSize.Y+16)
  1411.  
  1412. return color
  1413. end
  1414.  
  1415. return section
  1416. end
  1417.  
  1418. return tab
  1419. end
  1420.  
  1421. return window
  1422. end
  1423.  
  1424. UserInputService.InputBegan:connect(function(input)
  1425. if input.KeyCode == library.settings.toggle then
  1426. library.pointer.Visible = not library.pointer.Visible
  1427. for _, window in next, library.windows do
  1428. if window.close == true then
  1429. window.main.Visible = not window.main.Visible
  1430. else
  1431. if not window.main.Visible then
  1432. window.main.Visible = true
  1433. end
  1434. end
  1435. end
  1436. if library.windows[1].main.Visible and library.settings.modal then
  1437. library.windows[1].main.Modal = library.windows[1].main.Visible
  1438. end
  1439. end
  1440. end)
  1441.  
  1442. UserInputService.InputChanged:connect(function(input)
  1443. if input.UserInputType == Enum.UserInputType.MouseMovement then
  1444. library.pointer.Position = UDim2.new(0,UserInputService:GetMouseLocation().X+1,0,UserInputService:GetMouseLocation().Y-35)
  1445. end
  1446. end)
  1447.  
  1448. return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement