Advertisement
Guest User

yeet

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