Yeet A Friend Script PinkScripts - Pastebin.com (2025)

  1. -- by pinkscripts <3

  2. if game.CoreGui:FindFirstChild("PepsiUi") then

  3. game.CoreGui:FindFirstChild("PepsiUi"):Destroy()

  4. end

  5. local library = {

  6. WorkspaceName = "Name",

  7. flags = {},

  8. signals = {},

  9. objects = {},

  10. elements = {},

  11. globals = {},

  12. subs = {},

  13. colored = {},

  14. configuration = {

  15. hideKeybind = Enum.KeyCode.RightControl,

  16. smoothDragging = false,

  17. easingStyle = Enum.EasingStyle.Quart,

  18. easingDirection = Enum.EasingDirection.Out

  19. },

  20. colors = {

  21. main = Color3.fromRGB(80, 245, 245),

  22. background = Color3.fromRGB(40, 40, 40),

  23. outerBorder = Color3.fromRGB(15, 15, 15),

  24. innerBorder = Color3.fromRGB(73, 63, 73),

  25. topGradient = Color3.fromRGB(35, 35, 35),

  26. bottomGradient = Color3.fromRGB(29, 29, 29),

  27. sectionBackground = Color3.fromRGB(35, 34, 34),

  28. section = Color3.fromRGB(176, 175, 176),

  29. otherElementText = Color3.fromRGB(129, 127, 129),

  30. elementText = Color3.fromRGB(147, 145, 147),

  31. elementBorder = Color3.fromRGB(20, 20, 20),

  32. selectedOption = Color3.fromRGB(55, 55, 55),

  33. unselectedOption = Color3.fromRGB(40, 40, 40),

  34. hoveredOptionTop = Color3.fromRGB(65, 65, 65),

  35. unhoveredOptionTop = Color3.fromRGB(50, 50, 50),

  36. hoveredOptionBottom = Color3.fromRGB(45, 45, 45),

  37. unhoveredOptionBottom = Color3.fromRGB(35, 35, 35),

  38. tabText = Color3.fromRGB(185, 185, 185)

  39. },

  40. gui_parent = (function()

  41. local x, c = pcall(function()

  42. return game:GetService("CoreGui")

  43. end)

  44. if x and c then

  45. return c

  46. end

  47. x, c = pcall(function()

  48. return (game:IsLoaded() or (game.Loaded:Wait() or 1)) and game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")

  49. end)

  50. if x and c then

  51. return c

  52. end

  53. x, c = pcall(function()

  54. return game:GetService("StarterGui")

  55. end)

  56. if x and c then

  57. return c

  58. end

  59. return error("Seriously bad exploit. Can't find a place to store the GUI. Robust code can't help here.")

  60. end)(),

  61. colorpicker = false,

  62. colorpickerconflicts = {},

  63. rainbowflags = {},

  64. rainbows = 0,

  65. rainbowsg = 0

  66. }

  67. library.Subs = library.subs

  68. local library_flags = library.flags

  69. local destroyrainbows, destroyrainbowsg = nil

  70. function darkenColor(clr, intensity)

  71. if not intensity or intensity == 1 then

  72. return clr

  73. end

  74. if clr and (typeof(clr) == "Color3" or type(clr) == "table") then

  75. return Color3.new(clr.R / intensity, clr.G / intensity, clr.B / intensity)

  76. end

  77. end

  78. library.subs.darkenColor = darkenColor

  79. local __runscript = true

  80. local function wait_check(...)

  81. if __runscript then

  82. return wait(...)

  83. else

  84. wait()

  85. return false

  86. end

  87. end

  88. library.subs.Wait, library.subs.wait = wait_check, wait_check

  89. local lasthidebing = 0

  90. local temp = game:FindService("MarketplaceService") or game:GetService("MarketplaceService")

  91. local Marketplace = (temp and (cloneref and cloneref(temp))) or temp

  92. local resolvevararg, temp = nil

  93. do

  94. local lwr = string.lower

  95. function library.defaultSort(a, b)

  96. return lwr(tostring(b)) > lwr(tostring(a))

  97. end

  98. end

  99. do

  100. local varargresolve = {

  101. Window = {"Name", "Theme"},

  102. Tab = {"Name", "Image"},

  103. Section = {"Name", "Side"},

  104. Label = {"Text", "Flag", "UnloadValue", "UnloadFunc"},

  105. Toggle = {"Name", "Value", "Callback", "Flag", "Location", "LocationFlag", "UnloadValue", "UnloadFunc", "Locked", "Keybind", "Condition", "AllowDuplicateCalls"},

  106. Textbox = {"Name", "Value", "Callback", "Flag", "Location", "LocationFlag", "UnloadValue", "UnloadFunc", "Placeholder", "Type", "Min", "Max", "Decimals", "Hex", "Binary", "Base", "RichTextBox", "MultiLine", "TextScaled", "TextFont", "PreFormat", "PostFormat", "CustomProperties", "AllowDuplicateCalls"},

  107. Slider = {"Name", "Value", "Callback", "Flag", "Location", "LocationFlag", "UnloadValue", "UnloadFunc", "Min", "Max", "Decimals", "Format", "IllegalInput", "Textbox", "AllowDuplicateCalls"},

  108. Button = {"Name", "Callback", "Locked", "Condition"},

  109. Keybind = {"Name", "Value", "Callback", "Flag", "Location", "LocationFlag", "UnloadValue", "UnloadFunc", "Pressed", "KeyNames", "AllowDuplicateCalls"},

  110. Dropdown = {"Name", "Value", "Callback", "Flag", "Location", "LocationFlag", "UnloadValue", "UnloadFunc", "List", "Filter", "Method", "Nothing", "Sort", "MultiSelect", "ItemAdded", "ItemRemoved", "ItemChanged", "ItemsCleared", "ScrollUpButton", "ScrollDownButton", "ScrollButtonRate", "DisablePrecisionScrolling", "AllowDuplicateCalls"},

  111. SearchBox = {"Name", "Value", "Callback", "Flag", "Location", "LocationFlag", "UnloadValue", "UnloadFunc", "List", "Filter", "Method", "Nothing", "Sort", "MultiSelect", "ItemAdded", "ItemRemoved", "ItemChanged", "ItemsCleared", "ScrollUpButton", "ScrollDownButton", "ScrollButtonRate", "DisablePrecisionScrolling", "RegEx", "AllowDuplicateCalls"},

  112. Colorpicker = {"Name", "Value", "Callback", "Flag", "Location", "LocationFlag", "UnloadValue", "UnloadFunc", "Rainbow", "Random", "AllowDuplicateCalls"},

  113. Persistence = {"Name", "Value", "Callback", "Flag", "Location", "LocationFlag", "UnloadValue", "UnloadFunc", "Workspace", "Persistive", "Suffix", "LoadCallback", "SaveCallback", "PostLoadCallback", "PostSaveCallback", "ScrollUpButton", "ScrollDownButton", "ScrollButtonRate", "DisablePrecisionScrolling", "AllowDuplicateCalls"},

  114. Designer = {"Backdrop", "Image", "Info", "Credit"}

  115. }

  116. function resolvevararg(objtype, ...)

  117. local data = varargresolve[objtype]

  118. local t = {}

  119. if data then

  120. for index, value in next, {...} do

  121. t[data[index]] = value

  122. end

  123. end

  124. return t

  125. end

  126. end

  127. local resolvercache = {}

  128. library.resolvercache = resolvercache

  129. local function resolveid(image, flag)

  130. if image then

  131. if type(image) == "string" then

  132. if (#image > 14 and string.sub(image, 1, 13) == "rbxassetid://") or (#image > 12 and string.sub(image, 1, 11) == "rbxasset://") or (#image > 12 and string.sub(image, 1, 11) ~= "rbxthumb://") then

  133. if flag then

  134. local thing = library.elements[flag] or library.designerelements[flag]

  135. if thing and thing.Set then

  136. task.spawn(thing.Set, thing, image)

  137. end

  138. end

  139. return image

  140. end

  141. end

  142. local orig = image

  143. if resolvercache[orig] then

  144. if flag then

  145. local thing = library.elements[flag] or library.designerelements[flag]

  146. if thing and thing.Set then

  147. task.spawn(thing.Set, thing, resolvercache[orig])

  148. end

  149. end

  150. return resolvercache[orig]

  151. end

  152. image = tonumber(image) or image

  153. local succezz = pcall(function()

  154. local typ = type(image)

  155. if typ == "string" then

  156. if getsynasset then

  157. if #image > 11 and string.sub(image, 1, 11) == "synasset://" then

  158. return getsynasset(string.sub(image, 12))

  159. elseif #image > 14 and string.sub(image, 1, 14) == "synasseturl://" then

  160. local x, e = pcall(function()

  161. local codename, fixes = string.gsub(image, ".", function(c)

  162. if c:lower() == c:upper() and not tonumber(c) then

  163. return ""

  164. end

  165. end)

  166. codename = string.sub(codename, 1, 24) .. tostring(fixes)

  167. local fold = isfolder("./Function Lib")

  168. if not fold then

  169. makefolder("./Function Lib")

  170. end

  171. fold = isfolder("./Function Lib/Themes")

  172. if not fold then

  173. makefolder("./Function Lib/Themes")

  174. end

  175. fold = isfolder("./Function Lib/Themes/SynapseAssetsCache")

  176. if not fold then

  177. makefolder("./Function Lib Themes/SynapseAssetsCache")

  178. end

  179. if not fold or not isfile("./Function Lib/Themes/SynapseAssetsCache/" .. codename .. ".dat") then

  180. local res = game:HttpGet(string.sub(image, 15))

  181. if res ~= nil then

  182. writefile("./Function Lib/Themes/SynapseAssetsCache/" .. codename .. ".dat", res)

  183. end

  184. end

  185. return getsynasset(readfile("./Function Lib/Themes/SynapseAssetsCache/" .. codename .. ".dat"))

  186. end)

  187. if x and e ~= nil then

  188. return e

  189. end

  190. end

  191. end

  192. if #image < 11 or (string.sub(image, 1, 13) ~= "rbxassetid://" and string.sub(image, 1, 11) ~= "rbxasset://" and string.sub(image, 1, 11) ~= "rbxthumb://") then

  193. image = tonumber(image:gsub("%D", ""), 10) or image

  194. typ = type(image)

  195. end

  196. end

  197. if typ == "number" and image > 0 then

  198. pcall(function()

  199. local nfo = Marketplace and Marketplace:GetProductInfo(image)

  200. image = tostring(image)

  201. if nfo and nfo.AssetTypeId == 1 then

  202. image = "rbxassetid://" .. image

  203. elseif nfo.AssetTypeId == 13 then

  204. local decal = game:GetObjects("rbxassetid://" .. image)[1]

  205. image = "rbxassetid://" .. decal.Texture:match("%d+$")

  206. decal = (decal and decal:Destroy() and nil) or nil

  207. end

  208. end)

  209. else

  210. image = nil

  211. end

  212. end)

  213. if succezz and image then

  214. if orig then

  215. resolvercache[orig] = image

  216. end

  217. resolvercache[image] = image

  218. if flag then

  219. local thing = library.elements[flag] or library.designerelements[flag]

  220. if thing and thing.Set then

  221. task.spawn(thing.Set, thing, image)

  222. end

  223. end

  224. end

  225. end

  226. return image

  227. end

  228. library.subs.ResolveID = resolveid

  229. library.resolvercache = resolvercache

  230. local colored = library.colored

  231. local colors = library.colors

  232. local tweenService = game:GetService("TweenService")

  233. local updatecolors = nil

  234. do

  235. function updatecolors(tweenit)

  236. if library.objects and (#library.objects > 0 or next(library.objects)) then

  237. for _, data in next, colored do

  238. local x, e

  239. if tweenit then

  240. x, e = pcall(function()

  241. local cclr = colors[data[3]]

  242. local darkness = data[4]

  243. tweenService:Create(data[1], TweenInfo.new(tweenit, library.configuration.easingStyle, library.configuration.easingDirection), {

  244. [data[2]] = (darkness and darkness ~= 1 and darkenColor(cclr, darkness)) or cclr

  245. }):Play()

  246. end)

  247. end

  248. if not x then

  249. local x, e = pcall(function()

  250. local cclr = colors[data[3]]

  251. local darkness = data[4]

  252. data[1][data[2]] = (darkness and darkness ~= 1 and darkenColor(cclr, darkness)) or cclr

  253. end)

  254. if not x and e then

  255. warn(debug.traceback(e))

  256. end

  257. end

  258. end

  259. pcall(function()

  260. if library.Backdrop then

  261. library.Backdrop.Visible = not not library_flags["__Designer.Background.UseBackgroundImage"]

  262. library.Backdrop.Image = resolveid(library_flags["__Designer.Background.ImageAssetID"], "__Designer.Background.ImageAssetID") or ""

  263. library.Backdrop.ImageColor3 = library_flags["__Designer.Background.ImageColor"] or Color3.new(1, 1, 1)

  264. library.Backdrop.ImageTransparency = (library_flags["__Designer.Background.ImageTransparency"] or 95) / 100

  265. end

  266. end)

  267. end

  268. end

  269. library.subs.UpdateColors = updatecolors

  270. end

  271. local function updatecolorsnotween()

  272. updatecolors()

  273. end

  274. library.subs.updatecolors = updatecolors

  275. library.colors = setmetatable({}, {

  276. __index = colors,

  277. __newindex = function(_, k, v)

  278. if colors[k] ~= v then

  279. colors[k] = v

  280. spawn(updatecolorsnotween)

  281. end

  282. end

  283. })

  284. local elements = library.elements

  285. shared.libraries = shared.libraries or {}

  286. local colorpickerconflicts = library.colorpickerconflicts

  287. local keyHandler = {

  288. notAllowedKeys = {

  289. [Enum.KeyCode.Return] = true,

  290. [Enum.KeyCode.Space] = true,

  291. [Enum.KeyCode.Tab] = true,

  292. [Enum.KeyCode.Unknown] = true,

  293. [Enum.KeyCode.Backspace] = true

  294. },

  295. notAllowedMouseInputs = {

  296. [Enum.UserInputType.MouseMovement] = true,

  297. [Enum.UserInputType.MouseWheel] = true,

  298. [Enum.UserInputType.MouseButton1] = true,

  299. [Enum.UserInputType.MouseButton2] = true,

  300. [Enum.UserInputType.MouseButton3] = true

  301. },

  302. allowedKeys = {

  303. [Enum.KeyCode.LeftShift] = "LShift",

  304. [Enum.KeyCode.RightShift] = "RShift",

  305. [Enum.KeyCode.LeftControl] = "LCtrl",

  306. [Enum.KeyCode.RightControl] = "RCtrl",

  307. [Enum.KeyCode.LeftAlt] = "LAlt",

  308. [Enum.KeyCode.RightAlt] = "RAlt",

  309. [Enum.KeyCode.CapsLock] = "CAPS",

  310. [Enum.KeyCode.One] = "1",

  311. [Enum.KeyCode.Two] = "2",

  312. [Enum.KeyCode.Three] = "3",

  313. [Enum.KeyCode.Four] = "4",

  314. [Enum.KeyCode.Five] = "5",

  315. [Enum.KeyCode.Six] = "6",

  316. [Enum.KeyCode.Seven] = "7",

  317. [Enum.KeyCode.Eight] = "8",

  318. [Enum.KeyCode.Nine] = "9",

  319. [Enum.KeyCode.Zero] = "0",

  320. [Enum.KeyCode.KeypadOne] = "Num-1",

  321. [Enum.KeyCode.KeypadTwo] = "Num-2",

  322. [Enum.KeyCode.KeypadThree] = "Num-3",

  323. [Enum.KeyCode.KeypadFour] = "Num-4",

  324. [Enum.KeyCode.KeypadFive] = "Num-5",

  325. [Enum.KeyCode.KeypadSix] = "Num-6",

  326. [Enum.KeyCode.KeypadSeven] = "Num-7",

  327. [Enum.KeyCode.KeypadEight] = "Num-8",

  328. [Enum.KeyCode.KeypadNine] = "Num-9",

  329. [Enum.KeyCode.KeypadZero] = "Num-0",

  330. [Enum.KeyCode.Minus] = "-",

  331. [Enum.KeyCode.Equals] = "=",

  332. [Enum.KeyCode.Tilde] = "~",

  333. [Enum.KeyCode.LeftBracket] = "[",

  334. [Enum.KeyCode.RightBracket] = "]",

  335. [Enum.KeyCode.RightParenthesis] = ")",

  336. [Enum.KeyCode.LeftParenthesis] = "(",

  337. [Enum.KeyCode.Semicolon] = ";",

  338. [Enum.KeyCode.Quote] = "'",

  339. [Enum.KeyCode.BackSlash] = "\\",

  340. [Enum.KeyCode.Comma] = ",",

  341. [Enum.KeyCode.Period] = ".",

  342. [Enum.KeyCode.Slash] = "/",

  343. [Enum.KeyCode.Asterisk] = "*",

  344. [Enum.KeyCode.Plus] = "+",

  345. [Enum.KeyCode.Period] = ".",

  346. [Enum.KeyCode.Backquote] = "`"

  347. }

  348. }

  349. local function hardunload(library)

  350. if library.UnloadCallback and type(library.UnloadCallback) == "function" then

  351. local x, e = pcall(library.UnloadCallback)

  352. if not x and e then

  353. task.spawn(error, e, 2)

  354. end

  355. end

  356. for cflag, data in next, elements do

  357. if data.Type ~= "Persistence" then

  358. if data.Set and data.Options.UnloadValue ~= nil then

  359. data.Set(data.Options.UnloadValue)

  360. end

  361. if data.Options.UnloadFunc then

  362. local y, u = pcall(data.Options.UnloadFunc)

  363. if not y and u then

  364. warn(debug.traceback("Error unloading '" .. tostring(cflag) .. "'\n" .. u))

  365. end

  366. end

  367. end

  368. end

  369. for _, v in next, {library.signals, library.objects} do

  370. for k, o in next, v do

  371. if o then

  372. local te = typeof(o)

  373. if te == "RBXScriptConnection" then

  374. o:Disconnect()

  375. elseif te == "Instance" then

  376. o:Destroy()

  377. end

  378. end

  379. v[k] = nil

  380. end

  381. end

  382. library.signals = nil

  383. library.objects = nil

  384. end

  385. library.Subs.UnloadArg = hardunload

  386. local function unloadall()

  387. if shared.libraries then

  388. local b = 50

  389. while #shared.libraries > 0 do

  390. b = b - 1

  391. if b < 0 then

  392. b = 50

  393. wait(warn("Looped 50 times while unloading....?"))

  394. end

  395. local v = shared.libraries[1]

  396. if v and v.unload and type(v.unload) == "function" then

  397. if not pcall(v.unload) then

  398. pcall(hardunload, v)

  399. for k in next, v do

  400. v[k] = nil

  401. end

  402. end

  403. table.remove(shared.libraries, 1)

  404. end

  405. end

  406. end

  407. shared.libraries = nil

  408. end

  409. shared.unloadall = unloadall

  410. library.unloadall = unloadall

  411. shared.libraries[1 + #shared.libraries] = library

  412. function library.unload()

  413. __runscript = nil

  414. hardunload(library)

  415. if shared.libraries then

  416. for k, v in next, shared.libraries or {} do

  417. if v == library then

  418. for k in next, table.remove(shared.libraries, k) do

  419. v[k] = nil

  420. end

  421. break

  422. end

  423. end

  424. if #shared.libraries == 0 then

  425. shared.libraries = nil

  426. end

  427. end

  428. warn("Unloaded")

  429. end

  430. library.Unload = library.unload

  431. local Instance_new = (syn and syn.protect_gui and function(...)

  432. local x = {Instance.new(...)}

  433. if x[1] then

  434. library.objects[1 + #library.objects] = x[1]

  435. pcall(syn.protect_gui, x[1])

  436. end

  437. return unpack(x)

  438. end) or function(...)

  439. local x = {Instance.new(...)}

  440. if x[1] then

  441. library.objects[1 + #library.objects] = x[1]

  442. end

  443. return unpack(x)

  444. end

  445. library.subs.Instance_new = Instance_new

  446. local playersservice = game:GetService("Players")

  447. local function getresolver(listt, filter, method, _)

  448. local huo, args = type(filter), {}

  449. local hou = typeof(listt)

  450. return (hou == "table" and function()

  451. return listt

  452. end) or function()

  453. local hardtype = nil

  454. local g = listt

  455. for _ = 1, 5 do

  456. hardtype = typeof(g)

  457. if hardtype == "function" then

  458. local x, e = pcall(listt)

  459. if x and e then

  460. g = e

  461. end

  462. hardtype = typeof(g)

  463. end

  464. if hardtype == "Instance" then

  465. local lastg = g

  466. if method == nil and listt == playersservice then

  467. g = listt:GetPlayers()

  468. end

  469. if method then

  470. local metype = type(method)

  471. if metype == "table" then

  472. method = method.Method or method[1]

  473. args = method.Args or method.Arguments or unpack(method, (method.Method ~= nil and 1) or 2)

  474. metype = type(method)

  475. end

  476. local y, u = nil, nil

  477. if metype == "function" then

  478. y, u = pcall(method, listt, unpack(args))

  479. elseif metype == "string" then

  480. local y, u = pcall(function()

  481. return listt[method](listt, unpack(args))

  482. end)

  483. else

  484. warn("Idk how to handle method type of", metype, debug.traceback(""))

  485. end

  486. if u then

  487. if y then

  488. g = u

  489. else

  490. warn("Error trying method", method, "on", listt, debug.traceback(u))

  491. end

  492. end

  493. end

  494. if g == lastg then

  495. g = listt:GetChildren()

  496. end

  497. end

  498. if hardtype == "Enum" then

  499. g = listt:GetEnumItems()

  500. end

  501. hardtype = typeof(g)

  502. if hardtype == "table" then

  503. break

  504. end

  505. end

  506. hardtype = typeof(g)

  507. if hardtype ~= "table" then

  508. warn("Could not resolve " .. hou .. " type to a list.")

  509. return {}

  510. end

  511. if filter then

  512. if huo == "function" then

  513. local accept = {}

  514. for _, v in next, g do

  515. local x, e = pcall(filter, v)

  516. if x and e then

  517. accept[1 + #accept] = (e == true and v) or e

  518. end

  519. end

  520. g = accept

  521. elseif huo == "string" then

  522. local accept = {}

  523. for _, v in next, g do

  524. if tostring(v):lower():find(huo) then

  525. accept[1 + #accept] = v

  526. end

  527. end

  528. g = accept

  529. elseif huo == "table" then

  530. local accept = {}

  531. if type(filter[1]) == "string" then

  532. for _, v in next, g do

  533. if tostring(v):lower():find(huo) then

  534. accept[1 + #accept] = v

  535. elseif filter[0] then

  536. accept[1 + #accept] = v

  537. end

  538. end

  539. else

  540. for _, v in next, g do

  541. if not table.find(filter, v) and not table.find(filter, tostring(v)) then

  542. accept[1 + #accept] = v

  543. elseif not filter[0] then

  544. accept[1 + #accept] = v

  545. end

  546. end

  547. end

  548. g = accept

  549. end

  550. end

  551. return g

  552. end

  553. end

  554. library.subs.GetResolver = getresolver

  555. local function resetall()

  556. destroyrainbowsg = true

  557. pcall(function()

  558. for k, v in next, elements do

  559. if v and k and v.Set and v.Default ~= nil and library_flags[k] ~= v.Default and string.sub(k, 1, 11) ~= "__Designer." then

  560. v:Set(v.Default)

  561. end

  562. end

  563. end)

  564. end

  565. library.ResetAll = resetall

  566. local textService = game:GetService("TextService")

  567. local userInputService = game:GetService("UserInputService")

  568. local runService = game:GetService("RunService")

  569. local LP = playersservice.LocalPlayer

  570. library.LP = LP

  571. library.Players = playersservice

  572. library.UserInputService = userInputService

  573. library.RunService = runService

  574. local mouse = LP and LP:GetMouse()

  575. if not mouse and PluginManager and runService:IsStudio() then

  576. shared.library_plugin = shared.library_plugin or print("Creating Studio Test-Plugin...") or PluginManager():CreatePlugin()

  577. mouse = shared.library_plugin:GetMouse()

  578. library.plugin = shared.library_plugin

  579. end

  580. library.Mouse = mouse

  581. local function textToSize(object)

  582. if object ~= nil then

  583. local output = textService:GetTextSize(object.Text, object.TextSize, object.Font, Vector2.new(math.huge, math.huge))

  584. return {

  585. X = output.X,

  586. Y = output.Y

  587. }

  588. end

  589. end

  590. library.subs.textToSize = textToSize

  591. local function removeSpaces(str)

  592. if str then

  593. local newStr = str:gsub(" ", "")

  594. return newStr

  595. end

  596. end

  597. library.subs.removeSpaces = removeSpaces

  598. local function Color3FromHex(hex)

  599. hex = hex:gsub("#", ""):upper():gsub("0X", "")

  600. return Color3.fromRGB(tonumber(hex:sub(1, 2), 16), tonumber(hex:sub(3, 4), 16), tonumber(hex:sub(5, 6), 16))

  601. end

  602. library.subs.Color3FromHex = Color3FromHex

  603. local floor = math.floor

  604. local function Color3ToHex(color)

  605. local r, g, b = string.format("%X", floor(color.R * 255)), string.format("%X", floor(color.G * 255)), string.format("%X", floor(color.B * 255))

  606. if #r < 2 then

  607. r = "0" .. r

  608. end

  609. if #g < 2 then

  610. g = "0" .. g

  611. end

  612. if #b < 2 then

  613. b = "0" .. b

  614. end

  615. return string.format("%s%s%s", r, g, b)

  616. end

  617. if Color3.ToHex and not shared.overridecolortohex then

  618. local x, e = pcall(Color3.ToHex, Color3.new())

  619. if x and type(e) == "string" and #e == 6 then

  620. Color3ToHex = Color3.ToHex

  621. end

  622. end

  623. library.subs.Color3ToHex = Color3ToHex

  624. local isDraggingSomething = false

  625. local function makeDraggable(topBarObject, object)

  626. local dragging = nil

  627. local dragInput = nil

  628. local dragStart = nil

  629. local startPosition = nil

  630. library.signals[1 + #library.signals] = topBarObject.InputBegan:Connect(function(input)

  631. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then

  632. dragging = true

  633. dragStart = input.Position

  634. startPosition = object.Position

  635. input.Changed:Connect(function()

  636. if input.UserInputState == Enum.UserInputState.End then

  637. dragging = false

  638. end

  639. end)

  640. end

  641. end)

  642. library.signals[1 + #library.signals] = topBarObject.InputChanged:Connect(function(input)

  643. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then

  644. dragInput = input

  645. end

  646. end)

  647. library.signals[1 + #library.signals] = userInputService.InputChanged:Connect(function(input)

  648. if input == dragInput and dragging then

  649. local delta = input.Position - dragStart

  650. if not isDraggingSomething and library.configuration.smoothDragging then

  651. tweenService:Create(object, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  652. Position = UDim2.new(startPosition.X.Scale, startPosition.X.Offset + delta.X, startPosition.Y.Scale, startPosition.Y.Offset + delta.Y)

  653. }):Play()

  654. elseif not isDraggingSomething and not library.configuration.smoothDragging then

  655. object.Position = UDim2.new(startPosition.X.Scale, startPosition.X.Offset + delta.X, startPosition.Y.Scale, startPosition.Y.Offset + delta.Y)

  656. end

  657. end

  658. end)

  659. end

  660. library.subs.makeDraggable = makeDraggable

  661. local JSONEncode, JSONDecode = nil, nil

  662. do

  663. local temp_http = game:FindService("HttpService") or game:GetService("HttpService")

  664. local httpservice = temp_http

  665. if cloneref and type(cloneref) == "function" then

  666. httpservice, temp_http = cloneref(httpservice), nil

  667. end

  668. library.Http = httpservice

  669. local JSONEncodeFunc = httpservice.JSONEncode

  670. function JSONEncode(...)

  671. return pcall(JSONEncodeFunc, httpservice, ...)

  672. end

  673. library.JSONEncode = JSONEncode

  674. local JSONDecodeFunc = httpservice.JSONDecode

  675. function JSONDecode(...)

  676. return pcall(JSONDecodeFunc, httpservice, ...)

  677. end

  678. library.JSONDecode = JSONDecode

  679. end

  680. local convertfilename

  681. do

  682. local string_gsub = string.gsub

  683. function convertfilename(str, default, replace)

  684. replace = replace or "_"

  685. local corrections = 0

  686. local predname = string_gsub(str, "%W", function(c)

  687. local byt = c:byte()

  688. if not (byt == 0 or byt == 32 or byt == 33 or byt == 59 or byt == 61 or (byt >= 35 and byt <= 41) or (byt >= 43 and byt <= 57) or (byt >= 64 and byt <= 123) or (byt >= 125 and byt <= 127)) then

  689. corrections = 1 + corrections

  690. return replace

  691. end

  692. end)

  693. return (default and corrections == #predname and tostring(default)) or predname

  694. end

  695. library.subs.ConvertFilename = convertfilename

  696. end

  697. function library:CreateWindow(options, ...)

  698. options = (options and type(options) == "string" and resolvevararg("Window", options, ...)) or options

  699. local homepage = nil

  700. local windowoptions = options

  701. local windowName = options.Name or "Unnamed Window"

  702. options.Name = windowName

  703. if windowName and #windowName > 0 and library.WorkspaceName == "Function Lib" then

  704. library.WorkspaceName = convertfilename(windowName, "Function Lib")

  705. end

  706. local FunctionLibrary = Instance_new("ScreenGui")

  707. local main = Instance_new("Frame")

  708. local mainBorder = Instance_new("Frame")

  709. local tabSlider = Instance_new("Frame")

  710. local innerMain = Instance_new("Frame")

  711. local innerMainBorder = Instance_new("Frame")

  712. local innerBackdrop = Instance_new("ImageLabel")

  713. local innerMainHolder = Instance_new("Frame")

  714. local tabsHolder = Instance_new("ImageLabel")

  715. local tabHolderList = Instance_new("UIListLayout")

  716. local tabHolderPadding = Instance_new("UIPadding")

  717. local headline = Instance_new("TextLabel")

  718. local splitter = Instance_new("TextLabel")

  719. local submenuOpen = nil

  720. library.globals["__Window" .. options.Name] = {

  721. submenuOpen = submenuOpen

  722. }

  723. FunctionLibrary.Name = "PepsiUi"

  724. FunctionLibrary.Parent = library.gui_parent

  725. FunctionLibrary.ZIndexBehavior = Enum.ZIndexBehavior.Sibling

  726. FunctionLibrary.DisplayOrder = 10

  727. FunctionLibrary.ResetOnSpawn = false

  728. main.Name = "main"

  729. main.Parent = FunctionLibrary

  730. main.AnchorPoint = Vector2.new(0.5, 0.5)

  731. main.BackgroundColor3 = library.colors.background

  732. colored[1 + #colored] = {main, "BackgroundColor3", "background"}

  733. main.BorderColor3 = library.colors.outerBorder

  734. colored[1 + #colored] = {main, "BorderColor3", "outerBorder"}

  735. main.Position = UDim2.fromScale(0.5, 0.5)

  736. main.Size = UDim2.fromOffset(500, 545)

  737. makeDraggable(main, main)

  738. mainBorder.Name = "mainBorder"

  739. mainBorder.Parent = main

  740. mainBorder.AnchorPoint = Vector2.new(0.5, 0.5)

  741. mainBorder.BackgroundColor3 = library.colors.background

  742. colored[1 + #colored] = {mainBorder, "BackgroundColor3", "background"}

  743. mainBorder.BorderColor3 = library.colors.innerBorder

  744. colored[1 + #colored] = {mainBorder, "BorderColor3", "innerBorder"}

  745. mainBorder.BorderMode = Enum.BorderMode.Inset

  746. mainBorder.Position = UDim2.fromScale(0.5, 0.5)

  747. mainBorder.Size = UDim2.fromScale(1, 1)

  748. innerMain.Name = "innerMain"

  749. innerMain.Parent = main

  750. innerMain.AnchorPoint = Vector2.new(0.5, 0.5)

  751. innerMain.BackgroundColor3 = library.colors.background

  752. colored[1 + #colored] = {innerMain, "BackgroundColor3", "background"}

  753. innerMain.BorderColor3 = library.colors.outerBorder

  754. colored[1 + #colored] = {innerMain, "BorderColor3", "outerBorder"}

  755. innerMain.Position = UDim2.fromScale(0.5, 0.5)

  756. innerMain.Size = UDim2.new(1, -14, 1, -14)

  757. innerMainBorder.Name = "innerMainBorder"

  758. innerMainBorder.Parent = innerMain

  759. innerMainBorder.AnchorPoint = Vector2.new(0.5, 0.5)

  760. innerMainBorder.BackgroundColor3 = library.colors.background

  761. colored[1 + #colored] = {innerMainBorder, "BackgroundColor3", "background"}

  762. innerMainBorder.BorderColor3 = library.colors.innerBorder

  763. colored[1 + #colored] = {innerMainBorder, "BorderColor3", "innerBorder"}

  764. innerMainBorder.BorderMode = Enum.BorderMode.Inset

  765. innerMainBorder.Position = UDim2.fromScale(0.5, 0.5)

  766. innerMainBorder.Size = UDim2.fromScale(1, 1)

  767. innerMainHolder.Name = "innerMainHolder"

  768. innerMainHolder.Parent = innerMain

  769. innerMainHolder.BackgroundColor3 = Color3.new(1, 1, 1)

  770. innerMainHolder.BackgroundTransparency = 1

  771. innerMainHolder.Position = UDim2:fromOffset(25)

  772. innerMainHolder.Size = UDim2.new(1, 0, 1, -25)

  773. innerBackdrop.Name = "innerBackdrop"

  774. innerBackdrop.Parent = innerMainHolder

  775. innerBackdrop.BackgroundColor3 = Color3.new(1, 1, 1)

  776. innerBackdrop.BackgroundTransparency = 1

  777. innerBackdrop.Size = UDim2.fromScale(1, 1)

  778. innerBackdrop.ZIndex = -1

  779. innerBackdrop.Visible = not not library_flags["__Designer.Background.UseBackgroundImage"]

  780. innerBackdrop.ImageColor3 = library_flags["__Designer.Background.ImageColor"] or Color3.new(1, 1, 1)

  781. innerBackdrop.ImageTransparency = (library_flags["__Designer.Background.ImageTransparency"] or 95) / 100

  782. innerBackdrop.Image = resolveid(library_flags["__Designer.Background.ImageAssetID"], "__Designer.Background.ImageAssetID") or ""

  783. library.Backdrop = innerBackdrop

  784. tabsHolder.Name = "tabsHolder"

  785. tabsHolder.Parent = innerMain

  786. tabsHolder.BackgroundColor3 = library.colors.topGradient

  787. colored[1 + #colored] = {tabsHolder, "BackgroundColor3", "topGradient"}

  788. tabsHolder.BorderSizePixel = 0

  789. tabsHolder.Position = UDim2.fromOffset(1, 1)

  790. tabsHolder.Size = UDim2.new(1, -2, 0, 23)

  791. tabsHolder.Image = "rbxassetid://2454009026"

  792. tabsHolder.ImageColor3 = library.colors.bottomGradient

  793. colored[1 + #colored] = {tabsHolder, "ImageColor3", "bottomGradient"}

  794. tabHolderList.Name = "tabHolderList"

  795. tabHolderList.Parent = tabsHolder

  796. tabHolderList.FillDirection = Enum.FillDirection.Horizontal

  797. tabHolderList.SortOrder = Enum.SortOrder.LayoutOrder

  798. tabHolderList.VerticalAlignment = Enum.VerticalAlignment.Center

  799. tabHolderList.Padding = UDim:new(3)

  800. tabHolderPadding.Name = "tabHolderPadding"

  801. tabHolderPadding.Parent = tabsHolder

  802. tabHolderPadding.PaddingLeft = UDim:new(7)

  803. headline.Name = "headline"

  804. headline.Parent = tabsHolder

  805. headline.BackgroundColor3 = Color3.new(1, 1, 1)

  806. headline.BackgroundTransparency = 1

  807. headline.LayoutOrder = 1

  808. headline.Font = Enum.Font.Code

  809. headline.Text = (windowName and tostring(windowName)) or "???"

  810. headline.TextColor3 = library.colors.main

  811. colored[1 + #colored] = {headline, "TextColor3", "main"}

  812. headline.TextSize = 14

  813. headline.TextStrokeColor3 = library.colors.outerBorder

  814. colored[1 + #colored] = {headline, "TextStrokeColor3", "outerBorder"}

  815. headline.TextStrokeTransparency = 0.75

  816. headline.Size = UDim2:new(textToSize(headline).X + 4, 1)

  817. splitter.Name = "splitter"

  818. splitter.Parent = tabsHolder

  819. splitter.BackgroundColor3 = Color3.new(1, 1, 1)

  820. splitter.BackgroundTransparency = 1

  821. splitter.LayoutOrder = 2

  822. splitter.Size = UDim2:new(6, 1)

  823. splitter.Font = Enum.Font.Code

  824. splitter.Text = "|"

  825. splitter.TextColor3 = library.colors.tabText

  826. colored[1 + #colored] = {splitter, "TextColor3", "tabText"}

  827. splitter.TextSize = 14

  828. splitter.TextStrokeColor3 = library.colors.tabText

  829. colored[1 + #colored] = {splitter, "TextStrokeColor3", "tabText"}

  830. splitter.TextStrokeTransparency = 0.75

  831. tabSlider.Name = "tabSlider"

  832. tabSlider.Parent = main

  833. tabSlider.BackgroundColor3 = library.colors.main

  834. colored[1 + #colored] = {tabSlider, "BackgroundColor3", "main"}

  835. tabSlider.BorderSizePixel = 0

  836. tabSlider.Position = UDim2.fromOffset(100, 30)

  837. tabSlider.Size = UDim2:fromOffset(1)

  838. tabSlider.Visible = false

  839. do

  840. local os_clock = os.clock

  841. library.signals[1 + #library.signals] = userInputService.InputBegan:Connect(function(keyCode, gameProcessedEvent)

  842. gameProcessedEvent = gameProcessedEvent or userInputService:GetFocusedTextBox()

  843. if not gameProcessedEvent and keyCode.KeyCode == library.configuration.hideKeybind then

  844. if not lasthidebing or os_clock() - lasthidebing > 12 then

  845. main.Visible = not main.Visible

  846. end

  847. lasthidebing = nil

  848. end

  849. end)

  850. end

  851. local windowFunctions = {

  852. tabCount = 0,

  853. selected = {},

  854. Flags = elements

  855. }

  856. library.globals["__Window" .. windowName].windowFunctions = windowFunctions

  857. function windowFunctions:Show(x)

  858. main.Visible = x == nil or x == true or x == 1

  859. end

  860. function windowFunctions:Hide(x)

  861. main.Visible = x == false or x == 0

  862. end

  863. function windowFunctions:Visibility(x)

  864. if x == nil then

  865. main.Visible = not main.Visible

  866. else

  867. main.Visible = not not x

  868. end

  869. end

  870. function windowFunctions:MoveTabSlider(tabObject)

  871. spawn(function()

  872. tabSlider.Visible = true

  873. tweenService:Create(tabSlider, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  874. Size = UDim2.fromOffset(tabObject.AbsoluteSize.X, 1),

  875. Position = UDim2.fromOffset(tabObject.AbsolutePosition.X, tabObject.AbsolutePosition.Y + tabObject.AbsoluteSize.Y) - UDim2.fromOffset(main.AbsolutePosition.X, main.AbsolutePosition.Y)

  876. }):Play()

  877. end)

  878. end

  879. windowFunctions.LastTab = nil

  880. function windowFunctions:CreateTab(options, ...)

  881. options = (options and type(options) == "string" and resolvevararg("Tab", options, ...)) or options or {

  882. Name = "Function Style: Elite Hax"

  883. }

  884. local image = options.Image

  885. if image then

  886. image = resolveid(image)

  887. end

  888. local tabName = options.Name or "Unnamed Tab"

  889. options.Name = tabName

  890. windowFunctions.tabCount = windowFunctions.tabCount + 1

  891. local newTab = Instance_new((image and "ImageButton") or "TextButton")

  892. local newTabHolder = Instance_new("Frame")

  893. library.globals["__Window" .. windowName].newTabHolder = newTabHolder

  894. local left = Instance_new("ScrollingFrame")

  895. local leftList = Instance_new("UIListLayout")

  896. local leftPadding = Instance_new("UIPadding")

  897. local right = Instance_new("ScrollingFrame")

  898. local rightList = Instance_new("UIListLayout")

  899. local rightPadding = Instance_new("UIPadding")

  900. newTab.Name = removeSpaces((tabName and tostring(tabName):lower() or "???") .. "Tab")

  901. newTab.Parent = tabsHolder

  902. newTab.BackgroundTransparency = 1

  903. newTab.LayoutOrder = (options.LastTab and 99999) or tonumber(options.TabOrder or options.LayoutOrder) or (2 + windowFunctions.tabCount)

  904. local colored_newTab_TextColor3 = nil

  905. if image then

  906. newTab.Image = image

  907. newTab.ImageColor3 = options.ImageColor or options.Color or Color3.new(1, 1, 1)

  908. newTab.Size = UDim2:new(tabsHolder.AbsoluteSize.Y, 1)

  909. else

  910. colored_newTab_TextColor3 = {newTab, "TextColor3", "tabText"}

  911. colored[1 + #colored] = colored_newTab_TextColor3

  912. newTab.Font = Enum.Font.Code

  913. newTab.Text = (tabName and tostring(tabName)) or "???"

  914. if windowFunctions.tabCount ~= 1 then

  915. colored_newTab_TextColor3[4] = 1.35

  916. newTab.TextColor3 = darkenColor(library.colors.tabText, 1.35)

  917. else

  918. newTab.TextColor3 = library.colors.tabText

  919. end

  920. newTab.TextSize = 14

  921. newTab.TextStrokeColor3 = Color3.fromRGB(42, 42, 42)

  922. newTab.TextStrokeTransparency = 0.75

  923. newTab.Size = UDim2:new(textToSize(newTab).X + 4, 1)

  924. end

  925. local function goto()

  926. if not library.colorpicker and not submenuOpen and windowFunctions.selected.button ~= newTab then

  927. pcall(function()

  928. for _, e in next, library.elements do

  929. if e and type(e) == "table" and e.Update then

  930. pcall(e.Update)

  931. end

  932. end

  933. end)

  934. if windowFunctions.LastTab then

  935. windowFunctions.LastTab[4] = 1.35

  936. end

  937. windowFunctions:MoveTabSlider(newTab)

  938. if windowFunctions.selected.button.ClassName == "TextButton" then

  939. tweenService:Create(windowFunctions.selected.button, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  940. TextColor3 = darkenColor(library.colors.tabText, 1.35)

  941. }):Play()

  942. end

  943. if colored_newTab_TextColor3 then

  944. colored_newTab_TextColor3[4] = nil

  945. end

  946. windowFunctions.selected.holder.Visible = false

  947. windowFunctions.selected.button = newTab

  948. windowFunctions.selected.holder = newTabHolder

  949. if windowFunctions.selected.button.ClassName == "TextButton" then

  950. tweenService:Create(windowFunctions.selected.button, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  951. TextColor3 = library.colors.tabText

  952. }):Play()

  953. end

  954. windowFunctions.selected.holder.Visible = true

  955. windowFunctions.LastTab = colored_newTab_TextColor3

  956. end

  957. end

  958. if not homepage and newTab.LayoutOrder <= 4 then

  959. homepage = goto

  960. end

  961. library.signals[1 + #library.signals] = newTab.MouseButton1Click:Connect(goto)

  962. if windowFunctions.tabCount == 1 then

  963. tabSlider.Size = UDim2.fromOffset(newTab.AbsoluteSize.X, 1)

  964. tabSlider.Position = UDim2.fromOffset(newTab.AbsolutePosition.X, newTab.AbsolutePosition.Y + newTab.AbsoluteSize.Y) - UDim2.fromOffset(main.AbsolutePosition.X, main.AbsolutePosition.Y)

  965. tabSlider.Visible = true

  966. windowFunctions.selected.holder = newTabHolder

  967. windowFunctions.selected.button = newTab

  968. end

  969. newTabHolder.Name = removeSpaces((tabName and tabName:lower()) or "???") .. "TabHolder"

  970. newTabHolder.Parent = innerMainHolder

  971. newTabHolder.BackgroundColor3 = Color3.new(1, 1, 1)

  972. newTabHolder.BackgroundTransparency = 1

  973. newTabHolder.Size = UDim2.fromScale(1, 1)

  974. newTabHolder.Visible = windowFunctions.tabCount == 1

  975. left.Name = "left"

  976. left.Parent = newTabHolder

  977. left.BackgroundColor3 = Color3.new(1, 1, 1)

  978. left.BackgroundTransparency = 1

  979. left.Size = UDim2.fromScale(0.5, 1)

  980. left.CanvasSize = UDim2.new()

  981. left.ScrollBarThickness = 0

  982. leftList.Name = "leftList"

  983. leftList.Parent = left

  984. leftList.HorizontalAlignment = Enum.HorizontalAlignment.Center

  985. leftList.SortOrder = Enum.SortOrder.LayoutOrder

  986. leftList.Padding = UDim:new(14)

  987. leftPadding.Name = "leftPadding"

  988. leftPadding.Parent = left

  989. leftPadding.PaddingTop = UDim:new(12)

  990. right.Name = "right"

  991. right.Parent = newTabHolder

  992. right.BackgroundColor3 = Color3.new(1, 1, 1)

  993. right.BackgroundTransparency = 1

  994. right.Size = UDim2.fromScale(0.5, 1)

  995. right.CanvasSize = UDim2.new()

  996. right.ScrollBarThickness = 0

  997. right.Position = UDim2.new(0.5)

  998. rightList.Name = "rightList"

  999. rightList.Parent = right

  1000. rightList.HorizontalAlignment = Enum.HorizontalAlignment.Center

  1001. rightList.SortOrder = Enum.SortOrder.LayoutOrder

  1002. rightList.Padding = UDim:new(14)

  1003. rightPadding.Name = "rightPadding"

  1004. rightPadding.Parent = right

  1005. rightPadding.PaddingTop = UDim:new(12)

  1006. local tabFunctions = {

  1007. Flags = {}

  1008. }

  1009. function tabFunctions:CreateSection(options, ...)

  1010. options = (options and type(options) == "string" and resolvevararg("Tab", options, ...)) or options

  1011. local sectionName, holderSide = options.Name or "Unnamed Section", options.Side

  1012. options.Name = sectionName

  1013. local newSection = Instance_new("Frame")

  1014. local newSectionBorder = Instance_new("Frame")

  1015. local insideBorderHider = Instance_new("Frame")

  1016. local outsideBorderHider = Instance_new("Frame")

  1017. local sectionHolder = Instance_new("Frame")

  1018. local sectionList = Instance_new("UIListLayout")

  1019. local sectionPadding = Instance_new("UIPadding")

  1020. local sectionHeadline = Instance_new("TextLabel")

  1021. colorpickerconflicts[1 + #colorpickerconflicts] = insideBorderHider

  1022. colorpickerconflicts[1 + #colorpickerconflicts] = outsideBorderHider

  1023. colorpickerconflicts[1 + #colorpickerconflicts] = sectionHeadline

  1024. newSection.Name = removeSpaces((sectionName and sectionName:lower() or "???") .. "Section")

  1025. newSection.Parent = (holderSide and ((holderSide:lower() == "left" and left) or right)) or left

  1026. newSection.BackgroundColor3 = library.colors.sectionBackground

  1027. colored[1 + #colored] = {newSection, "BackgroundColor3", "sectionBackground"}

  1028. newSection.BorderColor3 = library.colors.outerBorder

  1029. colored[1 + #colored] = {newSection, "BorderColor3", "outerBorder"}

  1030. newSection.Size = UDim2.new(1, -20)

  1031. newSection.Visible = false

  1032. newSectionBorder.Name = "newSectionBorder"

  1033. newSectionBorder.Parent = newSection

  1034. newSectionBorder.BackgroundColor3 = library.colors.sectionBackground

  1035. colored[1 + #colored] = {newSectionBorder, "BackgroundColor3", "sectionBackground"}

  1036. newSectionBorder.BorderColor3 = library.colors.innerBorder

  1037. colored[1 + #colored] = {newSectionBorder, "BorderColor3", "innerBorder"}

  1038. newSectionBorder.BorderMode = Enum.BorderMode.Inset

  1039. newSectionBorder.Size = UDim2.fromScale(1, 1)

  1040. sectionHolder.Name = "sectionHolder"

  1041. sectionHolder.Parent = newSection

  1042. sectionHolder.BackgroundColor3 = Color3.new(1, 1, 1)

  1043. sectionHolder.BackgroundTransparency = 1

  1044. sectionHolder.Size = UDim2.fromScale(1, 1)

  1045. sectionList.Name = "sectionList"

  1046. sectionList.Parent = sectionHolder

  1047. sectionList.HorizontalAlignment = Enum.HorizontalAlignment.Center

  1048. sectionList.SortOrder = Enum.SortOrder.LayoutOrder

  1049. sectionList.Padding = UDim:new(1)

  1050. sectionPadding.Name = "sectionPadding"

  1051. sectionPadding.Parent = sectionHolder

  1052. sectionPadding.PaddingTop = UDim:new(9)

  1053. sectionHeadline.Name = "sectionHeadline"

  1054. sectionHeadline.Parent = newSection

  1055. sectionHeadline.BackgroundColor3 = Color3.new(1, 1, 1)

  1056. sectionHeadline.BackgroundTransparency = 1

  1057. sectionHeadline.Position = UDim2.fromOffset(18, -8)

  1058. sectionHeadline.ZIndex = 2

  1059. sectionHeadline.Font = Enum.Font.Code

  1060. sectionHeadline.LineHeight = 1.15

  1061. sectionHeadline.Text = (sectionName and sectionName or "???")

  1062. sectionHeadline.TextColor3 = library.colors.section

  1063. colored[1 + #colored] = {sectionHeadline, "TextColor3", "section"}

  1064. sectionHeadline.TextSize = 14

  1065. sectionHeadline.Size = UDim2.fromOffset(textToSize(sectionHeadline).X + 4, 12)

  1066. insideBorderHider.Name = "insideBorderHider"

  1067. insideBorderHider.Parent = newSection

  1068. insideBorderHider.BackgroundColor3 = library.colors.sectionBackground

  1069. colored[1 + #colored] = {insideBorderHider, "BackgroundColor3", "sectionBackground"}

  1070. insideBorderHider.BorderSizePixel = 0

  1071. insideBorderHider.Position = UDim2.fromOffset(15)

  1072. insideBorderHider.Size = UDim2.fromOffset(sectionHeadline.AbsoluteSize.X + 3, 1)

  1073. outsideBorderHider.Name = "outsideBorderHider"

  1074. outsideBorderHider.Parent = newSection

  1075. outsideBorderHider.BackgroundColor3 = library.colors.background

  1076. colored[1 + #colored] = {outsideBorderHider, "BackgroundColor3", "background"}

  1077. outsideBorderHider.BorderSizePixel = 0

  1078. outsideBorderHider.Position = UDim2.fromOffset(15, -1)

  1079. outsideBorderHider.Size = UDim2.fromOffset(sectionHeadline.AbsoluteSize.X + 3, 1)

  1080. local sectionFunctions = {

  1081. Flags = {}

  1082. }

  1083. function sectionFunctions:Update(extra)

  1084. local currentHolder = newSection.Parent

  1085. if not newSection.Visible then

  1086. newSection.Visible = true

  1087. end

  1088. newSection.Size = UDim2.new(1, -20, 0, (sectionList.AbsoluteContentSize.Y + 15))

  1089. currentHolder.CanvasSize = UDim2:fromOffset(currentHolder:FindFirstChildOfClass("UIListLayout").AbsoluteContentSize.Y + 22 + (extra and extra or 0))

  1090. end

  1091. function sectionFunctions:AddToggle(options, ...)

  1092. options = (options and type(options) == "string" and resolvevararg("Tab", options, ...)) or options

  1093. local toggleName, alreadyEnabled, callback, flagName = assert(options.Name, "Missing Name for new toggle."), options.Value or options.Enabled, options.Callback, options.Flag or (function()

  1094. library.unnamedtoggles = 1 + (library.unnamedtoggles or 0)

  1095. return "Toggle" .. tostring(library.unnamedtoggles)

  1096. end)()

  1097. if elements[flagName] ~= nil then

  1098. warn(debug.traceback("Warning! Re-used flag '" .. flagName .. "'", 3))

  1099. end

  1100. local newToggle = Instance_new("Frame")

  1101. local toggle = Instance_new("ImageLabel")

  1102. local toggleInner = Instance_new("ImageLabel")

  1103. local toggleButton = Instance_new("TextButton")

  1104. local toggleHeadline = Instance_new("TextLabel")

  1105. local keybindPositioner = Instance_new("Frame")

  1106. local keybindList = Instance_new("UIListLayout")

  1107. local keybindButton = Instance_new("TextButton")

  1108. local lockedup = options.Locked

  1109. newToggle.Name = removeSpaces((toggleName and toggleName:lower() or "???") .. "Toggle")

  1110. newToggle.Parent = sectionHolder

  1111. newToggle.BackgroundColor3 = Color3.new(1, 1, 1)

  1112. newToggle.BackgroundTransparency = 1

  1113. newToggle.Size = UDim2.new(1, 0, 0, 19)

  1114. toggle.Name = "toggle"

  1115. toggle.Parent = newToggle

  1116. toggle.Active = true

  1117. toggle.BackgroundColor3 = library.colors.topGradient

  1118. local colored_toggle_BackgroundColor3 = {toggle, "BackgroundColor3", "topGradient"}

  1119. colored[1 + #colored] = colored_toggle_BackgroundColor3

  1120. toggle.BorderColor3 = library.colors.elementBorder

  1121. colored[1 + #colored] = {toggle, "BorderColor3", "elementBorder"}

  1122. toggle.Position = UDim2.fromScale(0.0308237672, 0.165842205)

  1123. toggle.Selectable = true

  1124. toggle.Size = UDim2.fromOffset(12, 12)

  1125. toggle.Image = "rbxassetid://2454009026"

  1126. toggle.ImageColor3 = library.colors.bottomGradient

  1127. local colored_toggle_ImageColor3 = {toggle, "ImageColor3", "bottomGradient"}

  1128. colored[1 + #colored] = colored_toggle_ImageColor3

  1129. toggleInner.Name = "toggleInner"

  1130. toggleInner.Parent = toggle

  1131. toggleInner.Active = true

  1132. toggleInner.AnchorPoint = Vector2.new(0.5, 0.5)

  1133. toggleInner.BackgroundColor3 = library.colors.topGradient

  1134. local colored_toggleInner_BackgroundColor3 = {toggleInner, "BackgroundColor3", "topGradient"}

  1135. colored[1 + #colored] = colored_toggleInner_BackgroundColor3

  1136. toggleInner.BorderColor3 = library.colors.elementBorder

  1137. colored[1 + #colored] = {toggleInner, "BorderColor3", "elementBorder"}

  1138. toggleInner.Position = UDim2.fromScale(0.5, 0.5)

  1139. toggleInner.Selectable = true

  1140. toggleInner.Size = UDim2.new(1, -4, 1, -4)

  1141. toggleInner.Image = "rbxassetid://2454009026"

  1142. toggleInner.ImageColor3 = library.colors.bottomGradient

  1143. local colored_toggleInner_ImageColor3 = {toggleInner, "ImageColor3", "bottomGradient"}

  1144. colored[1 + #colored] = colored_toggleInner_ImageColor3

  1145. toggleButton.Name = "toggleButton"

  1146. toggleButton.Parent = newToggle

  1147. toggleButton.BackgroundColor3 = Color3.new(1, 1, 1)

  1148. toggleButton.BackgroundTransparency = 1

  1149. toggleButton.Size = UDim2.fromScale(1, 1)

  1150. toggleButton.ZIndex = 5

  1151. toggleButton.Font = Enum.Font.SourceSans

  1152. toggleButton.Text = ""

  1153. toggleButton.TextColor3 = Color3.new()

  1154. toggleButton.TextSize = 14

  1155. toggleButton.TextTransparency = 1

  1156. toggleHeadline.Name = "toggleHeadline"

  1157. toggleHeadline.Parent = newToggle

  1158. toggleHeadline.BackgroundColor3 = Color3.new(1, 1, 1)

  1159. toggleHeadline.BackgroundTransparency = 1

  1160. toggleHeadline.Position = UDim2.fromScale(0.123, 0.165842161)

  1161. toggleHeadline.Size = UDim2.fromOffset(170, 11)

  1162. toggleHeadline.Font = Enum.Font.Code

  1163. toggleHeadline.Text = toggleName or "???"

  1164. toggleHeadline.TextColor3 = library.colors.elementText

  1165. local colored_toggleHeadline_TextColor3 = {toggleHeadline, "TextColor3", "elementText", (lockedup and 0.5) or nil}

  1166. colored[1 + #colored] = colored_toggleHeadline_TextColor3

  1167. toggleHeadline.TextSize = 14

  1168. toggleHeadline.TextXAlignment = Enum.TextXAlignment.Left

  1169. local last_v = nil

  1170. local function Set(t, newStatus)

  1171. if nil == newStatus and t ~= nil then

  1172. newStatus = t

  1173. end

  1174. last_v = library_flags[flagName]

  1175. if options.Condition ~= nil then

  1176. if type(options.Condition) == "function" then

  1177. local v, e = pcall(options.Condition, newStatus, last_v)

  1178. if e then

  1179. if not v then

  1180. warn(debug.traceback(string.format("Error in toggle %s's Condition function: %s", flagName, e), 2))

  1181. end

  1182. else

  1183. return last_v

  1184. end

  1185. end

  1186. end

  1187. if newStatus ~= nil and type(newStatus) == "boolean" then

  1188. library_flags[flagName] = newStatus

  1189. if options.Location then

  1190. options.Location[options.LocationFlag or flagName] = newStatus

  1191. end

  1192. if callback and (last_v ~= newStatus or options.AllowDuplicateCalls) then

  1193. colored_toggleInner_BackgroundColor3[3] = (newStatus and "main") or "topGradient"

  1194. colored_toggleInner_BackgroundColor3[4] = (newStatus and 1.5) or nil

  1195. colored_toggleInner_ImageColor3[3] = (newStatus and "main") or "bottomGradient"

  1196. colored_toggleInner_ImageColor3[4] = (newStatus and 2.5) or nil

  1197. tweenService:Create(toggleInner, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1198. BackgroundColor3 = (newStatus and darkenColor(library.colors.main, 1.5)) or library.colors.topGradient,

  1199. ImageColor3 = (newStatus and darkenColor(library.colors.main, 2.5)) or library.colors.bottomGradient

  1200. }):Play()

  1201. task.spawn(callback, newStatus, last_v)

  1202. end

  1203. end

  1204. return newStatus

  1205. end

  1206. options.Keybind = options.Keybind or options.Key or options.KeyBind

  1207. local haskbflag, kbUpdate, kbData = nil, nil, nil

  1208. if options.Keybind then

  1209. local options = options.Keybind

  1210. local htyp = typeof(options)

  1211. if htyp == "EnumItem" then

  1212. options = {

  1213. Value = options

  1214. }

  1215. elseif htyp ~= "table" then

  1216. options = {}

  1217. end

  1218. local presetKeybind, callback, kbpresscallback, kbflag = options.Value or options.Key, options.Callback, options.Pressed, options.Flag or (function()

  1219. if flagName then

  1220. return flagName .. "_ToggleKeybind"

  1221. end

  1222. library.unnamedkeybinds = 1 + (library.unnamedkeybinds or 0)

  1223. return "Keybind" .. tostring(library.unnamedkeybinds)

  1224. end)()

  1225. if elements[kbflag] ~= nil or kbflag == flagName then

  1226. warn(debug.traceback("Warning! Re-used flag '" .. kbflag .. "'", 3))

  1227. end

  1228. haskbflag = kbflag

  1229. library.keyHandler = keyHandler

  1230. local keyHandler = options.KeyNames or keyHandler

  1231. local bindedKey = presetKeybind

  1232. local justBinded = false

  1233. local keyName = keyHandler.allowedKeys[bindedKey] or (bindedKey and (bindedKey.Name or tostring(bindedKey):gsub("Enum.KeyCode.", ""))) or "NONE"

  1234. local newKeybind = newToggle

  1235. keybindPositioner.Name = "keybindPositioner"

  1236. keybindPositioner.Parent = newKeybind

  1237. keybindPositioner.BackgroundColor3 = Color3.new(1, 1, 1)

  1238. keybindPositioner.BackgroundTransparency = 1

  1239. keybindPositioner.Position = UDim2.new(0.00448430516)

  1240. keybindPositioner.Size = UDim2.fromOffset(214, 19)

  1241. keybindPositioner.ZIndex = 1 + toggleButton.ZIndex

  1242. keybindList.Name = "keybindList"

  1243. keybindList.Parent = keybindPositioner

  1244. keybindList.FillDirection = Enum.FillDirection.Horizontal

  1245. keybindList.HorizontalAlignment = Enum.HorizontalAlignment.Right

  1246. keybindList.SortOrder = Enum.SortOrder.LayoutOrder

  1247. keybindList.VerticalAlignment = Enum.VerticalAlignment.Center

  1248. keybindButton.Name = "keybindButton"

  1249. keybindButton.Parent = keybindPositioner

  1250. keybindButton.Active = false

  1251. keybindButton.BackgroundColor3 = Color3.new(1, 1, 1)

  1252. keybindButton.BackgroundTransparency = 1

  1253. keybindButton.Position = UDim2.fromScale(0.598130822, 0.184210524)

  1254. keybindButton.Selectable = false

  1255. keybindButton.Size = UDim2.fromOffset(46, 12)

  1256. keybindButton.Font = Enum.Font.Code

  1257. keybindButton.Text = keyName or (presetKeybind and tostring(presetKeybind):gsub("Enum.KeyCode.", "")) or "[NONE]"

  1258. keybindButton.TextColor3 = library.colors.otherElementText

  1259. local colored_keybindButton_TextColor3 = {keybindButton, "TextColor3", "otherElementText"}

  1260. colored[1 + #colored] = colored_keybindButton_TextColor3

  1261. keybindButton.TextSize = 14

  1262. keybindButton.TextXAlignment = Enum.TextXAlignment.Right

  1263. keybindButton.Size = UDim2.fromOffset(textToSize(keybindButton).X + 4, 12)

  1264. local klast_v = bindedKey or presetKeybind

  1265. local function newkey()

  1266. if lockedup then

  1267. return

  1268. end

  1269. local old_texts = keybindButton.Text

  1270. colored_keybindButton_TextColor3[3] = "main"

  1271. colored_keybindButton_TextColor3[4] = nil

  1272. tweenService:Create(keybindButton, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1273. TextColor3 = library.colors.main

  1274. }):Play()

  1275. if klast_v then

  1276. keybindButton.Text = "(Was " .. (klast_v and tostring(klast_v):gsub("Enum.KeyCode.", "") or "[NONE]") .. ") [...]"

  1277. else

  1278. keybindButton.Text = "[...]"

  1279. end

  1280. local receivingKey = nil

  1281. receivingKey = userInputService.InputBegan:Connect(function(key)

  1282. if lockedup then

  1283. return receivingKey:Disconnect()

  1284. end

  1285. klast_v = library_flags[kbflag]

  1286. if not keyHandler.notAllowedKeys[key.KeyCode] then

  1287. if key.KeyCode ~= Enum.KeyCode.Unknown then

  1288. bindedKey = (key.KeyCode ~= Enum.KeyCode.Escape and key.KeyCode) or library_flags[kbflag]

  1289. library_flags[kbflag] = bindedKey

  1290. if options.Location then

  1291. options.Location[options.LocationFlag or kbflag] = bindedKey

  1292. end

  1293. if bindedKey then

  1294. keyName = keyHandler.allowedKeys[bindedKey] or (bindedKey and (bindedKey.Name or tostring(bindedKey):gsub("Enum.KeyCode.", ""))) or "NONE"

  1295. keybindButton.Text = "[" .. (keyName or (bindedKey and bindedKey.Name) or "NONE") .. "]"

  1296. keybindButton.Size = UDim2.fromOffset(textToSize(keybindButton).X + 4, 12)

  1297. justBinded = true

  1298. colored_keybindButton_TextColor3[3] = "otherElementText"

  1299. colored_keybindButton_TextColor3[4] = nil

  1300. tweenService:Create(keybindButton, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1301. TextColor3 = library.colors.otherElementText

  1302. }):Play()

  1303. receivingKey:Disconnect()

  1304. end

  1305. if callback and klast_v ~= bindedKey then

  1306. task.spawn(callback, bindedKey, klast_v)

  1307. end

  1308. return

  1309. elseif key.KeyCode == Enum.KeyCode.Unknown and not keyHandler.notAllowedMouseInputs[key.UserInputType] then

  1310. bindedKey = key.UserInputType

  1311. library_flags[kbflag] = bindedKey

  1312. if options.Location then

  1313. options.Location[options.LocationFlag or kbflag] = bindedKey

  1314. end

  1315. keyName = keyHandler.allowedKeys[bindedKey]

  1316. keybindButton.Text = "[" .. (keyName or (bindedKey and bindedKey.Name) or tostring(bindedKey.KeyCode):gsub("Enum.KeyCode.", "")) .. "]"

  1317. keybindButton.Size = UDim2.fromOffset(textToSize(keybindButton).X + 4, 12)

  1318. justBinded = true

  1319. colored_keybindButton_TextColor3[3] = "otherElementText"

  1320. colored_keybindButton_TextColor3[4] = nil

  1321. tweenService:Create(keybindButton, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1322. TextColor3 = library.colors.otherElementText

  1323. }):Play()

  1324. receivingKey:Disconnect()

  1325. if callback and klast_v ~= bindedKey then

  1326. task.spawn(callback, bindedKey, klast_v)

  1327. end

  1328. return

  1329. end

  1330. end

  1331. if key.KeyCode == Enum.KeyCode.Backspace or Enum.KeyCode.Escape == key.KeyCode then

  1332. old_texts, bindedKey = "[NONE]", nil

  1333. end

  1334. keybindButton.Text = old_texts

  1335. colored_keybindButton_TextColor3[3] = "otherElementText"

  1336. colored_keybindButton_TextColor3[4] = nil

  1337. tweenService:Create(keybindButton, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1338. TextColor3 = library.colors.otherElementText

  1339. }):Play()

  1340. receivingKey:Disconnect()

  1341. if callback and klast_v ~= bindedKey then

  1342. task.spawn(callback, bindedKey, klast_v)

  1343. end

  1344. end)

  1345. library.signals[1 + #library.signals] = receivingKey

  1346. end

  1347. library.signals[1 + #library.signals] = keybindButton.MouseButton1Click:Connect(newkey)

  1348. if kbpresscallback and not justBinded then

  1349. library.signals[1 + #library.signals] = userInputService.InputBegan:Connect(function(key, chatting)

  1350. chatting = chatting or not not userInputService:GetFocusedTextBox()

  1351. if not chatting and not justBinded then

  1352. if not keyHandler.notAllowedKeys[key.KeyCode] and not keyHandler.notAllowedMouseInputs[key.UserInputType] then

  1353. if bindedKey == key.UserInputType or not justBinded and bindedKey == key.KeyCode then

  1354. if kbpresscallback then

  1355. task.spawn(kbpresscallback, key, chatting)

  1356. end

  1357. end

  1358. justBinded = false

  1359. end

  1360. end

  1361. end)

  1362. end

  1363. options.Mode = (options.Mode and string.lower(tostring(options.Mode))) or "dynamic"

  1364. local modes = {

  1365. dynamic = 1,

  1366. hold = 1,

  1367. toggle = 1

  1368. }

  1369. library.signals[1 + #library.signals] = userInputService.InputBegan:Connect(function(input, chatting)

  1370. if justBinded then

  1371. wait(0.1)

  1372. justBinded = false

  1373. return

  1374. elseif lockedup then

  1375. return

  1376. end

  1377. chatting = chatting or userInputService:GetFocusedTextBox()

  1378. if not chatting then

  1379. local key = library_flags[kbflag]

  1380. local mode = options.Mode

  1381. if not modes[mode] then

  1382. mode = "dynamic"

  1383. options.Mode = mode

  1384. end

  1385. if key == input.KeyCode or key == input.UserInputType then

  1386. if mode == "dynamic" or mode == "both" or mode == "hold" then

  1387. if mode == "dynamic" and library_flags[flagName] then

  1388. return Set(false)

  1389. end

  1390. Set(true)

  1391. local now = os.clock()

  1392. local waittil = nil

  1393. if mode == "dynamic" then

  1394. waittil = Instance.new("BindableEvent")

  1395. end

  1396. local xconnection = nil

  1397. xconnection = userInputService.InputEnded:Connect(function(input, chatting)

  1398. chatting = chatting or userInputService:GetFocusedTextBox()

  1399. if not chatting and (key == input.KeyCode or key == input.UserInputType) then

  1400. xconnection = (xconnection and xconnection:Disconnect() and nil) or nil

  1401. if mode == "hold" or os.clock() - now > math.clamp(tonumber(options.DynamicTime) or 0.65, 0.05, 20) then

  1402. Set(false)

  1403. end

  1404. end

  1405. end)

  1406. library.signals[1 + #library.signals] = xconnection

  1407. else

  1408. Set(not library_flags[flagName])

  1409. end

  1410. end

  1411. end

  1412. end)

  1413. local function kbset(t, key)

  1414. if nil == key and t ~= nil then

  1415. key = t

  1416. end

  1417. if key == "nil" or key == "NONE" or key == "none" then

  1418. key = nil

  1419. end

  1420. last_v = library_flags[kbflag]

  1421. bindedKey = key

  1422. library_flags[kbflag] = key

  1423. if options.Location then

  1424. options.Location[options.LocationFlag or kbflag] = key

  1425. end

  1426. keyName = (key == nil and "NONE") or keyHandler.allowedKeys[key]

  1427. keybindButton.Text = "[" .. (keyName or key.Name or tostring(key):gsub("Enum.KeyCode.", "")) .. "]"

  1428. keybindButton.Size = UDim2.fromOffset(textToSize(keybindButton).X + 4, 12)

  1429. justBinded = true

  1430. colored_keybindButton_TextColor3[3] = "otherElementText"

  1431. colored_keybindButton_TextColor3[4] = nil

  1432. tweenService:Create(keybindButton, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1433. TextColor3 = library.colors.otherElementText

  1434. }):Play()

  1435. if callback and (last_v ~= key or options.AllowDuplicateCalls) then

  1436. task.spawn(callback, key, last_v)

  1437. end

  1438. return key

  1439. end

  1440. if presetKeybind ~= nil then

  1441. kbset(presetKeybind)

  1442. else

  1443. library_flags[kbflag] = bindedKey

  1444. if options.Location then

  1445. options.Location[options.LocationFlag or kbflag] = bindedKey

  1446. end

  1447. end

  1448. local default = library_flags[kbflag]

  1449. local function UpdateKb()

  1450. callback, kbpresscallback = options.Callback, options.Pressed

  1451. local key = library_flags[kbflag]

  1452. bindedKey = key

  1453. keyName = keyHandler.allowedKeys[bindedKey] or (bindedKey and (bindedKey.Name or tostring(bindedKey):gsub("Enum.KeyCode.", ""))) or "NONE"

  1454. keybindButton.Text = "[" .. (keyName or (key and key.Name) or tostring(key):gsub("Enum.KeyCode.", "")) .. "]"

  1455. keybindButton.Size = UDim2.fromOffset(textToSize(keybindButton).X + 4, 12)

  1456. colored_keybindButton_TextColor3[3] = "otherElementText"

  1457. colored_keybindButton_TextColor3[4] = (lockedup and 2.5) or nil

  1458. tweenService:Create(keybindButton, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1459. TextColor3 = (lockedup and darkenColor(library.colors.otherElementText, colored_keybindButton_TextColor3[4])) or library.colors.otherElementText

  1460. }):Play()

  1461. return key

  1462. end

  1463. kbUpdate = UpdateKb

  1464. local objectdata = {

  1465. Options = options,

  1466. Name = kbflag,

  1467. Flag = kbflag,

  1468. Type = "Keybind",

  1469. Default = default,

  1470. Parent = sectionFunctions,

  1471. Instance = keybindButton,

  1472. Get = function()

  1473. return library_flags[kbflag]

  1474. end,

  1475. Set = kbset,

  1476. RawSet = function(t, key)

  1477. if t ~= nil and key == nil then

  1478. key = t

  1479. end

  1480. library_flags[kbflag] = key

  1481. UpdateKb()

  1482. return key

  1483. end,

  1484. Update = UpdateKb,

  1485. Reset = function()

  1486. return kbset(nil, default)

  1487. end

  1488. }

  1489. kbData = objectdata

  1490. tabFunctions.Flags[kbflag], sectionFunctions.Flags[kbflag], elements[kbflag] = objectdata, objectdata, objectdata

  1491. end

  1492. sectionFunctions:Update()

  1493. library.signals[1 + #library.signals] = toggleButton.MouseButton1Click:Connect(function()

  1494. if not library.colorpicker and not submenuOpen and not lockedup then

  1495. local newval = not library_flags[flagName]

  1496. if options.Condition ~= nil then

  1497. if type(options.Condition) == "function" then

  1498. local v, e = pcall(options.Condition, newval, not newval)

  1499. if e then

  1500. if not v then

  1501. warn(debug.traceback(string.format("Error in toggle %s's Condition function: %s", flagName, e), 2))

  1502. end

  1503. else

  1504. return last_v

  1505. end

  1506. end

  1507. end

  1508. library_flags[flagName] = newval

  1509. if options.Location then

  1510. options.Location[options.LocationFlag or flagName] = newval

  1511. end

  1512. colored_toggleInner_BackgroundColor3[3] = (newval and "main") or "topGradient"

  1513. colored_toggleInner_BackgroundColor3[4] = (newval and 1.5) or nil

  1514. colored_toggleInner_ImageColor3[3] = (newval and "main") or "bottomGradient"

  1515. colored_toggleInner_ImageColor3[4] = (newval and 2.5) or nil

  1516. tweenService:Create(toggleInner, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1517. BackgroundColor3 = (newval and darkenColor(library.colors.main, 1.5)) or library.colors.topGradient,

  1518. ImageColor3 = (newval and darkenColor(library.colors.main, 2.5)) or library.colors.bottomGradient

  1519. }):Play()

  1520. if callback then

  1521. task.spawn(callback, newval)

  1522. end

  1523. end

  1524. end)

  1525. library.signals[1 + #library.signals] = newToggle.MouseEnter:Connect(function()

  1526. colored_toggle_BackgroundColor3[3] = "main"

  1527. colored_toggle_BackgroundColor3[4] = 1.5

  1528. colored_toggle_ImageColor3[3] = "main"

  1529. colored_toggle_ImageColor3[4] = 2.5

  1530. tweenService:Create(toggle, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1531. BackgroundColor3 = darkenColor(library.colors.main, 1.5),

  1532. ImageColor3 = darkenColor(library.colors.main, 2.5)

  1533. }):Play()

  1534. end)

  1535. library.signals[1 + #library.signals] = newToggle.MouseLeave:Connect(function()

  1536. colored_toggle_BackgroundColor3[3] = "topGradient"

  1537. colored_toggle_BackgroundColor3[4] = nil

  1538. colored_toggle_ImageColor3[3] = "bottomGradient"

  1539. colored_toggle_ImageColor3[4] = nil

  1540. tweenService:Create(toggle, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1541. BackgroundColor3 = library.colors.topGradient,

  1542. ImageColor3 = library.colors.bottomGradient

  1543. }):Play()

  1544. end)

  1545. if library_flags[flagName] then

  1546. colored_toggleInner_BackgroundColor3[3] = "main"

  1547. colored_toggleInner_BackgroundColor3[4] = 1.5

  1548. colored_toggleInner_ImageColor3[3] = "main"

  1549. colored_toggleInner_ImageColor3[4] = 2.5

  1550. tweenService:Create(toggleInner, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1551. BackgroundColor3 = darkenColor(library.colors.main, 1.5),

  1552. ImageColor3 = darkenColor(library.colors.main, 2.5)

  1553. }):Play()

  1554. end

  1555. local function Update()

  1556. toggleName, callback = options.Name or toggleName, options.Callback

  1557. local boolstatus = library_flags[flagName]

  1558. colored_toggleInner_BackgroundColor3[3] = (boolstatus and "main") or "topGradient"

  1559. colored_toggleInner_BackgroundColor3[4] = (boolstatus and 1.5) or nil

  1560. colored_toggleInner_ImageColor3[3] = (boolstatus and "main") or "bottomGradient"

  1561. colored_toggleInner_ImageColor3[4] = (boolstatus and 2.5) or nil

  1562. if lockedup then

  1563. colored_toggleInner_BackgroundColor3[4] = 1 + (colored_toggleInner_BackgroundColor3[4] or 1)

  1564. colored_toggleInner_ImageColor3[4] = 1 + (colored_toggleInner_ImageColor3[4] or 1)

  1565. end

  1566. tweenService:Create(toggleInner, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1567. BackgroundColor3 = (boolstatus and darkenColor(library.colors.main, colored_toggleInner_BackgroundColor3[4])) or library.colors.topGradient,

  1568. ImageColor3 = (boolstatus and darkenColor(library.colors.main, colored_toggleInner_ImageColor3[4])) or library.colors.bottomGradient

  1569. }):Play()

  1570. colored_toggleHeadline_TextColor3[4] = (lockedup and 2.5) or nil

  1571. tweenService:Create(toggleHeadline, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1572. TextColor3 = (lockedup and darkenColor(library.colors.elementText, colored_toggleHeadline_TextColor3[4])) or library.colors.elementText

  1573. }):Play()

  1574. toggleHeadline.Text = toggleName or "???"

  1575. return boolstatus

  1576. end

  1577. if alreadyEnabled ~= nil then

  1578. Set(alreadyEnabled)

  1579. else

  1580. library_flags[flagName] = not not alreadyEnabled

  1581. if options.Location then

  1582. options.Location[options.LocationFlag or flagName] = not not alreadyEnabled

  1583. end

  1584. end

  1585. local default = not not library_flags[flagName]

  1586. Update()

  1587. if kbUpdate then

  1588. kbUpdate()

  1589. end

  1590. local objectdata = {

  1591. Options = options,

  1592. Type = "Toggle",

  1593. Name = flagName,

  1594. Flag = flagName,

  1595. Default = default,

  1596. Parent = sectionFunctions,

  1597. Instance = toggleButton,

  1598. Set = Set,

  1599. RawSet = function(t, newStatus, condition)

  1600. if t ~= nil and type(t) ~= "table" then

  1601. newStatus, condition = t, newStatus

  1602. end

  1603. last_v = library_flags[flagName]

  1604. if condition ~= false and condition ~= 0 then

  1605. local overridecondition = condition and type(condition) == "function" and condition

  1606. if overridecondition or options.Condition ~= nil then

  1607. if type(overridecondition or options.Condition) == "function" then

  1608. local v, e = pcall(overridecondition or options.Condition, newStatus, last_v)

  1609. if e then

  1610. if not v then

  1611. warn(debug.traceback(string.format("Error in toggle (RawSet) %s's Condition function: %s", flagName, e), 2))

  1612. end

  1613. else

  1614. return last_v

  1615. end

  1616. end

  1617. end

  1618. end

  1619. library_flags[flagName] = newStatus

  1620. if options.Location then

  1621. options.Location[options.LocationFlag or flagName] = newStatus

  1622. end

  1623. Update()

  1624. return newStatus

  1625. end,

  1626. KeybindData = kbData,

  1627. Get = function()

  1628. return library_flags[flagName]

  1629. end,

  1630. Update = Update,

  1631. Reset = function()

  1632. return Set(nil, default)

  1633. end,

  1634. SetLocked = function(t, state)

  1635. if type(t) ~= "table" then

  1636. state = t

  1637. end

  1638. local last_v = lockedup

  1639. if state == nil then

  1640. lockedup = not lockedup

  1641. else

  1642. lockedup = state

  1643. end

  1644. if lockedup ~= last_v then

  1645. colored_toggleHeadline_TextColor3[4] = (lockedup and 2.5) or nil

  1646. Update()

  1647. if kbUpdate then

  1648. kbUpdate()

  1649. end

  1650. end

  1651. return lockedup

  1652. end,

  1653. Lock = function()

  1654. if not lockedup then

  1655. lockedup = true

  1656. colored_toggleHeadline_TextColor3[4] = 2.5

  1657. Update()

  1658. if kbUpdate then

  1659. kbUpdate()

  1660. end

  1661. end

  1662. return lockedup

  1663. end,

  1664. Unlock = function()

  1665. if lockedup then

  1666. lockedup = false

  1667. colored_toggleHeadline_TextColor3[4] = nil

  1668. Update()

  1669. if kbUpdate then

  1670. kbUpdate()

  1671. end

  1672. end

  1673. return lockedup

  1674. end,

  1675. SetCondition = function(t, condition)

  1676. if type(t) ~= "table" and condition == nil then

  1677. condition = t

  1678. end

  1679. options.Condition = condition

  1680. return condition

  1681. end

  1682. }

  1683. if kbData then

  1684. kbData.ToggleData = objectdata

  1685. end

  1686. tabFunctions.Flags[flagName], sectionFunctions.Flags[flagName], elements[flagName] = objectdata, objectdata, objectdata

  1687. return objectdata

  1688. end

  1689. sectionFunctions.CreateToggle = sectionFunctions.AddToggle

  1690. sectionFunctions.NewToggle = sectionFunctions.AddToggle

  1691. sectionFunctions.Toggle = sectionFunctions.AddToggle

  1692. sectionFunctions.Tog = sectionFunctions.AddToggle

  1693. function sectionFunctions:AddButton(...)

  1694. local args = nil

  1695. if ... and not select(2, ...) and type(...) == "table" and #... > 0 and type((...)[1]) == "table" and (...)[1].Name then

  1696. args = ...

  1697. else

  1698. args = {...}

  1699. end

  1700. local buttons, offset = {}, 0

  1701. local fram = nil

  1702. for _, options in next, args do

  1703. options = (options and options[1] and type(options[1]) == "string" and resolvevararg("Button", unpack(options))) or options

  1704. local buttonName, callback = assert(options.Name, "Missing Name for new button."), options.Callback or (warn("AddButton missing callback. Name:", options.Name or "No Name", debug.traceback("")) and nil) or function()

  1705. end

  1706. local lockedup = options.Locked

  1707. local realButton = Instance_new("TextButton")

  1708. realButton.Name = "realButton"

  1709. realButton.BackgroundColor3 = Color3.new(1, 1, 1)

  1710. realButton.BackgroundTransparency = 1

  1711. realButton.Size = UDim2.fromScale(1, 1)

  1712. realButton.ZIndex = 5

  1713. realButton.Font = Enum.Font.Code

  1714. realButton.Text = (buttonName and tostring(buttonName)) or "???"

  1715. realButton.TextColor3 = library.colors.elementText

  1716. local colored_realButton_TextColor3 = {realButton, "TextColor3", "elementText"}

  1717. colored[1 + #colored] = colored_realButton_TextColor3

  1718. realButton.TextSize = 14

  1719. local textsize = textToSize(realButton).X + 14

  1720. if newSection.Parent.AbsoluteSize.X < offset + textsize + 8 then

  1721. offset, fram = 0, nil

  1722. end

  1723. local newButton = fram or Instance_new("Frame")

  1724. fram = newButton

  1725. local button = Instance_new("ImageLabel")

  1726. newButton.Name = removeSpaces((buttonName and buttonName:lower() or "???") .. "Holder")

  1727. newButton.Parent = sectionHolder

  1728. newButton.BackgroundColor3 = Color3.new(1, 1, 1)

  1729. newButton.BackgroundTransparency = 1

  1730. newButton.Size = UDim2.new(1, 0, 0, 24)

  1731. button.Name = "button"

  1732. button.Parent = newButton

  1733. button.Active = true

  1734. button.BackgroundColor3 = library.colors.topGradient

  1735. local colored_button_BackgroundColor3 = {button, "BackgroundColor3", "topGradient"}

  1736. colored[1 + #colored] = colored_button_BackgroundColor3

  1737. button.BorderColor3 = library.colors.elementBorder

  1738. colored[1 + #colored] = {button, "BorderColor3", "elementBorder"}

  1739. button.Position = UDim2.new(0.031, offset, 0.166)

  1740. button.Selectable = true

  1741. button.Size = UDim2.fromOffset(28, 18)

  1742. button.Image = "rbxassetid://2454009026"

  1743. button.ImageColor3 = library.colors.bottomGradient

  1744. local colored_button_ImageColor3 = {button, "ImageColor3", "bottomGradient"}

  1745. colored[1 + #colored] = colored_button_ImageColor3

  1746. local buttonInner = Instance_new("ImageLabel")

  1747. buttonInner.Name = "buttonInner"

  1748. buttonInner.Parent = button

  1749. buttonInner.Active = true

  1750. buttonInner.AnchorPoint = Vector2.new(0.5, 0.5)

  1751. buttonInner.BackgroundColor3 = library.colors.topGradient

  1752. local colored_buttonInner_BackgroundColor3 = {buttonInner, "BackgroundColor3", "topGradient"}

  1753. colored[1 + #colored] = colored_buttonInner_BackgroundColor3

  1754. buttonInner.BorderColor3 = library.colors.elementBorder

  1755. colored[1 + #colored] = {buttonInner, "BorderColor3", "elementBorder"}

  1756. buttonInner.Position = UDim2.fromScale(0.5, 0.5)

  1757. buttonInner.Selectable = true

  1758. buttonInner.Size = UDim2.new(1, -4, 1, -4)

  1759. buttonInner.Image = "rbxassetid://2454009026"

  1760. buttonInner.ImageColor3 = library.colors.bottomGradient

  1761. local colored_buttonInner_ImageColor3 = {buttonInner, "ImageColor3", "bottomGradient"}

  1762. colored[1 + #colored] = colored_buttonInner_ImageColor3

  1763. button.Size = UDim2.fromOffset(textsize, 18)

  1764. realButton.Parent = button

  1765. offset = offset + textsize + 6

  1766. sectionFunctions:Update()

  1767. local presses = 0

  1768. library.signals[1 + #library.signals] = realButton.MouseButton1Click:Connect(function()

  1769. if lockedup then

  1770. return

  1771. end

  1772. if options.Condition ~= nil and type(options.Condition) == "function" then

  1773. local v, e = pcall(options.Condition, presses)

  1774. if e then

  1775. if not v then

  1776. warn(debug.traceback(string.format("Error in button %s's Condition function: %s", buttonName, e), 2))

  1777. end

  1778. else

  1779. return

  1780. end

  1781. end

  1782. if not library.colorpicker and not submenuOpen then

  1783. presses = 1 + presses

  1784. task.spawn(callback, presses)

  1785. end

  1786. end)

  1787. local imin = nil

  1788. library.signals[1 + #library.signals] = button.MouseEnter:Connect(function()

  1789. imin = 1

  1790. colored_button_BackgroundColor3[3] = "main"

  1791. colored_button_BackgroundColor3[4] = 1.5

  1792. colored_button_ImageColor3[3] = "main"

  1793. colored_button_ImageColor3[4] = 2.5

  1794. tweenService:Create(button, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1795. BackgroundColor3 = darkenColor(library.colors.main, 1.5),

  1796. ImageColor3 = darkenColor(library.colors.main, 2.5)

  1797. }):Play()

  1798. end)

  1799. library.signals[1 + #library.signals] = button.MouseLeave:Connect(function()

  1800. imin = nil

  1801. colored_button_BackgroundColor3[3] = "topGradient"

  1802. colored_button_BackgroundColor3[4] = nil

  1803. colored_button_ImageColor3[3] = "bottomGradient"

  1804. colored_button_ImageColor3[4] = nil

  1805. tweenService:Create(button, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1806. BackgroundColor3 = library.colors.topGradient,

  1807. ImageColor3 = library.colors.bottomGradient

  1808. }):Play()

  1809. end)

  1810. local function Update()

  1811. buttonName, callback = options.Name or buttonName, options.Callback or (warn(debug.traceback("AddButton missing callback. Name:" .. (options.Name or buttonName or "No Name"), 2)) and nil) or function()

  1812. end

  1813. colored_button_BackgroundColor3[3] = (imin and "main") or "topGradient"

  1814. colored_button_BackgroundColor3[4] = (imin and 1.5) or nil

  1815. colored_button_ImageColor3[3] = (imin and "main") or "bottomGradient"

  1816. colored_button_ImageColor3[4] = (imin and 2.5) or nil

  1817. colored_buttonInner_BackgroundColor3[4] = nil

  1818. colored_buttonInner_ImageColor3[4] = nil

  1819. colored_realButton_TextColor3[4] = nil

  1820. if lockedup then

  1821. colored_button_BackgroundColor3[4] = 1.25

  1822. colored_button_ImageColor3[4] = 1.25

  1823. colored_buttonInner_BackgroundColor3[4] = 1.25

  1824. colored_buttonInner_ImageColor3[4] = 1.25

  1825. colored_realButton_TextColor3[4] = 1.75

  1826. end

  1827. tweenService:Create(button, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1828. BackgroundColor3 = (imin and darkenColor(library.colors.main, colored_button_BackgroundColor3[4])) or darkenColor(library.colors.topGradient, colored_button_BackgroundColor3[4]),

  1829. ImageColor3 = (imin and darkenColor(library.colors.main, colored_button_ImageColor3[4])) or darkenColor(library.colors.bottomGradient, colored_button_ImageColor3[4])

  1830. }):Play()

  1831. tweenService:Create(buttonInner, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1832. BackgroundColor3 = darkenColor(library.colors.topGradient, colored_buttonInner_BackgroundColor3[4]),

  1833. ImageColor3 = darkenColor(library.colors.bottomGradient, colored_buttonInner_ImageColor3[4])

  1834. }):Play()

  1835. tweenService:Create(realButton, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  1836. TextColor3 = darkenColor(library.colors.elementText, colored_realButton_TextColor3[4])

  1837. }):Play()

  1838. realButton.Text = (buttonName and tostring(buttonName)) or "???"

  1839. return presses

  1840. end

  1841. Update()

  1842. local objectdata = {

  1843. Options = options,

  1844. Name = buttonName,

  1845. Flag = buttonName,

  1846. Type = "Button",

  1847. Parent = sectionFunctions,

  1848. Instance = realButton,

  1849. Press = function(...)

  1850. if lockedup then

  1851. return presses

  1852. end

  1853. if options.Condition ~= nil and type(options.Condition) == "function" then

  1854. local v, e = pcall(options.Condition, presses)

  1855. if e then

  1856. if not v then

  1857. warn(debug.traceback(string.format("Error in button %s's Condition function: %s", buttonName, e), 2))

  1858. end

  1859. else

  1860. return presses

  1861. end

  1862. end

  1863. local args = {...}

  1864. local a1 = args[1]

  1865. if a1 and type(a1) == "table" then

  1866. table.remove(args, 1)

  1867. end

  1868. presses = 1 + presses

  1869. task.spawn(callback, presses, ...)

  1870. return presses

  1871. end,

  1872. RawPress = function(...)

  1873. local args = {...}

  1874. local a1 = args[1]

  1875. if a1 and type(a1) == "table" then

  1876. table.remove(args, 1)

  1877. end

  1878. task.spawn(callback, presses, ...)

  1879. return presses

  1880. end,

  1881. Get = function()

  1882. return callback, presses

  1883. end,

  1884. SetLocked = function(t, state)

  1885. if type(t) ~= "table" then

  1886. state = t

  1887. end

  1888. local last_v = lockedup

  1889. if state == nil then

  1890. lockedup = not lockedup

  1891. else

  1892. lockedup = state

  1893. end

  1894. if lockedup ~= last_v then

  1895. Update()

  1896. end

  1897. return lockedup

  1898. end,

  1899. Lock = function()

  1900. if not lockedup then

  1901. lockedup = true

  1902. Update()

  1903. end

  1904. return lockedup

  1905. end,

  1906. Unlock = function()

  1907. if lockedup then

  1908. lockedup = false

  1909. Update()

  1910. end

  1911. return lockedup

  1912. end,

  1913. SetCondition = function(t, condition)

  1914. if type(t) ~= "table" and condition == nil then

  1915. condition = t

  1916. end

  1917. options.Condition = condition

  1918. return condition

  1919. end,

  1920. Update = Update,

  1921. SetText = function(t, str)

  1922. if type(t) ~= "table" and str == nil then

  1923. str = t

  1924. end

  1925. buttonName = str

  1926. options.Name = str

  1927. realButton.Text = (buttonName and tostring(buttonName)) or "???"

  1928. return str

  1929. end,

  1930. SetCallback = function(t, call)

  1931. if type(t) ~= "table" and call == nil then

  1932. call = t

  1933. end

  1934. options.Callback = call

  1935. callback = call

  1936. return call

  1937. end

  1938. }

  1939. tabFunctions.Flags[buttonName], sectionFunctions.Flags[buttonName], elements[buttonName] = objectdata, objectdata, objectdata

  1940. buttons[1 + #buttons] = objectdata

  1941. end

  1942. function buttons.PressAll()

  1943. for _, v in next, buttons do

  1944. v.Press()

  1945. end

  1946. end

  1947. function buttons.UpdateAll()

  1948. for _, v in next, buttons do

  1949. v.Update()

  1950. end

  1951. end

  1952. if #buttons == 1 then

  1953. for k, v in next, buttons[1] do

  1954. if buttons[k] == nil then

  1955. buttons[k] = v

  1956. end

  1957. end

  1958. end

  1959. return buttons

  1960. end

  1961. sectionFunctions.CreateButton = sectionFunctions.AddButton

  1962. sectionFunctions.NewButton = sectionFunctions.AddButton

  1963. sectionFunctions.Button = sectionFunctions.AddButton

  1964. function sectionFunctions:AddTextbox(options, ...)

  1965. options = (options and type(options) == "string" and resolvevararg("Textbox", options, ...)) or options

  1966. local textboxName, presetValue, placeholder, callback, flagName = assert(options.Name, "Missing Name for new textbox."), options.Value, options.Placeholder, options.Callback, options.Flag or (function()

  1967. library.unnamedtextboxes = 1 + (library.unnamedtextboxes or 0)

  1968. return "Textbox" .. tostring(library.unnamedtextboxes)

  1969. end)()

  1970. if elements[flagName] ~= nil then

  1971. warn(debug.traceback("Warning! Re-used flag '" .. flagName .. "'", 3))

  1972. end

  1973. local requiredtype = options.Type

  1974. local newTextbox = Instance_new("Frame")

  1975. local textbox = Instance_new("ImageLabel")

  1976. local textboxInner = Instance_new("ImageLabel")

  1977. local realTextbox = Instance_new("TextBox")

  1978. local textboxHeadline = Instance_new("TextLabel")

  1979. newTextbox.Name = removeSpaces((textboxName and textboxName:lower()) or "???") .. "Holder"

  1980. newTextbox.Parent = sectionHolder

  1981. newTextbox.BackgroundColor3 = Color3.new(1, 1, 1)

  1982. newTextbox.BackgroundTransparency = 1

  1983. newTextbox.Size = UDim2.new(1, 0, 0, 42)

  1984. textbox.Name = "textbox"

  1985. textbox.Parent = newTextbox

  1986. textbox.Active = true

  1987. textbox.BackgroundColor3 = library.colors.topGradient

  1988. local colored_textbox_BackgroundColor3 = {textbox, "BackgroundColor3", "topGradient"}

  1989. colored[1 + #colored] = colored_textbox_BackgroundColor3

  1990. textbox.BorderColor3 = library.colors.elementBorder

  1991. colored[1 + #colored] = {textbox, "BorderColor3", "elementBorder"}

  1992. textbox.Position = UDim2.fromScale(0.031, 0.48)

  1993. textbox.Selectable = true

  1994. textbox.Size = UDim2.fromOffset(206, 18)

  1995. textbox.Image = "rbxassetid://2454009026"

  1996. textbox.ImageColor3 = library.colors.bottomGradient

  1997. local colored_textbox_ImageColor3 = {textbox, "ImageColor3", "bottomGradient"}

  1998. colored[1 + #colored] = colored_textbox_ImageColor3

  1999. textboxInner.Name = "textboxInner"

  2000. textboxInner.Parent = textbox

  2001. textboxInner.Active = true

  2002. textboxInner.AnchorPoint = Vector2.new(0.5, 0.5)

  2003. textboxInner.BackgroundColor3 = library.colors.topGradient

  2004. colored[1 + #colored] = {textboxInner, "BackgroundColor3", "topGradient"}

  2005. textboxInner.BorderColor3 = library.colors.elementBorder

  2006. colored[1 + #colored] = {textboxInner, "BorderColor3", "elementBorder"}

  2007. textboxInner.Position = UDim2.fromScale(0.5, 0.5)

  2008. textboxInner.Selectable = true

  2009. textboxInner.Size = UDim2.new(1, -4, 1, -4)

  2010. textboxInner.Image = "rbxassetid://2454009026"

  2011. textboxInner.ImageColor3 = library.colors.bottomGradient

  2012. colored[1 + #colored] = {textboxInner, "ImageColor3", "bottomGradient"}

  2013. realTextbox.Name = "realTextbox"

  2014. if options.Rich or options.RichText or options.RichTextBox then

  2015. realTextbox.RichText = true

  2016. end

  2017. if options.MultiLine or options.Lines then

  2018. realTextbox.MultiLine = true

  2019. end

  2020. if options.Font or options.TextFont then

  2021. realTextbox.Font = options.Font

  2022. end

  2023. if options.TextScaled or options.Scaled then

  2024. realTextbox.TextScaled = true

  2025. end

  2026. realTextbox.BackgroundColor3 = Color3.new(1, 1, 1)

  2027. realTextbox.BackgroundTransparency = 1

  2028. realTextbox.Position = UDim2.new(0.0295485705)

  2029. realTextbox.Size = UDim2.fromScale(0.97, 1)

  2030. realTextbox.ZIndex = 5

  2031. realTextbox.Font = Enum.Font.Code

  2032. realTextbox.LineHeight = 1.15

  2033. realTextbox.Text = tostring(presetValue)

  2034. realTextbox.TextColor3 = library.colors.otherElementText

  2035. colored[1 + #colored] = {realTextbox, "TextColor3", "otherElementText"}

  2036. realTextbox.TextSize = 14

  2037. if options.ClearTextOnFocus or options.ClearText then

  2038. realTextbox.ClearTextOnFocus = true

  2039. else

  2040. realTextbox.ClearTextOnFocus = false

  2041. end

  2042. realTextbox.PlaceholderText = (placeholder ~= nil and tostring(placeholder)) or (presetValue ~= nil and tostring(presetValue)) or ""

  2043. realTextbox.TextXAlignment = Enum.TextXAlignment.Left

  2044. if options.CustomProperties and type(options.CustomProperties) == "table" then

  2045. for k, v in next, options.CustomProperties do

  2046. local oof, e = pcall(function()

  2047. realTextbox[k] = v

  2048. end)

  2049. if not oof and e then

  2050. warn("Error setting Textbox", flagName, "|", e, debug.traceback(""))

  2051. end

  2052. end

  2053. end

  2054. realTextbox.Parent = textbox

  2055. textboxHeadline.Name = "textboxHeadline"

  2056. textboxHeadline.Parent = newTextbox

  2057. textboxHeadline.Active = true

  2058. textboxHeadline.BackgroundColor3 = Color3.new(1, 1, 1)

  2059. textboxHeadline.BackgroundTransparency = 1

  2060. textboxHeadline.Position = UDim2.new(0.031)

  2061. textboxHeadline.Selectable = true

  2062. textboxHeadline.Size = UDim2.fromOffset(206, 20)

  2063. textboxHeadline.ZIndex = 5

  2064. textboxHeadline.Font = Enum.Font.Code

  2065. textboxHeadline.LineHeight = 1.15

  2066. textboxHeadline.Text = (textboxName and tostring(textboxName)) or "???"

  2067. textboxHeadline.TextColor3 = library.colors.elementText

  2068. colored[1 + #colored] = {textboxHeadline, "TextColor3", "elementText"}

  2069. textboxHeadline.TextSize = 14

  2070. textboxHeadline.TextXAlignment = Enum.TextXAlignment.Left

  2071. sectionFunctions:Update()

  2072. local last_v = presetValue

  2073. local function resolvevalue(val)

  2074. if options.PreFormat then

  2075. local typ = type(options.PreFormat)

  2076. if typ == "function" then

  2077. local x, e = pcall(options.PreFormat, val)

  2078. if not x and e then

  2079. warn("Error in Pre-Format (Textbox " .. flagName .. "):", e)

  2080. else

  2081. val = e

  2082. end

  2083. end

  2084. end

  2085. if requiredtype == "number" then

  2086. if not options.Hex and not options.Binary and not options.Base then

  2087. val = tonumber(val) or tonumber(val:gsub("%D", ""), 10) or 0

  2088. else

  2089. val = tonumber(val, (options.Hex and 16) or (options.Binary and 2) or options.Base or 10) or 0

  2090. end

  2091. if options.Max or options.Min then

  2092. val = math.clamp(val, options.Min or -math.huge, options.Max or math.huge)

  2093. end

  2094. local decimalprecision = tonumber(options.Decimals or options.Precision or options.Precise)

  2095. if decimalprecision then

  2096. val = tonumber(string.format("%0." .. tostring(decimalprecision) .. "f", val))

  2097. end

  2098. end

  2099. if options.PostFormat then

  2100. local typ = type(options.PostFormat)

  2101. if typ == "function" then

  2102. local x, e = pcall(options.PostFormat, val)

  2103. if not x and e then

  2104. warn("Error in Post-Format (Textbox " .. flagName .. "):", e)

  2105. else

  2106. val = e

  2107. end

  2108. end

  2109. end

  2110. return (val and tonumber(val)) or val

  2111. end

  2112. library.signals[1 + #library.signals] = realTextbox.FocusLost:Connect(function()

  2113. last_v = library_flags[flagName]

  2114. local val = resolvevalue(realTextbox.Text)

  2115. library_flags[flagName] = val

  2116. if options.Location then

  2117. options.Location[options.LocationFlag or flagName] = val

  2118. end

  2119. if callback and last_v ~= val then

  2120. task.spawn(callback, tostring(val), last_v, realTextbox)

  2121. end

  2122. end)

  2123. library.signals[1 + #library.signals] = newTextbox.MouseEnter:Connect(function()

  2124. colored_textbox_BackgroundColor3[3] = "main"

  2125. colored_textbox_BackgroundColor3[4] = 1.5

  2126. colored_textbox_ImageColor3[3] = "main"

  2127. colored_textbox_ImageColor3[4] = 2.5

  2128. tweenService:Create(textbox, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  2129. BackgroundColor3 = darkenColor(library.colors.main, 1.5),

  2130. ImageColor3 = darkenColor(library.colors.main, 2.5)

  2131. }):Play()

  2132. end)

  2133. library.signals[1 + #library.signals] = newTextbox.MouseLeave:Connect(function()

  2134. colored_textbox_BackgroundColor3[3] = "topGradient"

  2135. colored_textbox_BackgroundColor3[4] = nil

  2136. colored_textbox_ImageColor3[3] = "bottomGradient"

  2137. colored_textbox_ImageColor3[4] = nil

  2138. tweenService:Create(textbox, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  2139. BackgroundColor3 = library.colors.topGradient,

  2140. ImageColor3 = library.colors.bottomGradient

  2141. }):Play()

  2142. end)

  2143. local function set(t, str)

  2144. if nil == str and t ~= nil then

  2145. str = t

  2146. end

  2147. last_v = library_flags[flagName]

  2148. library_flags[flagName] = str

  2149. if options.Location then

  2150. options.Location[options.LocationFlag or flagName] = str

  2151. end

  2152. local sstr = (str ~= nil and tostring(str)) or "Empty Text"

  2153. if realTextbox.Text ~= sstr then

  2154. realTextbox.Text = sstr

  2155. end

  2156. if callback and (last_v ~= str or options.AllowDuplicateCalls) then

  2157. task.spawn(callback, str, last_v, realTextbox)

  2158. end

  2159. return str

  2160. end

  2161. if presetValue ~= nil then

  2162. set(presetValue)

  2163. else

  2164. library_flags[flagName] = presetValue

  2165. if options.Location then

  2166. options.Location[options.LocationFlag or flagName] = presetValue

  2167. end

  2168. end

  2169. local default = library_flags[flagName]

  2170. local function update()

  2171. textboxName, placeholder, callback = options.Name or textboxName, options.Placeholder or placeholder, options.Callback

  2172. local str = library_flags[flagName]

  2173. str = (str ~= nil and tostring(str)) or "Empty Text"

  2174. if realTextbox.Text ~= str then

  2175. realTextbox.Text = str

  2176. end

  2177. textboxHeadline.Text = (textboxName and tostring(textboxName)) or "???"

  2178. return str

  2179. end

  2180. local objectdata = {

  2181. Options = options,

  2182. Name = flagName,

  2183. Flag = flagName,

  2184. Type = "Textbox",

  2185. Default = default,

  2186. Parent = sectionFunctions,

  2187. Instance = realTextbox,

  2188. Get = function()

  2189. return library_flags[flagName]

  2190. end,

  2191. Set = set,

  2192. Update = update,

  2193. RawSet = function(t, str)

  2194. if t ~= nil and str == nil then

  2195. str = t

  2196. end

  2197. last_v = library_flags[flagName]

  2198. library_flags[flagName] = str

  2199. if options.Location then

  2200. options.Location[options.LocationFlag or flagName] = str

  2201. end

  2202. update()

  2203. return str

  2204. end,

  2205. Reset = function()

  2206. return set(nil, default)

  2207. end

  2208. }

  2209. tabFunctions.Flags[flagName], sectionFunctions.Flags[flagName], elements[flagName] = objectdata, objectdata, objectdata

  2210. return objectdata

  2211. end

  2212. sectionFunctions.AddTextBox = sectionFunctions.AddTextbox

  2213. sectionFunctions.NewTextBox = sectionFunctions.AddTextbox

  2214. sectionFunctions.CreateTextBox = sectionFunctions.AddTextbox

  2215. sectionFunctions.TextBox = sectionFunctions.AddTextbox

  2216. sectionFunctions.NewTextbox = sectionFunctions.AddTextbox

  2217. sectionFunctions.CreateTextbox = sectionFunctions.AddTextbox

  2218. sectionFunctions.Textbox = sectionFunctions.AddTextbox

  2219. sectionFunctions.Box = sectionFunctions.AddTextbox

  2220. function sectionFunctions:AddKeybind(options, ...)

  2221. options = (options and type(options) == "string" and resolvevararg("Keybind", options, ...)) or options

  2222. local keybindName, presetKeybind, callback, presscallback, flag = assert(options.Name, "Missing Name for new keybind."), options.Value, options.Callback, options.Pressed, options.Flag or (function()

  2223. library.unnamedkeybinds = 1 + (library.unnamedkeybinds or 0)

  2224. return "Keybind" .. tostring(library.unnamedkeybinds)

  2225. end)()

  2226. if elements[flag] ~= nil then

  2227. warn(debug.traceback("Warning! Re-used flag '" .. flag .. "'", 3))

  2228. end

  2229. library.keyHandler = keyHandler

  2230. local keyHandler = options.KeyNames or keyHandler

  2231. local newKeybind = Instance_new("Frame")

  2232. local keybindHeadline = Instance_new("TextLabel")

  2233. local keybindPositioner = Instance_new("Frame")

  2234. local keybindList = Instance_new("UIListLayout")

  2235. local keybindButton = Instance_new("TextButton")

  2236. local bindedKey = presetKeybind

  2237. local justBinded = false

  2238. local keyName = (presetKeybind and tostring(presetKeybind):gsub("Enum.KeyCode.", "") or "")

  2239. newKeybind.Name = "newKeybind"

  2240. newKeybind.Parent = sectionHolder

  2241. newKeybind.BackgroundColor3 = Color3.new(1, 1, 1)

  2242. newKeybind.BackgroundTransparency = 1

  2243. newKeybind.Size = UDim2.new(1, 0, 0, 19)

  2244. keybindHeadline.Name = "keybindHeadline"

  2245. keybindHeadline.Parent = newKeybind

  2246. keybindHeadline.BackgroundColor3 = Color3.new(1, 1, 1)

  2247. keybindHeadline.BackgroundTransparency = 1

  2248. keybindHeadline.Position = UDim2.fromScale(0.031, 0.165842161)

  2249. keybindHeadline.Size = UDim2.fromOffset(215, 12)

  2250. keybindHeadline.Font = Enum.Font.Code

  2251. keybindHeadline.Text = (keybindName and tostring(keybindName)) or "???"

  2252. keybindHeadline.TextColor3 = library.colors.elementText

  2253. colored[1 + #colored] = {keybindHeadline, "TextColor3", "elementText"}

  2254. keybindHeadline.TextSize = 14

  2255. keybindHeadline.TextXAlignment = Enum.TextXAlignment.Left

  2256. keybindPositioner.Name = "keybindPositioner"

  2257. keybindPositioner.Parent = newKeybind

  2258. keybindPositioner.BackgroundColor3 = Color3.new(1, 1, 1)

  2259. keybindPositioner.BackgroundTransparency = 1

  2260. keybindPositioner.Position = UDim2.new(0.00448430516)

  2261. keybindPositioner.Size = UDim2.fromOffset(214, 19)

  2262. keybindList.Name = "keybindList"

  2263. keybindList.Parent = keybindPositioner

  2264. keybindList.FillDirection = Enum.FillDirection.Horizontal

  2265. keybindList.HorizontalAlignment = Enum.HorizontalAlignment.Right

  2266. keybindList.SortOrder = Enum.SortOrder.LayoutOrder

  2267. keybindList.VerticalAlignment = Enum.VerticalAlignment.Center

  2268. keybindButton.Name = "keybindButton"

  2269. keybindButton.Parent = keybindPositioner

  2270. keybindButton.Active = false

  2271. keybindButton.BackgroundColor3 = Color3.new(1, 1, 1)

  2272. keybindButton.BackgroundTransparency = 1

  2273. keybindButton.Position = UDim2.fromScale(0.598130822, 0.184210524)

  2274. keybindButton.Selectable = false

  2275. keybindButton.Size = UDim2.fromOffset(46, 12)

  2276. keybindButton.Font = Enum.Font.Code

  2277. keybindButton.Text = (presetKeybind and tostring(presetKeybind):gsub("Enum.KeyCode.", "") or "[NONE]")

  2278. keybindButton.TextColor3 = library.colors.otherElementText

  2279. local colored_keybindButton_TextColor3 = {keybindButton, "TextColor3", "otherElementText"}

  2280. colored[1 + #colored] = colored_keybindButton_TextColor3

  2281. keybindButton.TextSize = 14

  2282. keybindButton.TextXAlignment = Enum.TextXAlignment.Right

  2283. keybindButton.Size = UDim2.fromOffset(textToSize(keybindButton).X + 4, 12)

  2284. sectionFunctions:Update()

  2285. local last_v = bindedKey or presetKeybind

  2286. local function newkey()

  2287. local old_texts = keybindButton.Text

  2288. colored_keybindButton_TextColor3[3] = "main"

  2289. colored_keybindButton_TextColor3[4] = nil

  2290. tweenService:Create(keybindButton, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  2291. TextColor3 = library.colors.main

  2292. }):Play()

  2293. if last_v then

  2294. keybindButton.Text = "(Was " .. (last_v and tostring(last_v):gsub("Enum.KeyCode.", "") or "[NONE]") .. ") [...]"

  2295. else

  2296. keybindButton.Text = "[...]"

  2297. end

  2298. local receivingKey = nil

  2299. receivingKey = userInputService.InputBegan:Connect(function(key)

  2300. last_v = library_flags[flag]

  2301. if not keyHandler.notAllowedKeys[key.KeyCode] then

  2302. if key.KeyCode ~= Enum.KeyCode.Unknown then

  2303. bindedKey = (key.KeyCode ~= Enum.KeyCode.Escape and key.KeyCode) or library_flags[flag]

  2304. library_flags[flag] = bindedKey

  2305. if options.Location then

  2306. options.Location[options.LocationFlag or flag] = bindedKey

  2307. end

  2308. if bindedKey then

  2309. keyName = keyHandler.allowedKeys[bindedKey]

  2310. keybindButton.Text = "[" .. (keyName or bindedKey.Name or tostring(key.KeyCode):gsub("Enum.KeyCode.", "")) .. "]"

  2311. keybindButton.Size = UDim2.fromOffset(textToSize(keybindButton).X + 4, 12)

  2312. justBinded = true

  2313. colored_keybindButton_TextColor3[3] = "otherElementText"

  2314. colored_keybindButton_TextColor3[4] = nil

  2315. tweenService:Create(keybindButton, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  2316. TextColor3 = library.colors.otherElementText

  2317. }):Play()

  2318. receivingKey:Disconnect()

  2319. end

  2320. if callback and last_v ~= bindedKey then

  2321. task.spawn(callback, bindedKey, last_v)

  2322. end

  2323. return

  2324. elseif key.KeyCode == Enum.KeyCode.Unknown and not keyHandler.notAllowedMouseInputs[key.UserInputType] then

  2325. bindedKey = key.UserInputType

  2326. library_flags[flag] = bindedKey

  2327. if options.Location then

  2328. options.Location[options.LocationFlag or flag] = bindedKey

  2329. end

  2330. keyName = keyHandler.allowedKeys[bindedKey]

  2331. keybindButton.Text = "[" .. (keyName or bindedKey.Name or tostring(key.KeyCode):gsub("Enum.KeyCode.", "")) .. "]"

  2332. keybindButton.Size = UDim2.fromOffset(textToSize(keybindButton).X + 4, 12)

  2333. justBinded = true

  2334. colored_keybindButton_TextColor3[3] = "otherElementText"

  2335. colored_keybindButton_TextColor3[4] = nil

  2336. tweenService:Create(keybindButton, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  2337. TextColor3 = library.colors.otherElementText

  2338. }):Play()

  2339. receivingKey:Disconnect()

  2340. if callback and last_v ~= bindedKey then

  2341. task.spawn(callback, bindedKey, last_v)

  2342. end

  2343. return

  2344. end

  2345. end

  2346. if key.KeyCode == Enum.KeyCode.Backspace or Enum.KeyCode.Escape == key.KeyCode then

  2347. old_texts, bindedKey = "[NONE]", nil

  2348. end

  2349. keybindButton.Text = old_texts

  2350. colored_keybindButton_TextColor3[3] = "otherElementText"

  2351. colored_keybindButton_TextColor3[4] = nil

  2352. tweenService:Create(keybindButton, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  2353. TextColor3 = library.colors.otherElementText

  2354. }):Play()

  2355. receivingKey:Disconnect()

  2356. if callback and last_v ~= bindedKey then

  2357. task.spawn(callback, bindedKey, last_v)

  2358. end

  2359. end)

  2360. library.signals[1 + #library.signals] = receivingKey

  2361. end

  2362. library.signals[1 + #library.signals] = keybindButton.MouseButton1Click:Connect(newkey)

  2363. library.signals[1 + #library.signals] = newKeybind.InputEnded:Connect(function(input)

  2364. if not library.colorpicker and not submenuOpen and input.UserInputType == Enum.UserInputType.MouseButton1 then

  2365. newkey()

  2366. end

  2367. end)

  2368. if presscallback then

  2369. library.signals[1 + #library.signals] = userInputService.InputBegan:Connect(function(key, chatting)

  2370. if not keyHandler.notAllowedKeys[key.KeyCode] and not keyHandler.notAllowedMouseInputs[key.UserInputType] then

  2371. if not justBinded and bindedKey == key.UserInputType or not justBinded and bindedKey == key.KeyCode and not chatting then

  2372. if presscallback then

  2373. task.spawn(presscallback, key, chatting)

  2374. end

  2375. end

  2376. if justBinded then

  2377. justBinded = false

  2378. end

  2379. end

  2380. end)

  2381. end

  2382. local function set(t, key)

  2383. if nil == key and t ~= nil then

  2384. key = t

  2385. end

  2386. if key == "nil" or key == "NONE" or key == "none" then

  2387. key = nil

  2388. end

  2389. last_v = library_flags[flag]

  2390. bindedKey = key

  2391. library_flags[flag] = key

  2392. if options.Location then

  2393. options.Location[options.LocationFlag or flag] = key

  2394. end

  2395. keyName = (key == nil and "NONE") or keyHandler.allowedKeys[key]

  2396. keybindButton.Text = "[" .. (keyName or key.Name or tostring(key):gsub("Enum.KeyCode.", "")) .. "]"

  2397. keybindButton.Size = UDim2.fromOffset(textToSize(keybindButton).X + 4, 12)

  2398. justBinded = true

  2399. colored_keybindButton_TextColor3[3] = "otherElementText"

  2400. colored_keybindButton_TextColor3[4] = nil

  2401. tweenService:Create(keybindButton, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  2402. TextColor3 = library.colors.otherElementText

  2403. }):Play()

  2404. if callback and (last_v ~= key or options.AllowDuplicateCalls) then

  2405. task.spawn(callback, key, last_v)

  2406. end

  2407. return key

  2408. end

  2409. if presetKeybind ~= nil then

  2410. set(presetKeybind)

  2411. else

  2412. library_flags[flag] = bindedKey

  2413. if options.Location then

  2414. options.Location[options.LocationFlag or flag] = bindedKey

  2415. end

  2416. end

  2417. local default = library_flags[flag]

  2418. local function update()

  2419. keybindName, callback, presscallback = options.Name or keybindName, options.Callback, options.Pressed

  2420. local key = library_flags[flag]

  2421. keyName = (key == nil and "NONE") or keyHandler.allowedKeys[key]

  2422. keybindButton.Text = "[" .. (keyName or key.Name or tostring(key):gsub("Enum.KeyCode.", "")) .. "]"

  2423. keybindButton.Size = UDim2.fromOffset(textToSize(keybindButton).X + 4, 12)

  2424. colored_keybindButton_TextColor3[3] = "otherElementText"

  2425. colored_keybindButton_TextColor3[4] = nil

  2426. tweenService:Create(keybindButton, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  2427. TextColor3 = library.colors.otherElementText

  2428. }):Play()

  2429. keybindHeadline.Text = (keybindName and tostring(keybindName)) or "???"

  2430. return key

  2431. end

  2432. local objectdata = {

  2433. Options = options,

  2434. Name = flag,

  2435. Flag = flag,

  2436. Type = "Keybind",

  2437. Default = default,

  2438. Parent = sectionFunctions,

  2439. Instance = keybindButton,

  2440. Get = function()

  2441. return library_flags[flag]

  2442. end,

  2443. Set = set,

  2444. RawSet = function(t, key)

  2445. if nil == key and t ~= nil then

  2446. key = t

  2447. end

  2448. if key == "nil" or key == "NONE" or key == "none" then

  2449. key = nil

  2450. end

  2451. last_v = library_flags[flag]

  2452. bindedKey = key

  2453. library_flags[flag] = key

  2454. if options.Location then

  2455. options.Location[options.LocationFlag or flag] = key

  2456. end

  2457. justBinded = true

  2458. return key

  2459. end,

  2460. Update = update,

  2461. Reset = function()

  2462. return set(nil, default)

  2463. end

  2464. }

  2465. tabFunctions.Flags[flag], sectionFunctions.Flags[flag], elements[flag] = objectdata, objectdata, objectdata

  2466. return objectdata

  2467. end

  2468. sectionFunctions.NewKeybind = sectionFunctions.AddKeybind

  2469. sectionFunctions.CreateKeybind = sectionFunctions.AddKeybind

  2470. sectionFunctions.Keybind = sectionFunctions.AddKeybind

  2471. sectionFunctions.Bind = sectionFunctions.AddKeybind

  2472. function sectionFunctions:AddLabel(options, ...)

  2473. options = (options and type(options) == "string" and resolvevararg("Label", options, ...)) or options

  2474. local labelName, flag = options.Text or options.Value or options.Name, options.Flag or (function()

  2475. library.unnamedlabels = 1 + (library.unnamedlabels or 0)

  2476. return "Label" .. tostring(library.unnamedlabels)

  2477. end)()

  2478. if elements[flag] ~= nil then

  2479. warn(debug.traceback("Warning! Re-used flag '" .. flag .. "'", 3))

  2480. end

  2481. local newLabel = Instance_new("Frame")

  2482. local labelHeadline = Instance_new("TextLabel")

  2483. local labelPositioner = Instance_new("Frame")

  2484. local labelButton = Instance_new("TextButton")

  2485. newLabel.Name = "newLabel"

  2486. newLabel.Parent = sectionHolder

  2487. newLabel.BackgroundColor3 = Color3.new(1, 1, 1)

  2488. newLabel.BackgroundTransparency = 1

  2489. newLabel.Size = UDim2.new(1, 0, 0, 19)

  2490. labelHeadline.Name = "labelHeadline"

  2491. labelHeadline.Parent = newLabel

  2492. labelHeadline.BackgroundColor3 = Color3.new(1, 1, 1)

  2493. labelHeadline.BackgroundTransparency = 1

  2494. labelHeadline.Position = UDim2.fromScale(0.031, 0.165842161)

  2495. labelHeadline.Size = UDim2.fromOffset(215, 12)

  2496. labelHeadline.Font = Enum.Font.Code

  2497. labelHeadline.Text = (labelName and tostring(labelName)) or "Empty Text"

  2498. labelHeadline.TextColor3 = library.colors.elementText

  2499. colored[1 + #colored] = {labelHeadline, "TextColor3", "elementText"}

  2500. labelHeadline.TextSize = 14

  2501. labelHeadline.TextXAlignment = Enum.TextXAlignment.Left

  2502. labelPositioner.Name = "labelPositioner"

  2503. labelPositioner.Parent = newLabel

  2504. labelPositioner.BackgroundColor3 = Color3.new(1, 1, 1)

  2505. labelPositioner.BackgroundTransparency = 1

  2506. labelPositioner.Position = UDim2.new(0.00448430516)

  2507. labelPositioner.Size = UDim2.fromOffset(214, 19)

  2508. sectionFunctions:Update()

  2509. local function set(t, str)

  2510. if nil == str and t ~= nil then

  2511. str = t

  2512. end

  2513. labelHeadline.Text = (nil ~= str and tostring(str)) or "Empty Text"

  2514. return str

  2515. end

  2516. local default = labelHeadline.Text

  2517. local objectdata = {

  2518. Options = options,

  2519. Name = flag,

  2520. Flag = flag,

  2521. Type = "Label",

  2522. Default = default,

  2523. Parent = sectionFunctions,

  2524. Instance = labelHeadline,

  2525. Get = function()

  2526. return labelHeadline.Text, labelHeadline

  2527. end,

  2528. Set = set,

  2529. RawSet = set,

  2530. Update = function()

  2531. return labelHeadline.Text

  2532. end,

  2533. Reset = function()

  2534. return set(nil, default)

  2535. end

  2536. }

  2537. tabFunctions.Flags[flag], sectionFunctions.Flags[flag], elements[flag] = objectdata, objectdata, objectdata

  2538. return objectdata

  2539. end

  2540. sectionFunctions.NewLabel = sectionFunctions.AddLabel

  2541. sectionFunctions.CreateLabel = sectionFunctions.AddLabel

  2542. sectionFunctions.Label = sectionFunctions.AddLabel

  2543. sectionFunctions.Text = sectionFunctions.AddLabel

  2544. function sectionFunctions:AddSlider(options, ...)

  2545. options = (options and type(options) == "string" and resolvevararg("Slider", options, ...)) or options

  2546. local sliderName, maxValue, minValue, presetValue, callback, flagName = assert(options.Name, "Missing Name for new slider."), assert(options.Max, "Missing Max for new slider."), assert(options.Min, "Missing Min for new slider."), options.Value, options.Callback, options.Flag or (function()

  2547. library.unnamedsliders = 1 + (library.unnamedsliders or 0)

  2548. return "Slider" .. tostring(library.unnamedsliders)

  2549. end)()

  2550. if elements[flagName] ~= nil then

  2551. warn(debug.traceback("Warning! Re-used flag '" .. flagName .. "'", 3))

  2552. end

  2553. local decimalprecision = tonumber(options.Decimals or options.Precision or options.Precise)

  2554. if not decimalprecision and options.Max - options.Min <= 1 then

  2555. decimalprecision = 1

  2556. end

  2557. if decimalprecision then

  2558. decimalprecision = math.clamp(decimalprecision, 0, 99)

  2559. if decimalprecision <= 0 then

  2560. decimalprecision = nil

  2561. end

  2562. decimalprecision = tostring(decimalprecision)

  2563. end

  2564. local formattyp = options.Format and type(options.Format)

  2565. local function resolvedisplay(val, was)

  2566. local str = nil

  2567. if decimalprecision then

  2568. str = string.format("%0." .. decimalprecision .. "f", val)

  2569. end

  2570. str = str or tostring(val)

  2571. if formattyp == "string" then

  2572. return string.format(options.Format, val)

  2573. elseif formattyp == "function" then

  2574. local oof, g = pcall(options.Format, val, was)

  2575. if not oof or not g then

  2576. warn("Your format function for", sliderName, "Slider:", flagName, "has returned nothing. It should return a string to display.", debug.traceback(""))

  2577. return "Format Function Errored"

  2578. end

  2579. return tostring(g)

  2580. end

  2581. return (sliderName or "???") .. ": " .. str

  2582. end

  2583. local usetextbox = options.Textbox or options.InputBox or options.CustomInput

  2584. local newSlider = Instance_new("Frame")

  2585. local slider = Instance_new("ImageLabel")

  2586. local sliderInner = Instance_new("ImageLabel")

  2587. local sliderColored = Instance_new("ImageLabel")

  2588. local sliderHeadline = Instance_new("TextLabel")

  2589. local startingValue = presetValue or minValue

  2590. local sliderDragging = false

  2591. newSlider.Name = "newSlider"

  2592. newSlider.Parent = sectionHolder

  2593. newSlider.BackgroundColor3 = Color3.new(1, 1, 1)

  2594. newSlider.BackgroundTransparency = 1

  2595. newSlider.Size = UDim2.new(1, 0, 0, 42)

  2596. slider.Name = "slider"

  2597. slider.Parent = newSlider

  2598. slider.Active = true

  2599. slider.BackgroundColor3 = library.colors.topGradient

  2600. local colored_slider_BackgroundColor3 = {slider, "BackgroundColor3", "topGradient"}

  2601. colored[1 + #colored] = colored_slider_BackgroundColor3

  2602. slider.BorderColor3 = library.colors.elementBorder

  2603. colored[1 + #colored] = {slider, "BorderColor3", "elementBorder"}

  2604. slider.Position = UDim2.fromScale(0.031, 0.48)

  2605. slider.Selectable = true

  2606. slider.Size = (usetextbox and UDim2.fromOffset(156, 18)) or UDim2.fromOffset(206, 18)

  2607. slider.Image = "rbxassetid://2454009026"

  2608. slider.ImageColor3 = library.colors.bottomGradient

  2609. local colored_slider_ImageColor3 = {slider, "ImageColor3", "bottomGradient"}

  2610. colored[1 + #colored] = colored_slider_ImageColor3

  2611. sliderInner.Name = "sliderInner"

  2612. sliderInner.Parent = slider

  2613. sliderInner.Active = true

  2614. sliderInner.AnchorPoint = Vector2.new(0.5, 0.5)

  2615. sliderInner.BackgroundColor3 = library.colors.topGradient

  2616. colored[1 + #colored] = {sliderInner, "BackgroundColor3", "topGradient"}

  2617. sliderInner.BorderColor3 = library.colors.elementBorder

  2618. colored[1 + #colored] = {sliderInner, "BorderColor3", "elementBorder"}

  2619. sliderInner.Position = UDim2.fromScale(0.5, 0.5)

  2620. sliderInner.Selectable = true

  2621. sliderInner.Size = UDim2.new(1, -4, 1, -4)

  2622. sliderInner.Image = "rbxassetid://2454009026"

  2623. sliderInner.ImageColor3 = library.colors.bottomGradient

  2624. colored[1 + #colored] = {sliderInner, "ImageColor3", "bottomGradient"}

  2625. sliderColored.Name = "sliderColored"

  2626. sliderColored.Parent = sliderInner

  2627. sliderColored.Active = true

  2628. sliderColored.BackgroundColor3 = darkenColor(library.colors.main, 1.5)

  2629. colored[1 + #colored] = {sliderColored, "BackgroundColor3", "main", 1.5}

  2630. sliderColored.BorderSizePixel = 0

  2631. sliderColored.Selectable = true

  2632. sliderColored.Size = UDim2.fromScale(((startingValue or minValue) - minValue) / (maxValue - minValue), 1)

  2633. sliderColored.Image = "rbxassetid://2454009026"

  2634. sliderColored.ImageColor3 = darkenColor(library.colors.main, 2.5)

  2635. colored[1 + #colored] = {sliderColored, "ImageColor3", "main", 2.5}

  2636. sliderHeadline.Name = "sliderHeadline"

  2637. sliderHeadline.Parent = newSlider

  2638. sliderHeadline.Active = true

  2639. sliderHeadline.BackgroundColor3 = Color3.new(1, 1, 1)

  2640. sliderHeadline.BackgroundTransparency = 1

  2641. sliderHeadline.Position = UDim2.new(0.031)

  2642. sliderHeadline.Selectable = true

  2643. sliderHeadline.Size = UDim2.fromOffset(206, 20)

  2644. sliderHeadline.ZIndex = 5

  2645. sliderHeadline.Font = Enum.Font.Code

  2646. sliderHeadline.LineHeight = 1.15

  2647. sliderHeadline.Text = resolvedisplay(startingValue)

  2648. sliderHeadline.TextColor3 = library.colors.elementText

  2649. colored[1 + #colored] = {sliderHeadline, "TextColor3", "elementText"}

  2650. sliderHeadline.TextSize = 14

  2651. sliderHeadline.TextXAlignment = Enum.TextXAlignment.Left

  2652. local realTextbox = nil

  2653. local function Set(t, newValue)

  2654. if nil == newValue and t ~= nil then

  2655. newValue = t

  2656. end

  2657. minValue, maxValue = options.Min, options.Max

  2658. if newValue and (options.IllegalInput or ((not minValue or newValue >= minValue) and (not maxValue or newValue <= maxValue))) then

  2659. local last_val = library_flags[flagName]

  2660. library_flags[flagName] = newValue

  2661. if options.Location then

  2662. options.Location[options.LocationFlag or flagName] = newValue

  2663. end

  2664. do

  2665. local newValue = (options.IllegalInput and math.clamp(newValue, minValue or -math.huge, maxValue or math.huge)) or newValue

  2666. tweenService:Create(sliderColored, TweenInfo.new(0.25, library.configuration.easingStyle, library.configuration.easingDirection), {

  2667. Size = UDim2.fromScale(((newValue or minValue) - minValue) / (maxValue - minValue), 1)

  2668. }):Play()

  2669. end

  2670. sliderHeadline.Text = resolvedisplay(newValue, last_val)

  2671. if usetextbox and realTextbox then

  2672. realTextbox.Text = tostring(newValue)

  2673. end

  2674. if callback and (last_val ~= newValue or options.AllowDuplicateCalls) then

  2675. task.spawn(callback, newValue, last_val)

  2676. end

  2677. end

  2678. return newValue

  2679. end

  2680. if presetValue ~= nil then

  2681. Set(presetValue)

  2682. else

  2683. library_flags[flagName] = startingValue

  2684. if options.Location then

  2685. options.Location[options.LocationFlag or flagName] = startingValue

  2686. end

  2687. end

  2688. if usetextbox then

  2689. if type(usetextbox) ~= "table" then

  2690. usetextbox = options

  2691. end

  2692. local textbox = Instance_new("ImageLabel")

  2693. local textboxInner = Instance_new("ImageLabel")

  2694. realTextbox = Instance_new("TextBox")

  2695. textbox.Name = "textbox"

  2696. textbox.Parent = newSlider

  2697. textbox.Active = true

  2698. textbox.BackgroundColor3 = library.colors.topGradient

  2699. local colored_textbox_BackgroundColor3 = {textbox, "BackgroundColor3", "topGradient"}

  2700. colored[1 + #colored] = colored_textbox_BackgroundColor3

  2701. textbox.BorderColor3 = library.colors.elementBorder

  2702. colored[1 + #colored] = {textbox, "BorderColor3", "elementBorder"}

  2703. textbox.Position = UDim2.new(1, -54, 0.48)

  2704. textbox.Selectable = true

  2705. textbox.Size = UDim2.fromOffset(43, 18)

  2706. textbox.Image = "rbxassetid://2454009026"

  2707. textbox.ImageColor3 = library.colors.bottomGradient

  2708. local colored_textbox_ImageColor3 = {textbox, "ImageColor3", "bottomGradient"}

  2709. colored[1 + #colored] = colored_textbox_ImageColor3

  2710. textboxInner.Name = "textboxInner"

  2711. textboxInner.Parent = textbox

  2712. textboxInner.Active = true

  2713. textboxInner.AnchorPoint = Vector2.new(0.5, 0.5)

  2714. textboxInner.BackgroundColor3 = library.colors.topGradient

  2715. colored[1 + #colored] = {textboxInner, "BackgroundColor3", "topGradient"}

  2716. textboxInner.BorderColor3 = library.colors.elementBorder

  2717. colored[1 + #colored] = {textboxInner, "BorderColor3", "elementBorder"}

  2718. textboxInner.Position = UDim2.fromScale(0.5, 0.5)

  2719. textboxInner.Selectable = true

  2720. textboxInner.Size = UDim2.new(1, -4, 1, -4)

  2721. textboxInner.Image = "rbxassetid://2454009026"

  2722. textboxInner.ImageColor3 = library.colors.bottomGradient

  2723. colored[1 + #colored] = {textboxInner, "ImageColor3", "bottomGradient"}

  2724. realTextbox.Name = "realTextbox"

  2725. realTextbox.Parent = textbox

  2726. realTextbox.BackgroundColor3 = Color3.new(1, 1, 1)

  2727. realTextbox.BackgroundTransparency = 1

  2728. realTextbox.Position = UDim2.new(0.0295485705)

  2729. realTextbox.Size = UDim2.fromScale(0.97, 1)

  2730. realTextbox.ZIndex = 5

  2731. realTextbox.ClearTextOnFocus = false

  2732. realTextbox.Font = Enum.Font.Code

  2733. realTextbox.LineHeight = 1.15

  2734. realTextbox.Text = tostring(presetValue)

  2735. realTextbox.TextColor3 = library.colors.otherElementText

  2736. colored[1 + #colored] = {realTextbox, "TextColor3", "otherElementText"}

  2737. realTextbox.TextSize = 14

  2738. realTextbox.PlaceholderText = (presetValue ~= nil and tostring(presetValue)) or ""

  2739. library.signals[1 + #library.signals] = realTextbox.FocusLost:Connect(function()

  2740. local val = realTextbox.Text

  2741. if usetextbox.PreFormat then

  2742. local typ = type(usetextbox.PreFormat)

  2743. if typ == "function" then

  2744. local x, e = pcall(usetextbox.PreFormat, val)

  2745. if not x and e then

  2746. warn("Error in Pre-Format (Textbox " .. flagName .. "):", e)

  2747. else

  2748. val = e

  2749. end

  2750. end

  2751. end

  2752. val = (not usetextbox.Hex and not usetextbox.Binary and not usetextbox.Base and (tonumber(val) or tonumber(val:gsub("%D", ""), 10) or 0)) or tonumber(val, (usetextbox.Hex and 16) or (usetextbox.Binary and 2) or usetextbox.Base or 10) or 0

  2753. if not options.IllegalInput and (options.Max or options.Min) then

  2754. val = math.clamp(val, options.Min or -math.huge, options.Max or math.huge)

  2755. end

  2756. local decimalprecision = tonumber(options.Decimals or options.Precision or options.Precise)

  2757. if decimalprecision then

  2758. val = tonumber(string.format("%0." .. tostring(decimalprecision) .. "f", val))

  2759. end

  2760. if usetextbox.PostFormat then

  2761. local typ = type(usetextbox.PostFormat)

  2762. if typ == "function" then

  2763. local x, e = pcall(usetextbox.PostFormat, val)

  2764. if not x and e then

  2765. warn("Error in Post-Format (Textbox " .. flagName .. "):", e)

  2766. else

  2767. val = e

  2768. end

  2769. end

  2770. end

  2771. Set((val and tonumber(val)) or presetValue or 0)

  2772. end)

  2773. library.signals[1 + #library.signals] = textbox.MouseEnter:Connect(function()

  2774. colored_textbox_BackgroundColor3[3] = "main"

  2775. colored_textbox_BackgroundColor3[4] = 1.5

  2776. colored_textbox_ImageColor3[3] = "main"

  2777. colored_textbox_ImageColor3[4] = 2.5

  2778. tweenService:Create(textbox, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  2779. BackgroundColor3 = darkenColor(library.colors.main, 1.5),

  2780. ImageColor3 = darkenColor(library.colors.main, 2.5)

  2781. }):Play()

  2782. end)

  2783. library.signals[1 + #library.signals] = textbox.MouseLeave:Connect(function()

  2784. colored_textbox_BackgroundColor3[3] = "topGradient"

  2785. colored_textbox_BackgroundColor3[4] = nil

  2786. colored_textbox_ImageColor3[3] = "bottomGradient"

  2787. colored_textbox_ImageColor3[4] = nil

  2788. tweenService:Create(textbox, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  2789. BackgroundColor3 = library.colors.topGradient,

  2790. ImageColor3 = library.colors.bottomGradient

  2791. }):Play()

  2792. end)

  2793. end

  2794. sectionFunctions:Update()

  2795. library.signals[1 + #library.signals] = slider.MouseEnter:Connect(function()

  2796. colored_slider_BackgroundColor3[3] = "main"

  2797. colored_slider_BackgroundColor3[4] = 1.5

  2798. colored_slider_ImageColor3[3] = "main"

  2799. colored_slider_ImageColor3[4] = 2.5

  2800. tweenService:Create(slider, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  2801. BackgroundColor3 = darkenColor(library.colors.main, 1.5),

  2802. ImageColor3 = darkenColor(library.colors.main, 2.5)

  2803. }):Play()

  2804. end)

  2805. library.signals[1 + #library.signals] = slider.MouseLeave:Connect(function()

  2806. colored_slider_BackgroundColor3[3] = "topGradient"

  2807. colored_slider_BackgroundColor3[4] = nil

  2808. colored_slider_ImageColor3[3] = "bottomGradient"

  2809. colored_slider_ImageColor3[4] = nil

  2810. tweenService:Create(slider, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  2811. BackgroundColor3 = library.colors.topGradient,

  2812. ImageColor3 = library.colors.bottomGradient

  2813. }):Play()

  2814. end)

  2815. local function sliding(input, sb, sc)

  2816. local last_val = library_flags[flagName]

  2817. local pos = UDim2.fromScale(math.clamp((input.Position.X - sb.AbsolutePosition.X) / sb.AbsoluteSize.X, 0, 1), 1)

  2818. tweenService:Create(sc, TweenInfo.new(0.25, library.configuration.easingStyle, library.configuration.easingDirection), {

  2819. Size = pos

  2820. }):Play()

  2821. local sliderValue = nil

  2822. if decimalprecision then

  2823. sliderValue = tonumber(string.format("%0." .. decimalprecision .. "f", ((pos.X.Scale * maxValue) / maxValue) * (maxValue - minValue) + minValue))

  2824. end

  2825. sliderValue = sliderValue or tonumber(string.format("%0.2f", (floor(((pos.X.Scale * maxValue) / maxValue) * (maxValue - minValue) + minValue))))

  2826. library_flags[flagName] = sliderValue

  2827. if options.Location then

  2828. options.Location[options.LocationFlag or flagName] = sliderValue

  2829. end

  2830. sliderHeadline.Text = resolvedisplay(sliderValue, last_val)

  2831. if usetextbox and realTextbox then

  2832. realTextbox.Text = tostring(sliderValue)

  2833. end

  2834. if callback and last_val ~= sliderValue then

  2835. task.spawn(callback, sliderValue, last_val)

  2836. end

  2837. last_val = sliderValue

  2838. end

  2839. library.signals[1 + #library.signals] = newSlider.InputBegan:Connect(function(input)

  2840. if not library.colorpicker and input.UserInputType == Enum.UserInputType.MouseButton1 then

  2841. sliderDragging = true

  2842. isDraggingSomething = true

  2843. end

  2844. end)

  2845. library.signals[1 + #library.signals] = newSlider.InputEnded:Connect(function(input)

  2846. if not library.colorpicker and input.UserInputType == Enum.UserInputType.MouseButton1 then

  2847. sliderDragging = false

  2848. isDraggingSomething = false

  2849. end

  2850. end)

  2851. library.signals[1 + #library.signals] = newSlider.InputBegan:Connect(function(input)

  2852. if not library.colorpicker and not isDraggingSomething and input.UserInputType == Enum.UserInputType.MouseButton1 then

  2853. isDraggingSomething = true

  2854. sliding(input, sliderInner, sliderColored)

  2855. end

  2856. end)

  2857. library.signals[1 + #library.signals] = userInputService.InputChanged:Connect(function(input)

  2858. if not library.colorpicker and sliderDragging and input.UserInputType == Enum.UserInputType.MouseMovement then

  2859. sliding(input, sliderInner, sliderColored)

  2860. end

  2861. end)

  2862. local default = library_flags[flagName]

  2863. local function Update(t, last_val)

  2864. if last_val == nil and t ~= nil and type(t) ~= "table" then

  2865. last_val = t

  2866. end

  2867. sliderName, maxValue, minValue, callback = options.Name or sliderName, options.Max or maxValue, options.Min or minValue, options.Callback

  2868. local newValue = library_flags[flagName]

  2869. do

  2870. local newValue = math.clamp(newValue, options.Min or -math.huge, options.Max or math.huge)

  2871. tweenService:Create(sliderColored, TweenInfo.new(0.25, library.configuration.easingStyle, library.configuration.easingDirection), {

  2872. Size = UDim2.fromScale(((newValue or minValue) - minValue) / (maxValue - minValue), 1)

  2873. }):Play()

  2874. end

  2875. sliderHeadline.Text = resolvedisplay(newValue, last_val)

  2876. if usetextbox and realTextbox then

  2877. realTextbox.Text = tostring(newValue)

  2878. end

  2879. return newValue

  2880. end

  2881. local objectdata = {

  2882. Options = options,

  2883. Name = flagName,

  2884. Flag = flagName,

  2885. Type = "Slider",

  2886. Default = default,

  2887. Parent = sectionFunctions,

  2888. Instance = sliderHeadline,

  2889. Set = Set,

  2890. Get = function()

  2891. return library_flags[flagName]

  2892. end,

  2893. SetConstraints = function(t, min, max)

  2894. if t and type(t) ~= "table" then

  2895. min, max = t, min

  2896. end

  2897. if min then

  2898. options.Min = min

  2899. end

  2900. if max then

  2901. options.Max = max

  2902. end

  2903. Update()

  2904. end,

  2905. SetMin = function(t, min)

  2906. if min == nil and t ~= nil then

  2907. min = t

  2908. end

  2909. if min and min ~= options.Min then

  2910. options.Min = min

  2911. Update()

  2912. end

  2913. end,

  2914. SetMax = function(t, max)

  2915. if max == nil and t ~= nil then

  2916. max = t

  2917. end

  2918. if max and max ~= options.Max then

  2919. options.Max = max

  2920. Update()

  2921. end

  2922. end,

  2923. Update = Update,

  2924. RawSet = function(t, newValue)

  2925. if nil == newValue and t ~= nil then

  2926. newValue = t

  2927. end

  2928. local last_val = library_flags[flagName]

  2929. library_flags[flagName] = newValue

  2930. if options.Location then

  2931. options.Location[options.LocationFlag or flagName] = newValue

  2932. end

  2933. Update(nil, last_val)

  2934. end,

  2935. Reset = function()

  2936. return Set(nil, default)

  2937. end

  2938. }

  2939. tabFunctions.Flags[flagName], sectionFunctions.Flags[flagName], elements[flagName] = objectdata, objectdata, objectdata

  2940. return objectdata

  2941. end

  2942. sectionFunctions.NewSlider = sectionFunctions.AddSlider

  2943. sectionFunctions.CreateSlider = sectionFunctions.AddSlider

  2944. sectionFunctions.NumberConstraint = sectionFunctions.AddSlider

  2945. sectionFunctions.Slider = sectionFunctions.AddSlider

  2946. sectionFunctions.Slide = sectionFunctions.AddSlider

  2947. function sectionFunctions:AddSearchBox(options, ...)

  2948. options = (options and type(options) == "string" and resolvevararg("SearchBox", options, ...)) or options

  2949. local dropdownName, listt, val, callback, flagName = assert(options.Name, "Missing Name for new searchbox."), assert(options.List, "Missing List for new searchbox."), options.Value, options.Callback, options.Flag or (function()

  2950. library.unnamedsearchbox = 1 + (library.unnamedsearchbox or 0)

  2951. return "SearchBox" .. tostring(library.unnamedsearchbox)

  2952. end)()

  2953. if elements[flagName] ~= nil then

  2954. warn(debug.traceback("Warning! Re-used flag '" .. flagName .. "'", 3))

  2955. end

  2956. local newDropdown = Instance_new("Frame")

  2957. local dropdown = Instance_new("ImageLabel")

  2958. local dropdownInner = Instance_new("ImageLabel")

  2959. local dropdownToggle = Instance_new("ImageButton")

  2960. local dropdownSelection = Instance_new("TextBox")

  2961. local dropdownHeadline = Instance_new("TextLabel")

  2962. local dropdownHolderFrame = Instance_new("ImageLabel")

  2963. local dropdownHolderInner = Instance_new("ImageLabel")

  2964. local realDropdownHolder = Instance_new("ScrollingFrame")

  2965. local realDropdownHolderList = Instance_new("UIListLayout")

  2966. local dropdownEnabled = false

  2967. local resolvelist = getresolver(listt, options.Filter)

  2968. local list = resolvelist()

  2969. local multiselect = options.MultiSelect or options.Multi or options.Multiple

  2970. local passed_multiselect = multiselect and type(multiselect)

  2971. local blankstring = not multiselect and (options.BlankValue or options.NoValueString or options.Nothing)

  2972. local selectedOption = val or list[1] or blankstring

  2973. local addcallback = options.ItemAdded or options.AddedCallback

  2974. local delcallback = options.ItemRemoved or options.RemovedCallback

  2975. local clrcallback = options.ItemsCleared or options.ClearedCallback

  2976. local modcallback = options.ItemChanged or options.ChangedCallback

  2977. if blankstring and val == nil then

  2978. val = blankstring

  2979. end

  2980. if val ~= nil then

  2981. selectedOption = val

  2982. end

  2983. if multiselect and (not selectedOption or type(selectedOption) ~= "table") then

  2984. selectedOption = {}

  2985. end

  2986. local selectedObjects = {}

  2987. local optionCount = 0

  2988. newDropdown.Name = "newDropdown"

  2989. newDropdown.Parent = sectionHolder

  2990. newDropdown.BackgroundColor3 = Color3.new(1, 1, 1)

  2991. newDropdown.BackgroundTransparency = 1

  2992. newDropdown.Size = UDim2.new(1, 0, 0, 42)

  2993. dropdown.Name = "dropdown"

  2994. dropdown.Parent = newDropdown

  2995. dropdown.Active = true

  2996. dropdown.BackgroundColor3 = library.colors.topGradient

  2997. local colored_dropdown_BackgroundColor3 = {dropdown, "BackgroundColor3", "topGradient"}

  2998. colored[1 + #colored] = colored_dropdown_BackgroundColor3

  2999. dropdown.BorderColor3 = library.colors.elementBorder

  3000. colored[1 + #colored] = {dropdown, "BorderColor3", "elementBorder"}

  3001. dropdown.Position = UDim2.fromScale(0.027, 0.45)

  3002. dropdown.Selectable = true

  3003. dropdown.Size = UDim2.fromOffset(206, 18)

  3004. dropdown.Image = "rbxassetid://2454009026"

  3005. dropdown.ImageColor3 = library.colors.bottomGradient

  3006. local colored_dropdown_ImageColor3 = {dropdown, "ImageColor3", "bottomGradient"}

  3007. colored[1 + #colored] = colored_dropdown_ImageColor3

  3008. dropdownInner.Name = "dropdownInner"

  3009. dropdownInner.Parent = dropdown

  3010. dropdownInner.Active = true

  3011. dropdownInner.AnchorPoint = Vector2.new(0.5, 0.5)

  3012. dropdownInner.BackgroundColor3 = library.colors.topGradient

  3013. colored[1 + #colored] = {dropdownInner, "BackgroundColor3", "topGradient"}

  3014. dropdownInner.BorderColor3 = library.colors.elementBorder

  3015. colored[1 + #colored] = {dropdownInner, "BorderColor3", "elementBorder"}

  3016. dropdownInner.Position = UDim2.fromScale(0.5, 0.5)

  3017. dropdownInner.Selectable = true

  3018. dropdownInner.Size = UDim2.new(1, -4, 1, -4)

  3019. dropdownInner.Image = "rbxassetid://2454009026"

  3020. dropdownInner.ImageColor3 = library.colors.bottomGradient

  3021. colored[1 + #colored] = {dropdownInner, "ImageColor3", "bottomGradient"}

  3022. dropdownToggle.Name = "dropdownToggle"

  3023. dropdownToggle.Parent = dropdown

  3024. dropdownToggle.BackgroundColor3 = Color3.new(1, 1, 1)

  3025. dropdownToggle.BackgroundTransparency = 1

  3026. dropdownToggle.Position = UDim2.fromScale(0.9, 0.17)

  3027. dropdownToggle.Rotation = 90

  3028. dropdownToggle.Size = UDim2.fromOffset(12, 12)

  3029. dropdownToggle.ZIndex = 6

  3030. dropdownToggle.Image = "rbxassetid://71659683"

  3031. dropdownToggle.ImageColor3 = Color3.fromRGB(171, 171, 171)

  3032. dropdownSelection.Name = "dropdownSelection"

  3033. dropdownSelection.Parent = dropdown

  3034. dropdownSelection.BackgroundColor3 = Color3.new(1, 1, 1)

  3035. dropdownSelection.BackgroundTransparency = 1

  3036. dropdownSelection.Position = UDim2.new(0.0295485705)

  3037. dropdownSelection.Size = UDim2.fromScale(0.85, 1)

  3038. dropdownSelection.ZIndex = 5

  3039. dropdownSelection.Font = Enum.Font.Code

  3040. dropdownSelection.LineHeight = 1.15

  3041. dropdownSelection.Text = (passed_multiselect == "string" and multiselect) or (multiselect and (blankstring or "Select Item(s)")) or (selectedOption and tostring(selectedOption)) or blankstring or "No Blank String"

  3042. dropdownSelection.TextColor3 = library.colors.otherElementText

  3043. colored[1 + #colored] = {dropdownSelection, "TextColor3", "otherElementText"}

  3044. dropdownSelection.TextSize = 14

  3045. dropdownSelection.TextXAlignment = Enum.TextXAlignment.Left

  3046. dropdownSelection.ClearTextOnFocus = true

  3047. dropdownHeadline.Name = "dropdownHeadline"

  3048. dropdownHeadline.Parent = newDropdown

  3049. dropdownHeadline.BackgroundColor3 = Color3.new(1, 1, 1)

  3050. dropdownHeadline.BackgroundTransparency = 1

  3051. dropdownHeadline.Position = UDim2.fromScale(0.034, 0.03)

  3052. dropdownHeadline.Size = UDim2.fromOffset(167, 11)

  3053. dropdownHeadline.Font = Enum.Font.Code

  3054. dropdownHeadline.Text = (dropdownName and tostring(dropdownName)) or "???"

  3055. dropdownHeadline.TextColor3 = library.colors.elementText

  3056. colored[1 + #colored] = {dropdownHeadline, "TextColor3", "elementText"}

  3057. dropdownHeadline.TextSize = 14

  3058. dropdownHeadline.TextXAlignment = Enum.TextXAlignment.Left

  3059. dropdownHolderFrame.Name = "dropdownHolderFrame"

  3060. dropdownHolderFrame.Parent = newDropdown

  3061. dropdownHolderFrame.Active = true

  3062. dropdownHolderFrame.BackgroundColor3 = library.colors.topGradient

  3063. colored[1 + #colored] = {dropdownHolderFrame, "BackgroundColor3", "topGradient"}

  3064. dropdownHolderFrame.BorderColor3 = library.colors.elementBorder

  3065. colored[1 + #colored] = {dropdownHolderFrame, "BorderColor3", "elementBorder"}

  3066. dropdownHolderFrame.Position = UDim2.fromScale(0.025, 1.012)

  3067. dropdownHolderFrame.Selectable = true

  3068. dropdownHolderFrame.Size = UDim2.fromOffset(206, 22)

  3069. dropdownHolderFrame.Visible = false

  3070. dropdownHolderFrame.Image = "rbxassetid://2454009026"

  3071. dropdownHolderFrame.ImageColor3 = library.colors.bottomGradient

  3072. colored[1 + #colored] = {dropdownHolderFrame, "ImageColor3", "bottomGradient"}

  3073. dropdownHolderInner.Name = "dropdownHolderInner"

  3074. dropdownHolderInner.Parent = dropdownHolderFrame

  3075. dropdownHolderInner.Active = true

  3076. dropdownHolderInner.AnchorPoint = Vector2.new(0.5, 0.5)

  3077. dropdownHolderInner.BackgroundColor3 = library.colors.topGradient

  3078. colored[1 + #colored] = {dropdownHolderInner, "BackgroundColor3", "topGradient"}

  3079. dropdownHolderInner.BorderColor3 = library.colors.elementBorder

  3080. dropdownHolderInner.Position = UDim2.fromScale(0.5, 0.5)

  3081. dropdownHolderInner.Selectable = true

  3082. dropdownHolderInner.Size = UDim2.new(1, -4, 1, -4)

  3083. dropdownHolderInner.Image = "rbxassetid://2454009026"

  3084. dropdownHolderInner.ImageColor3 = library.colors.bottomGradient

  3085. colored[1 + #colored] = {dropdownHolderInner, "ImageColor3", "bottomGradient"}

  3086. realDropdownHolder.Name = "realDropdownHolder"

  3087. realDropdownHolder.Parent = dropdownHolderInner

  3088. realDropdownHolder.BackgroundColor3 = Color3.new(1, 1, 1)

  3089. realDropdownHolder.BackgroundTransparency = 1

  3090. realDropdownHolder.Selectable = false

  3091. realDropdownHolder.Size = UDim2.fromScale(1, 1)

  3092. realDropdownHolder.CanvasSize = UDim2.new()

  3093. realDropdownHolder.ScrollBarThickness = 5

  3094. realDropdownHolder.ScrollingDirection = Enum.ScrollingDirection.Y

  3095. realDropdownHolder.AutomaticCanvasSize = Enum.AutomaticSize.Y

  3096. realDropdownHolder.ScrollBarImageTransparency = 0.5

  3097. realDropdownHolder.ScrollBarImageColor3 = library.colors.section

  3098. colored[1 + #colored] = {realDropdownHolder, "ScrollBarImageColor3", "section"}

  3099. realDropdownHolderList.Name = "realDropdownHolderList"

  3100. realDropdownHolderList.Parent = realDropdownHolder

  3101. realDropdownHolderList.HorizontalAlignment = Enum.HorizontalAlignment.Center

  3102. realDropdownHolderList.SortOrder = Enum.SortOrder.LayoutOrder

  3103. sectionFunctions:Update()

  3104. local restorezindex = {}

  3105. library.signals[1 + #library.signals] = newDropdown.MouseEnter:Connect(function()

  3106. colored_dropdown_BackgroundColor3[3] = "main"

  3107. colored_dropdown_BackgroundColor3[4] = 1.5

  3108. colored_dropdown_ImageColor3[3] = "main"

  3109. colored_dropdown_ImageColor3[4] = 2.5

  3110. tweenService:Create(dropdown, TweenInfo.new(0.25, library.configuration.easingStyle, library.configuration.easingDirection), {

  3111. BackgroundColor3 = darkenColor(library.colors.main, 1.5),

  3112. ImageColor3 = darkenColor(library.colors.main, 2.5)

  3113. }):Play()

  3114. end)

  3115. library.signals[1 + #library.signals] = newDropdown.MouseLeave:Connect(function()

  3116. if not dropdownEnabled then

  3117. colored_dropdown_BackgroundColor3[3] = "topGradient"

  3118. colored_dropdown_BackgroundColor3[4] = nil

  3119. colored_dropdown_ImageColor3[3] = "bottomGradient"

  3120. colored_dropdown_ImageColor3[4] = nil

  3121. tweenService:Create(dropdown, TweenInfo.new(0.25, library.configuration.easingStyle, library.configuration.easingDirection), {

  3122. BackgroundColor3 = library.colors.topGradient,

  3123. ImageColor3 = library.colors.bottomGradient

  3124. }):Play()

  3125. end

  3126. end)

  3127. local function UpdateDropdownHolder()

  3128. if optionCount >= 6 then

  3129. realDropdownHolder.CanvasSize = UDim2:fromOffset(realDropdownHolderList.AbsoluteContentSize.Y + 2)

  3130. elseif optionCount <= 5 then

  3131. dropdownHolderFrame.Size = UDim2.fromOffset(206, realDropdownHolderList.AbsoluteContentSize.Y + 4)

  3132. end

  3133. end

  3134. local function AddOptions(optionsTable, filter)

  3135. if options.Sort then

  3136. local didstuff, dosort = nil, options.Sort

  3137. if type(dosort) == "function" then

  3138. local g, h = pcall(table.sort, optionsTable, dosort)

  3139. if g then

  3140. didstuff = true

  3141. elseif h then

  3142. warn("Error sorting list:", h, debug.traceback(""))

  3143. end

  3144. end

  3145. if not didstuff then

  3146. table.sort(optionsTable, library.defaultSort)

  3147. end

  3148. end

  3149. if blankstring and (optionsTable[1] ~= blankstring or table.find(optionsTable, blankstring, 2)) then

  3150. local exists = table.find(optionsTable, blankstring)

  3151. if exists then

  3152. for _ = 1, 35 do

  3153. table.remove(optionsTable, exists)

  3154. exists = table.find(optionsTable, blankstring)

  3155. if not exists then

  3156. break

  3157. end

  3158. end

  3159. end

  3160. table.insert(optionsTable, 1, blankstring)

  3161. end

  3162. optionCount = 0

  3163. realDropdownHolderList.Parent = nil

  3164. realDropdownHolder:ClearAllChildren()

  3165. realDropdownHolderList.Parent = realDropdownHolder

  3166. for _, v in next, optionsTable do

  3167. if not filter or tostring(v):lower():find(dropdownSelection.Text:lower(), 1, not options.RegEx) then

  3168. optionCount = optionCount + 1

  3169. UpdateDropdownHolder()

  3170. local newOption = Instance_new("ImageLabel")

  3171. local optionButton = Instance_new("TextButton")

  3172. if selectedOption == v then

  3173. selectedObjects[1] = newOption

  3174. selectedObjects[2] = optionButton

  3175. end

  3176. newOption.Name = "Frame"

  3177. newOption.Parent = realDropdownHolder

  3178. local togged = (not multiselect and selectedOption == v) or (multiselect and table.find(selectedOption, v))

  3179. newOption.BackgroundColor3 = (togged and library.colors.selectedOption) or library.colors.topGradient

  3180. newOption.BorderSizePixel = 0

  3181. newOption.Size = UDim2.fromOffset(202, 18)

  3182. newOption.Image = "rbxassetid://2454009026"

  3183. newOption.ImageColor3 = (togged and library.colors.unselectedOption) or library.colors.bottomGradient

  3184. local stringed = tostring(v)

  3185. optionButton.Name = stringed

  3186. optionButton.Parent = newOption

  3187. optionButton.Active = true

  3188. optionButton.AnchorPoint = Vector2.new(0.5, 0.5)

  3189. optionButton.BackgroundColor3 = Color3.new(1, 1, 1)

  3190. optionButton.BackgroundTransparency = 1

  3191. optionButton.Position = UDim2.fromScale(0.5, 0.5)

  3192. optionButton.Selectable = true

  3193. optionButton.Size = UDim2.new(1, -10, 1)

  3194. optionButton.ZIndex = 5

  3195. optionButton.Font = Enum.Font.Code

  3196. optionButton.Text = (togged and (" " .. stringed)) or stringed

  3197. optionButton.TextColor3 = (togged and library.colors.main) or library.colors.otherElementText

  3198. optionButton.TextSize = 14

  3199. optionButton.TextXAlignment = Enum.TextXAlignment.Left

  3200. library.signals[1 + #library.signals] = optionButton[(multiselect and "MouseButton1Click") or "MouseButton1Down"]:Connect(function()

  3201. if not library.colorpicker then

  3202. dropdownSelection.Text = (passed_multiselect == "string" and multiselect) or blankstring or "Select Item(s)"

  3203. restorezindex[newSection] = restorezindex[newSection] or newSection.ZIndex

  3204. restorezindex[newDropdown] = restorezindex[newDropdown] or newDropdown.ZIndex

  3205. restorezindex[sectionHolder] = restorezindex[sectionHolder] or sectionHolder.ZIndex

  3206. if multiselect then

  3207. local cloned = {unpack(selectedOption)}

  3208. local togged = table.find(selectedOption, v)

  3209. if togged then

  3210. table.remove(selectedOption, togged)

  3211. else

  3212. selectedOption[1 + #selectedOption] = v

  3213. end

  3214. togged = table.find(selectedOption, v)

  3215. optionButton.Text = (togged and (" " .. stringed)) or stringed

  3216. newOption.BackgroundColor3 = (togged and library.colors.selectedOption) or library.colors.topGradient

  3217. newOption.ImageColor3 = (togged and library.colors.unselectedOption) or library.colors.bottomGradient

  3218. optionButton.TextColor3 = (togged and library.colors.main) or library.colors.otherElementText

  3219. if callback then

  3220. task.spawn(callback, selectedOption, cloned)

  3221. end

  3222. if togged then

  3223. if addcallback then

  3224. task.spawn(addcallback, v, selectedOption)

  3225. end

  3226. elseif delcallback then

  3227. task.spawn(delcallback, v, selectedOption)

  3228. end

  3229. if modcallback then

  3230. task.spawn(modcallback, v, togged, selectedOption)

  3231. end

  3232. if #selectedOption == 0 and clrcallback then

  3233. task.spawn(clrcallback, selectedOption, cloned)

  3234. end

  3235. return

  3236. else

  3237. dropdownSelection.Text = stringed

  3238. if selectedOption ~= v then

  3239. local last_v = library_flags[flagName]

  3240. selectedObjects[1].BackgroundColor3 = library.colors.topGradient

  3241. selectedObjects[1].ImageColor3 = library.colors.bottomGradient

  3242. selectedObjects[2].Text = selectedObjects[2].Name

  3243. selectedObjects[2].TextColor3 = library.colors.otherElementText

  3244. selectedOption = v

  3245. selectedObjects[1] = newOption

  3246. selectedObjects[2] = optionButton

  3247. newOption.BackgroundColor3 = library.colors.selectedOption

  3248. newOption.ImageColor3 = library.colors.unselectedOption

  3249. optionButton.TextColor3 = library.colors.main

  3250. dropdownHolderFrame.Visible = false

  3251. dropdownToggle.Rotation = 90

  3252. dropdownEnabled = false

  3253. newDropdown.ZIndex = 1

  3254. colored_dropdown_BackgroundColor3[3] = "topGradient"

  3255. colored_dropdown_BackgroundColor3[4] = nil

  3256. colored_dropdown_ImageColor3[3] = "bottomGradient"

  3257. colored_dropdown_ImageColor3[4] = nil

  3258. tweenService:Create(dropdown, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  3259. BackgroundColor3 = library.colors.topGradient,

  3260. ImageColor3 = library.colors.bottomGradient

  3261. }):Play()

  3262. library_flags[flagName] = selectedOption

  3263. if options.Location then

  3264. options.Location[options.LocationFlag or flagName] = selectedOption

  3265. end

  3266. dropdownSelection.Text = tostring(selectedOption)

  3267. if submenuOpen then

  3268. submenuOpen = nil

  3269. end

  3270. if callback then

  3271. task.spawn(callback, selectedOption, last_v)

  3272. end

  3273. else

  3274. submenuOpen = nil

  3275. dropdownToggle.Rotation = 90

  3276. colored_dropdown_BackgroundColor3[3] = "topGradient"

  3277. colored_dropdown_BackgroundColor3[4] = nil

  3278. colored_dropdown_ImageColor3[3] = "bottomGradient"

  3279. colored_dropdown_ImageColor3[4] = nil

  3280. tweenService:Create(dropdown, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  3281. BackgroundColor3 = library.colors.topGradient,

  3282. ImageColor3 = library.colors.bottomGradient

  3283. }):Play()

  3284. dropdownHolderFrame.Visible = false

  3285. end

  3286. end

  3287. for ins, z in next, restorezindex do

  3288. ins.ZIndex = z

  3289. end

  3290. end

  3291. end)

  3292. library.signals[1 + #library.signals] = optionButton.MouseEnter:Connect(function()

  3293. tweenService:Create(newOption, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  3294. BackgroundColor3 = library.colors.hoveredOptionTop,

  3295. ImageColor3 = library.colors.hoveredOptionBottom

  3296. }):Play()

  3297. end)

  3298. library.signals[1 + #library.signals] = optionButton.MouseLeave:Connect(function()

  3299. local togged = (not multiselect and selectedOption == v) or (multiselect and table.find(selectedOption, v))

  3300. tweenService:Create(newOption, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  3301. BackgroundColor3 = (togged and library.colors.selectedOption) or library.colors.topGradient,

  3302. ImageColor3 = (togged and library.colors.unselectedOption) or library.colors.bottomGradient

  3303. }):Play()

  3304. end)

  3305. UpdateDropdownHolder()

  3306. end

  3307. end

  3308. end

  3309. local precisionscrolling = nil

  3310. local showing = false

  3311. local function display(dropdownEnabled, f)

  3312. if submenuOpen == dropdown or submenuOpen == nil then

  3313. if dropdownEnabled then

  3314. list = resolvelist()

  3315. AddOptions(list, f)

  3316. submenuOpen = dropdown

  3317. dropdownToggle.Rotation = 270

  3318. restorezindex[newSection] = restorezindex[newSection] or newSection.ZIndex

  3319. restorezindex[newDropdown] = restorezindex[newDropdown] or newDropdown.ZIndex

  3320. restorezindex[sectionHolder] = restorezindex[sectionHolder] or sectionHolder.ZIndex

  3321. newSection.ZIndex = 50 + newSection.ZIndex

  3322. newDropdown.ZIndex = 2

  3323. sectionHolder.ZIndex = 2

  3324. colored_dropdown_BackgroundColor3[3] = "main"

  3325. colored_dropdown_BackgroundColor3[4] = 1.5

  3326. colored_dropdown_ImageColor3[3] = "main"

  3327. colored_dropdown_ImageColor3[4] = 2.5

  3328. tweenService:Create(dropdown, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  3329. BackgroundColor3 = darkenColor(library.colors.main, 1.5),

  3330. ImageColor3 = darkenColor(library.colors.main, 2.5)

  3331. }):Play()

  3332. dropdownHolderFrame.Visible = true

  3333. if not options.DisablePrecisionScrolling then

  3334. local scrollrate = tonumber(options.ScrollButtonRate or options.ScrollRate) or 5

  3335. local upkey = options.ScrollUpButton or library.scrollupbutton or shared.scrollupbutton or Enum.KeyCode.Up

  3336. local downkey = options.ScrollDownButton or library.scrolldownbutton or shared.scrolldownbutton or Enum.KeyCode.Down

  3337. precisionscrolling = (precisionscrolling and precisionscrolling:Disconnect() and nil) or userInputService.InputBegan:Connect(function(input)

  3338. if input.UserInputType == Enum.UserInputType.Keyboard then

  3339. local code = input.KeyCode

  3340. local isup = code == upkey

  3341. local isdown = code == downkey

  3342. if isup or isdown then

  3343. local txt = userInputService:GetFocusedTextBox()

  3344. if not txt or txt == dropdownSelection then

  3345. while wait_check() and userInputService:IsKeyDown(code) do

  3346. realDropdownHolder.CanvasPosition = Vector2:new(math.clamp(realDropdownHolder.CanvasPosition.Y + ((isup and -scrollrate) or scrollrate), 0, realDropdownHolder.AbsoluteCanvasSize.Y))

  3347. end

  3348. end

  3349. end

  3350. end

  3351. end)

  3352. library.signals[1 + #library.signals] = precisionscrolling

  3353. end

  3354. else

  3355. submenuOpen = nil

  3356. dropdownToggle.Rotation = 90

  3357. colored_dropdown_BackgroundColor3[3] = "topGradient"

  3358. colored_dropdown_BackgroundColor3[4] = nil

  3359. colored_dropdown_ImageColor3[3] = "bottomGradient"

  3360. colored_dropdown_ImageColor3[4] = nil

  3361. tweenService:Create(dropdown, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  3362. BackgroundColor3 = library.colors.topGradient,

  3363. ImageColor3 = library.colors.bottomGradient

  3364. }):Play()

  3365. dropdownHolderFrame.Visible = false

  3366. for ins, z in next, restorezindex do

  3367. ins.ZIndex = z

  3368. end

  3369. precisionscrolling = (precisionscrolling and precisionscrolling:Disconnect() and nil) or nil

  3370. end

  3371. end

  3372. showing = dropdownEnabled

  3373. end

  3374. local Set = (multiselect and function(t, dat)

  3375. if nil == dat and t ~= nil then

  3376. dat = t

  3377. end

  3378. local lastv = library_flags[flagName]

  3379. if not lastv or selectedOption ~= lastv then

  3380. if lastv and type(lastv) == "table" then

  3381. selectedOption = library_flags[flagName]

  3382. else

  3383. library_flags[flagName] = selectedOption

  3384. end

  3385. warn("Attempting to use new table for", flagName, " Please use :Set(), because setting it through flags table may cause errors", debug.traceback(""))

  3386. lastv = library_flags[flagName]

  3387. end

  3388. local cloned = {unpack(selectedOption)}

  3389. if not dat then

  3390. if #selectedOption ~= 0 then

  3391. table.clear(selectedOption)

  3392. if callback then

  3393. task.spawn(callback, selectedOption, cloned)

  3394. end

  3395. end

  3396. return selectedOption

  3397. elseif type(dat) ~= "table" then

  3398. warn("Expected table for argument #1 on Set for MultiSelect searchbox. Got", dat, debug.traceback(""))

  3399. return selectedOption

  3400. end

  3401. for k = table.pack(unpack(dat)).n, 1, -1 do

  3402. if dat[k] == nil then

  3403. table.remove(dat, k)

  3404. end

  3405. end

  3406. local proceed = #cloned ~= #dat

  3407. table.clear(selectedOption)

  3408. for k, v in next, dat do

  3409. selectedOption[k] = v

  3410. if not proceed and cloned[k] ~= v then

  3411. proceed = 1

  3412. end

  3413. end

  3414. dropdownSelection.Text = (passed_multiselect == "string" and multiselect) or blankstring or "Select Item(s)"

  3415. if proceed and callback then

  3416. task.spawn(callback, selectedOption, cloned)

  3417. end

  3418. return selectedOption

  3419. end) or function(t, str)

  3420. if nil == str and t then

  3421. str = t

  3422. end

  3423. local last_v = library_flags[flagName]

  3424. selectedOption = str

  3425. library_flags[flagName] = str

  3426. if options.Location then

  3427. options.Location[options.LocationFlag or flagName] = str

  3428. end

  3429. local sstr = (selectedOption and tostring(selectedOption)) or blankstring or "No Blank String"

  3430. if dropdownSelection.Text ~= sstr then

  3431. dropdownSelection.Text = sstr

  3432. end

  3433. if callback and (last_v ~= str or options.AllowDuplicateCalls) then

  3434. task.spawn(callback, str, last_v)

  3435. end

  3436. return str

  3437. end

  3438. if val ~= nil then

  3439. Set(val)

  3440. else

  3441. library_flags[flagName] = selectedOption

  3442. if options.Location then

  3443. options.Location[options.LocationFlag or flagName] = selectedOption

  3444. end

  3445. end

  3446. library.signals[1 + #library.signals] = dropdownToggle.MouseButton1Click:Connect(function()

  3447. showing = not showing

  3448. display(showing)

  3449. end)

  3450. library.signals[1 + #library.signals] = dropdownSelection.Focused:Connect(function()

  3451. showing = true

  3452. display(true)

  3453. end)

  3454. library.signals[1 + #library.signals] = dropdownSelection:GetPropertyChangedSignal("Text"):Connect(function()

  3455. if showing then

  3456. display(true, #dropdownSelection.Text > 0)

  3457. end

  3458. end)

  3459. if not multiselect then

  3460. library.signals[1 + #library.signals] = dropdownSelection.FocusLost:Connect(function(b)

  3461. if showing then

  3462. wait()

  3463. end

  3464. showing = false

  3465. display(false)

  3466. if b then

  3467. Set(dropdownSelection.Text)

  3468. end

  3469. end)

  3470. end

  3471. AddOptions(list)

  3472. local default = library_flags[flagName]

  3473. local function update()

  3474. dropdownName, callback = options.Name or dropdownName, options.Callback

  3475. local sstr = (passed_multiselect == "string" and multiselect) or (not multiselect and library_flags[flagName] and tostring(library_flags[flagName])) or (not multiselect and selectedOption and tostring(selectedOption)) or blankstring or "Nothing"

  3476. if dropdownSelection.Text ~= sstr then

  3477. dropdownSelection.Text = sstr

  3478. end

  3479. dropdownHeadline.Text = (dropdownName and tostring(dropdownName)) or "???"

  3480. return sstr

  3481. end

  3482. local function validate(fallbackValue)

  3483. if list and table.find(list, library_flags[flagName]) then

  3484. update()

  3485. return true

  3486. end

  3487. if fallbackValue ~= nil then

  3488. if fallbackValue == "__DEFAULT" then

  3489. fallbackValue = default

  3490. end

  3491. else

  3492. fallbackValue = list[1]

  3493. end

  3494. if multiselect and type(fallbackValue) ~= "table" then

  3495. fallbackValue = {fallbackValue}

  3496. end

  3497. return Set(fallbackValue)

  3498. end

  3499. local objectdata = {

  3500. Options = options,

  3501. Name = flagName,

  3502. Flag = flagName,

  3503. Type = "SearchBox",

  3504. Default = default,

  3505. Parent = sectionFunctions,

  3506. Instance = dropdownSelection,

  3507. Validate = validate,

  3508. Set = Set,

  3509. RawSet = ((multiselect and function(t, dat)

  3510. if nil == dat and t ~= nil then

  3511. dat = t

  3512. end

  3513. local lastv = library_flags[flagName]

  3514. if not lastv or selectedOption ~= lastv then

  3515. if lastv and type(lastv) == "table" then

  3516. selectedOption = library_flags[flagName]

  3517. else

  3518. library_flags[flagName] = selectedOption

  3519. end

  3520. warn("Attempting to use new table for", flagName, " Please use :Set(), as setting through flags table may cause errors", debug.traceback(""))

  3521. lastv = library_flags[flagName]

  3522. end

  3523. local cloned = {unpack(selectedOption)}

  3524. if not dat then

  3525. if #selectedOption ~= 0 then

  3526. table.clear(selectedOption)

  3527. if callback then

  3528. task.spawn(callback, selectedOption, cloned)

  3529. end

  3530. end

  3531. return selectedOption

  3532. elseif type(dat) ~= "table" then

  3533. warn("Expected table for argument #1 on Set for MultiSelect searchbox. Got", dat, debug.traceback(""))

  3534. return selectedOption

  3535. end

  3536. for k = table.pack(unpack(dat)).n, 1, -1 do

  3537. if dat[k] == nil then

  3538. table.remove(dat, k)

  3539. end

  3540. end

  3541. local proceed = #cloned ~= #dat

  3542. table.clear(selectedOption)

  3543. for k, v in next, dat do

  3544. selectedOption[k] = v

  3545. if not proceed and cloned[k] ~= v then

  3546. proceed = 1

  3547. end

  3548. end

  3549. update()

  3550. return selectedOption

  3551. end) or function(t, str)

  3552. if nil == str and t then

  3553. str = t

  3554. end

  3555. selectedOption = str

  3556. library_flags[flagName] = str

  3557. if options.Location then

  3558. options.Location[options.LocationFlag or flagName] = str

  3559. end

  3560. update()

  3561. return str

  3562. end),

  3563. Get = function()

  3564. return library_flags[flagName]

  3565. end,

  3566. Update = update,

  3567. Reset = function()

  3568. return Set(nil, default)

  3569. end

  3570. }

  3571. function objectdata.UpdateList(t, listt, updateValues)

  3572. if (nil == listt and t ~= nil) or (type(t) == "table" and type(listt) ~= "table") then

  3573. listt, updateValues = t, listt

  3574. end

  3575. if listt == objectdata then

  3576. listt = nil

  3577. end

  3578. resolvelist = getresolver(listt or options.List, options.Filter, options.Method)

  3579. list = resolvelist()

  3580. if updateValues then

  3581. validate()

  3582. end

  3583. if showing then

  3584. display(false)

  3585. display(true)

  3586. end

  3587. return list

  3588. end

  3589. tabFunctions.Flags[flagName], sectionFunctions.Flags[flagName], elements[flagName] = objectdata, objectdata, objectdata

  3590. return objectdata

  3591. end

  3592. sectionFunctions.NewSearchBox = sectionFunctions.AddSearchBox

  3593. sectionFunctions.CreateSearchBox = sectionFunctions.AddSearchBox

  3594. sectionFunctions.SearchBox = sectionFunctions.AddSearchBox

  3595. sectionFunctions.CreateSearchbox = sectionFunctions.AddSearchBox

  3596. sectionFunctions.NewSearchbox = sectionFunctions.AddSearchBox

  3597. sectionFunctions.Searchbox = sectionFunctions.AddSearchBox

  3598. sectionFunctions.Sbox = sectionFunctions.AddSearchBox

  3599. sectionFunctions.SBox = sectionFunctions.AddSearchBox

  3600. if isfolder and makefolder and listfiles and readfile and writefile then

  3601. function sectionFunctions:AddPersistence(options, ...)

  3602. options = (options and type(options) == "string" and resolvevararg("Tab", options, ...)) or options

  3603. local dropdownName, custom_workspace, val, persistiveflags, suffix, callback, loadcallback, savecallback, postload, postsave, flagName = assert(options.Name, "Missing Name for new persistence."), options.Workspace or library.WorkspaceName, options.Value, options.Persistive or options.Flags or "all", options.Suffix, options.Callback, options.LoadCallback, options.SaveCallback, options.PostLoadCallback, options.PostSaveCallback, options.Flag or (function()

  3604. library.unnamedpersistence = 1 + (library.unnamedpersistence or 0)

  3605. return "Persistence" .. tostring(library.unnamedpersistence)

  3606. end)()

  3607. if elements[flagName] ~= nil then

  3608. warn(debug.traceback("Warning! Re-used flag '" .. flagName .. "'", 3))

  3609. end

  3610. local designerpersists = options.Desginer

  3611. local newDropdown = Instance_new("Frame")

  3612. local dropdown = Instance_new("ImageLabel")

  3613. local dropdownInner = Instance_new("ImageLabel")

  3614. local dropdownToggle = Instance_new("ImageButton")

  3615. local dropdownSelection = Instance_new("TextBox")

  3616. local dropdownHeadline = Instance_new("TextLabel")

  3617. local dropdownHolderFrame = Instance_new("ImageLabel")

  3618. local dropdownHolderInner = Instance_new("ImageLabel")

  3619. local realDropdownHolder = Instance_new("ScrollingFrame")

  3620. local realDropdownHolderList = Instance_new("UIListLayout")

  3621. local dropdownEnabled = false

  3622. if not isfolder("./Function Lib") then

  3623. makefolder("./Function Lib")

  3624. end

  3625. local common_string = "./Function Lib/" .. tostring(custom_workspace or library.WorkspaceName)

  3626. local function resolvelist(nofold)

  3627. if custom_workspace ~= options.Workspace then

  3628. custom_workspace = options.Workspace

  3629. common_string = "./Function Lib/" .. tostring(custom_workspace or library.WorkspaceName)

  3630. end

  3631. if not isfolder or not makefolder or not listfiles then

  3632. return {}

  3633. end

  3634. if not isfolder(common_string) then

  3635. if nofold then

  3636. return {}

  3637. end

  3638. makefolder(common_string)

  3639. end

  3640. assert(isfolder(common_string), "Couldn't create folder: " .. tostring(library.WorkspaceName or "No workspace name?"))

  3641. local names, files = {}, listfiles(common_string)

  3642. if #files > 0 then

  3643. local len = #common_string + 2

  3644. for _, f in next, files do

  3645. names[1 + #names] = string.sub(f, len, -5)

  3646. end

  3647. table.sort(names)

  3648. end

  3649. return names

  3650. end

  3651. local list = resolvelist(true)

  3652. local blankstring = options.BlankValue or options.NoValueString or options.Nothing

  3653. local selectedObjects = {}

  3654. local optionCount = 0

  3655. if blankstring and val == nil then

  3656. val = blankstring

  3657. end

  3658. local selectedOption = val or blankstring or list[1]

  3659. newDropdown.Name = "newDropdown"

  3660. newDropdown.Parent = sectionHolder

  3661. newDropdown.BackgroundColor3 = Color3.new(1, 1, 1)

  3662. newDropdown.BackgroundTransparency = 1

  3663. newDropdown.Size = UDim2.new(1, 0, 0, 42)

  3664. dropdown.Name = "dropdown"

  3665. dropdown.Parent = newDropdown

  3666. dropdown.Active = true

  3667. dropdown.BackgroundColor3 = library.colors.topGradient

  3668. local colored_dropdown_BackgroundColor3 = {dropdown, "BackgroundColor3", "topGradient"}

  3669. colored[1 + #colored] = colored_dropdown_BackgroundColor3

  3670. dropdown.BorderColor3 = library.colors.elementBorder

  3671. colored[1 + #colored] = {dropdown, "BorderColor3", "elementBorder"}

  3672. dropdown.Position = UDim2.fromScale(0.027, 0.45)

  3673. dropdown.Selectable = true

  3674. dropdown.Size = UDim2.fromOffset(206, 18)

  3675. dropdown.Image = "rbxassetid://2454009026"

  3676. dropdown.ImageColor3 = library.colors.bottomGradient

  3677. local colored_dropdown_ImageColor3 = {dropdown, "ImageColor3", "bottomGradient"}

  3678. colored[1 + #colored] = colored_dropdown_ImageColor3

  3679. dropdownInner.Name = "dropdownInner"

  3680. dropdownInner.Parent = dropdown

  3681. dropdownInner.Active = true

  3682. dropdownInner.AnchorPoint = Vector2.new(0.5, 0.5)

  3683. dropdownInner.BackgroundColor3 = library.colors.topGradient

  3684. colored[1 + #colored] = {dropdownInner, "BackgroundColor3", "topGradient"}

  3685. dropdownInner.BorderColor3 = library.colors.elementBorder

  3686. colored[1 + #colored] = {dropdownInner, "BorderColor3", "elementBorder"}

  3687. dropdownInner.Position = UDim2.fromScale(0.5, 0.5)

  3688. dropdownInner.Selectable = true

  3689. dropdownInner.Size = UDim2.new(1, -4, 1, -4)

  3690. dropdownInner.Image = "rbxassetid://2454009026"

  3691. dropdownInner.ImageColor3 = library.colors.bottomGradient

  3692. colored[1 + #colored] = {dropdownInner, "ImageColor3", "bottomGradient"}

  3693. dropdownToggle.Name = "dropdownToggle"

  3694. dropdownToggle.Parent = dropdown

  3695. dropdownToggle.BackgroundColor3 = Color3.new(1, 1, 1)

  3696. dropdownToggle.BackgroundTransparency = 1

  3697. dropdownToggle.Position = UDim2.fromScale(0.9, 0.17)

  3698. dropdownToggle.Rotation = 90

  3699. dropdownToggle.Size = UDim2.fromOffset(12, 12)

  3700. dropdownToggle.ZIndex = 2

  3701. dropdownToggle.Image = "rbxassetid://71659683"

  3702. dropdownToggle.ImageColor3 = Color3.fromRGB(171, 171, 171)

  3703. dropdownSelection.Name = "dropdownSelection"

  3704. dropdownSelection.Parent = dropdown

  3705. dropdownSelection.BackgroundColor3 = Color3.new(1, 1, 1)

  3706. dropdownSelection.BackgroundTransparency = 1

  3707. dropdownSelection.Position = UDim2.new(0.0295485705)

  3708. dropdownSelection.Size = UDim2.fromScale(0.97, 1)

  3709. dropdownSelection.ZIndex = 5

  3710. dropdownSelection.Font = Enum.Font.Code

  3711. dropdownSelection.LineHeight = 1.15

  3712. dropdownSelection.Text = (selectedOption and tostring(selectedOption)) or "nil"

  3713. dropdownSelection.TextColor3 = library.colors.otherElementText

  3714. colored[1 + #colored] = {dropdownSelection, "TextColor3", "otherElementText"}

  3715. dropdownSelection.TextSize = 14

  3716. dropdownSelection.TextXAlignment = Enum.TextXAlignment.Left

  3717. dropdownHeadline.Name = "dropdownHeadline"

  3718. dropdownHeadline.Parent = newDropdown

  3719. dropdownHeadline.BackgroundColor3 = Color3.new(1, 1, 1)

  3720. dropdownHeadline.BackgroundTransparency = 1

  3721. dropdownHeadline.Position = UDim2.fromScale(0.034, 0.03)

  3722. dropdownHeadline.Size = UDim2.fromOffset(167, 11)

  3723. dropdownHeadline.Font = Enum.Font.Code

  3724. dropdownHeadline.Text = (dropdownName and tostring(dropdownName)) or "???"

  3725. dropdownHeadline.TextColor3 = library.colors.elementText

  3726. colored[1 + #colored] = {dropdownHeadline, "TextColor3", "elementText"}

  3727. dropdownHeadline.TextSize = 14

  3728. dropdownHeadline.TextXAlignment = Enum.TextXAlignment.Left

  3729. dropdownHolderFrame.Name = "dropdownHolderFrame"

  3730. dropdownHolderFrame.Parent = newDropdown

  3731. dropdownHolderFrame.Active = true

  3732. dropdownHolderFrame.BackgroundColor3 = library.colors.topGradient

  3733. colored[1 + #colored] = {dropdownHolderFrame, "BackgroundColor3", "topGradient"}

  3734. dropdownHolderFrame.BorderColor3 = library.colors.elementBorder

  3735. colored[1 + #colored] = {dropdownHolderFrame, "BorderColor3", "elementBorder"}

  3736. dropdownHolderFrame.Position = UDim2.fromScale(0.025, 1.012)

  3737. dropdownHolderFrame.Selectable = true

  3738. dropdownHolderFrame.Size = UDim2.fromOffset(206, 22)

  3739. dropdownHolderFrame.Visible = false

  3740. dropdownHolderFrame.Image = "rbxassetid://2454009026"

  3741. dropdownHolderFrame.ImageColor3 = library.colors.bottomGradient

  3742. colored[1 + #colored] = {dropdownHolderFrame, "ImageColor3", "bottomGradient"}

  3743. dropdownHolderInner.Name = "dropdownHolderInner"

  3744. dropdownHolderInner.Parent = dropdownHolderFrame

  3745. dropdownHolderInner.Active = true

  3746. dropdownHolderInner.AnchorPoint = Vector2.new(0.5, 0.5)

  3747. dropdownHolderInner.BackgroundColor3 = library.colors.topGradient

  3748. colored[1 + #colored] = {dropdownHolderInner, "BackgroundColor3", "topGradient"}

  3749. dropdownHolderInner.BorderColor3 = library.colors.elementBorder

  3750. colored[1 + #colored] = {dropdownHolderInner, "BorderColor3", "elementBorder"}

  3751. dropdownHolderInner.Position = UDim2.fromScale(0.5, 0.5)

  3752. dropdownHolderInner.Selectable = true

  3753. dropdownHolderInner.Size = UDim2.new(1, -4, 1, -4)

  3754. dropdownHolderInner.Image = "rbxassetid://2454009026"

  3755. dropdownHolderInner.ImageColor3 = library.colors.bottomGradient

  3756. colored[1 + #colored] = {dropdownHolderInner, "ImageColor3", "bottomGradient"}

  3757. realDropdownHolder.Name = "realDropdownHolder"

  3758. realDropdownHolder.Parent = dropdownHolderInner

  3759. realDropdownHolder.BackgroundColor3 = Color3.new(1, 1, 1)

  3760. realDropdownHolder.BackgroundTransparency = 1

  3761. realDropdownHolder.Selectable = false

  3762. realDropdownHolder.Size = UDim2.fromScale(1, 1)

  3763. realDropdownHolder.CanvasSize = UDim2.new()

  3764. realDropdownHolder.ScrollBarThickness = 5

  3765. realDropdownHolder.ScrollingDirection = Enum.ScrollingDirection.Y

  3766. realDropdownHolder.AutomaticCanvasSize = Enum.AutomaticSize.Y

  3767. realDropdownHolder.ScrollBarImageTransparency = 0.5

  3768. realDropdownHolder.ScrollBarImageColor3 = library.colors.section

  3769. colored[1 + #colored] = {realDropdownHolder, "ScrollBarImageColor3", "section"}

  3770. realDropdownHolderList.Name = "realDropdownHolderList"

  3771. realDropdownHolderList.Parent = realDropdownHolder

  3772. realDropdownHolderList.HorizontalAlignment = Enum.HorizontalAlignment.Center

  3773. realDropdownHolderList.SortOrder = Enum.SortOrder.LayoutOrder

  3774. sectionFunctions:Update()

  3775. library.signals[1 + #library.signals] = newDropdown.MouseEnter:Connect(function()

  3776. colored_dropdown_BackgroundColor3[3] = "main"

  3777. colored_dropdown_BackgroundColor3[4] = 1.5

  3778. colored_dropdown_ImageColor3[3] = "main"

  3779. colored_dropdown_ImageColor3[4] = 2.5

  3780. tweenService:Create(dropdown, TweenInfo.new(0.25, library.configuration.easingStyle, library.configuration.easingDirection), {

  3781. BackgroundColor3 = darkenColor(library.colors.main, 1.5),

  3782. ImageColor3 = darkenColor(library.colors.main, 2.5)

  3783. }):Play()

  3784. end)

  3785. library.signals[1 + #library.signals] = newDropdown.MouseLeave:Connect(function()

  3786. if not dropdownEnabled then

  3787. colored_dropdown_BackgroundColor3[3] = "topGradient"

  3788. colored_dropdown_BackgroundColor3[4] = nil

  3789. colored_dropdown_ImageColor3[3] = "bottomGradient"

  3790. colored_dropdown_ImageColor3[4] = nil

  3791. tweenService:Create(dropdown, TweenInfo.new(0.25, library.configuration.easingStyle, library.configuration.easingDirection), {

  3792. BackgroundColor3 = library.colors.topGradient,

  3793. ImageColor3 = library.colors.bottomGradient

  3794. }):Play()

  3795. end

  3796. end)

  3797. local restorezindex = {}

  3798. local function UpdateDropdownHolder()

  3799. if optionCount >= 6 then

  3800. realDropdownHolder.CanvasSize = UDim2:fromOffset(realDropdownHolderList.AbsoluteContentSize.Y + 2)

  3801. elseif optionCount <= 5 then

  3802. dropdownHolderFrame.Size = UDim2.fromOffset(206, (realDropdownHolderList.AbsoluteContentSize.Y + 4))

  3803. end

  3804. end

  3805. local function AddOptions(optionsTable, filter)

  3806. if options.Sort then

  3807. local didstuff, dosort = nil, options.Sort

  3808. if type(dosort) == "function" then

  3809. local g, h = pcall(table.sort, optionsTable, dosort)

  3810. if g then

  3811. didstuff = true

  3812. elseif h then

  3813. warn("Error sorting list:", h, debug.traceback(""))

  3814. end

  3815. end

  3816. if not didstuff then

  3817. table.sort(optionsTable, library.defaultSort)

  3818. end

  3819. end

  3820. if blankstring and (optionsTable[1] ~= blankstring or table.find(optionsTable, blankstring, 2)) then

  3821. local exists = table.find(optionsTable, blankstring)

  3822. if exists then

  3823. for _ = 1, 35 do

  3824. table.remove(optionsTable, exists)

  3825. exists = table.find(optionsTable, blankstring)

  3826. if not exists then

  3827. break

  3828. end

  3829. end

  3830. end

  3831. table.insert(optionsTable, 1, blankstring)

  3832. end

  3833. optionCount = 0

  3834. realDropdownHolderList.Parent = nil

  3835. realDropdownHolder:ClearAllChildren()

  3836. realDropdownHolderList.Parent = realDropdownHolder

  3837. for _, v in next, optionsTable do

  3838. if not filter or tostring(v):lower():find(dropdownSelection.Text:lower(), 1, true) then

  3839. optionCount = optionCount + 1

  3840. UpdateDropdownHolder()

  3841. local newOption = Instance_new("ImageLabel")

  3842. local optionButton = Instance_new("TextButton")

  3843. if selectedOption == v or not selectedObjects[1] or not selectedObjects[2] then

  3844. selectedObjects[1] = newOption

  3845. selectedObjects[2] = optionButton

  3846. end

  3847. newOption.Name = "Frame"

  3848. newOption.Parent = realDropdownHolder

  3849. newOption.BackgroundColor3 = (selectedOption == v and library.colors.selectedOption or library.colors.topGradient)

  3850. newOption.BorderSizePixel = 0

  3851. newOption.Size = UDim2.fromOffset(202, 18)

  3852. newOption.Image = "rbxassetid://2454009026"

  3853. newOption.ImageColor3 = (selectedOption == v and library.colors.unselectedOption or library.colors.bottomGradient)

  3854. optionButton.Name = tostring(v)

  3855. optionButton.Parent = newOption

  3856. optionButton.AnchorPoint = Vector2.new(0.5, 0.5)

  3857. optionButton.BackgroundColor3 = Color3.new(1, 1, 1)

  3858. optionButton.BackgroundTransparency = 1

  3859. optionButton.Position = UDim2.fromScale(0.5, 0.5)

  3860. optionButton.Size = UDim2.new(1, -10, 1)

  3861. optionButton.ZIndex = 5

  3862. optionButton.Font = Enum.Font.Code

  3863. optionButton.Text = (selectedOption == v and " " .. tostring(v)) or tostring(v)

  3864. optionButton.TextColor3 = (selectedOption == v and library.colors.main or library.colors.otherElementText)

  3865. optionButton.TextSize = 14

  3866. optionButton.TextXAlignment = Enum.TextXAlignment.Left

  3867. library.signals[1 + #library.signals] = optionButton.MouseButton1Down:Connect(function()

  3868. dropdownSelection.Text = tostring(v)

  3869. restorezindex[newSection] = restorezindex[newSection] or newSection.ZIndex

  3870. restorezindex[newDropdown] = restorezindex[newDropdown] or newDropdown.ZIndex

  3871. restorezindex[sectionHolder] = restorezindex[sectionHolder] or sectionHolder.ZIndex

  3872. if selectedOption ~= v then

  3873. local last_v = library_flags[flagName]

  3874. selectedObjects[1].BackgroundColor3 = library.colors.topGradient

  3875. selectedObjects[1].ImageColor3 = library.colors.bottomGradient

  3876. selectedObjects[2].Text = selectedObjects[2].Name

  3877. selectedObjects[2].TextColor3 = library.colors.otherElementText

  3878. selectedOption = v

  3879. selectedObjects[1] = newOption

  3880. selectedObjects[2] = optionButton

  3881. newOption.BackgroundColor3 = library.colors.selectedOption

  3882. newOption.ImageColor3 = library.colors.unselectedOption

  3883. optionButton.TextColor3 = library.colors.main

  3884. dropdownHolderFrame.Visible = false

  3885. dropdownToggle.Rotation = 90

  3886. dropdownEnabled = false

  3887. colored_dropdown_BackgroundColor3[3] = "topGradient"

  3888. colored_dropdown_BackgroundColor3[4] = nil

  3889. colored_dropdown_ImageColor3[3] = "bottomGradient"

  3890. colored_dropdown_ImageColor3[4] = nil

  3891. tweenService:Create(dropdown, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  3892. BackgroundColor3 = library.colors.topGradient,

  3893. ImageColor3 = library.colors.bottomGradient

  3894. }):Play()

  3895. library_flags[flagName] = selectedOption

  3896. if options.Location then

  3897. options.Location[options.LocationFlag or flagName] = selectedOption

  3898. end

  3899. dropdownSelection.Text = tostring(selectedOption)

  3900. if submenuOpen then

  3901. submenuOpen = nil

  3902. end

  3903. if callback then

  3904. task.spawn(callback, selectedOption, last_v)

  3905. end

  3906. else

  3907. submenuOpen = nil

  3908. dropdownToggle.Rotation = 90

  3909. newDropdown.ZIndex = 1

  3910. sectionHolder.ZIndex = 1

  3911. colored_dropdown_BackgroundColor3[3] = "topGradient"

  3912. colored_dropdown_BackgroundColor3[4] = nil

  3913. colored_dropdown_ImageColor3[3] = "bottomGradient"

  3914. colored_dropdown_ImageColor3[4] = nil

  3915. tweenService:Create(dropdown, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  3916. BackgroundColor3 = library.colors.topGradient,

  3917. ImageColor3 = library.colors.bottomGradient

  3918. }):Play()

  3919. dropdownHolderFrame.Visible = false

  3920. end

  3921. for ins, z in next, restorezindex do

  3922. ins.ZIndex = z

  3923. end

  3924. end)

  3925. library.signals[1 + #library.signals] = optionButton.MouseEnter:Connect(function()

  3926. tweenService:Create(newOption, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  3927. BackgroundColor3 = library.colors.hoveredOptionTop,

  3928. ImageColor3 = library.colors.hoveredOptionBottom

  3929. }):Play()

  3930. end)

  3931. library.signals[1 + #library.signals] = optionButton.MouseLeave:Connect(function()

  3932. tweenService:Create(newOption, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  3933. BackgroundColor3 = library.colors.unhoveredOptionTop,

  3934. ImageColor3 = library.colors.unhoveredOptionBottom

  3935. }):Play()

  3936. end)

  3937. UpdateDropdownHolder()

  3938. end

  3939. end

  3940. end

  3941. local precisionscrolling = nil

  3942. local showing = false

  3943. local function display(dropdownEnabled, f)

  3944. if submenuOpen == dropdown or submenuOpen == nil then

  3945. if dropdownEnabled then

  3946. list = resolvelist(true)

  3947. AddOptions(list, f)

  3948. submenuOpen = dropdown

  3949. restorezindex[newSection] = restorezindex[newSection] or newSection.ZIndex

  3950. restorezindex[newDropdown] = restorezindex[newDropdown] or newDropdown.ZIndex

  3951. restorezindex[sectionHolder] = restorezindex[sectionHolder] or sectionHolder.ZIndex

  3952. newSection.ZIndex = 50 + newSection.ZIndex

  3953. dropdownToggle.Rotation = 270

  3954. newDropdown.ZIndex = 2

  3955. sectionHolder.ZIndex = 2

  3956. colored_dropdown_BackgroundColor3[3] = "main"

  3957. colored_dropdown_BackgroundColor3[4] = 1.5

  3958. colored_dropdown_ImageColor3[3] = "main"

  3959. colored_dropdown_ImageColor3[4] = 2.5

  3960. tweenService:Create(dropdown, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  3961. BackgroundColor3 = darkenColor(library.colors.main, 1.5),

  3962. ImageColor3 = darkenColor(library.colors.main, 2.5)

  3963. }):Play()

  3964. dropdownHolderFrame.Visible = true

  3965. if not options.DisablePrecisionScrolling then

  3966. local upkey = options.ScrollUpButton or library.scrollupbutton or shared.scrollupbutton or Enum.KeyCode.Up

  3967. local downkey = options.ScrollDownButton or library.scrolldownbutton or shared.scrolldownbutton or Enum.KeyCode.Down

  3968. precisionscrolling = (precisionscrolling and precisionscrolling:Disconnect() and nil) or userInputService.InputBegan:Connect(function(input)

  3969. if input.UserInputType == Enum.UserInputType.Keyboard then

  3970. local code = input.KeyCode

  3971. local isup = code == upkey

  3972. local isdown = code == downkey

  3973. if isup or isdown then

  3974. local txt = userInputService:GetFocusedTextBox()

  3975. if not txt then

  3976. while wait_check() and userInputService:IsKeyDown(code) do

  3977. realDropdownHolder.CanvasPosition = Vector2:new(math.clamp(realDropdownHolder.CanvasPosition.Y + ((isup and -5) or 5), 0, realDropdownHolder.AbsoluteCanvasSize.Y))

  3978. end

  3979. end

  3980. end

  3981. end

  3982. end)

  3983. library.signals[1 + #library.signals] = precisionscrolling

  3984. end

  3985. else

  3986. submenuOpen = nil

  3987. dropdownToggle.Rotation = 90

  3988. colored_dropdown_BackgroundColor3[3] = "topGradient"

  3989. colored_dropdown_BackgroundColor3[4] = nil

  3990. colored_dropdown_ImageColor3[3] = "bottomGradient"

  3991. colored_dropdown_ImageColor3[4] = nil

  3992. tweenService:Create(dropdown, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  3993. BackgroundColor3 = library.colors.topGradient,

  3994. ImageColor3 = library.colors.bottomGradient

  3995. }):Play()

  3996. dropdownHolderFrame.Visible = false

  3997. for ins, z in next, restorezindex do

  3998. ins.ZIndex = z

  3999. end

  4000. precisionscrolling = (precisionscrolling and precisionscrolling:Disconnect() and nil) or nil

  4001. end

  4002. showing = dropdownEnabled

  4003. end

  4004. end

  4005. local last_v = nil

  4006. local function Set(t, str)

  4007. if nil == str and t then

  4008. str = t

  4009. end

  4010. selectedOption = str

  4011. last_v = library_flags[flagName]

  4012. library_flags[flagName] = str

  4013. if options.Location then

  4014. options.Location[options.LocationFlag or flagName] = str

  4015. end

  4016. local sstr = (selectedOption and tostring(selectedOption)) or blankstring or "No Blank String"

  4017. if dropdownSelection.Text ~= sstr then

  4018. dropdownSelection.Text = sstr

  4019. end

  4020. if callback and (last_v ~= str or options.AllowDuplicateCalls) then

  4021. task.spawn(callback, str, last_v)

  4022. end

  4023. return str

  4024. end

  4025. if val ~= nil then

  4026. Set(val)

  4027. else

  4028. Set("Filename")

  4029. end

  4030. library.signals[1 + #library.signals] = dropdownSelection.Focused:Connect(function()

  4031. showing = true

  4032. display(true)

  4033. end)

  4034. library.signals[1 + #library.signals] = dropdownSelection:GetPropertyChangedSignal("Text"):Connect(function()

  4035. if showing then

  4036. display(true, #dropdownSelection.Text > 0)

  4037. end

  4038. end)

  4039. library.signals[1 + #library.signals] = dropdownSelection.FocusLost:Connect(function(b)

  4040. if showing then

  4041. wait()

  4042. end

  4043. showing = false

  4044. display(false)

  4045. if b then

  4046. Set(dropdownSelection.Text)

  4047. end

  4048. end)

  4049. AddOptions(list)

  4050. local function savestuff(s, get)

  4051. if not s or type(s) ~= "string" then

  4052. s = nil

  4053. end

  4054. local rawfile = "json__save"

  4055. if not get then

  4056. local filenameddst = string.gsub(s or dropdownSelection.Text or "", "%W", "")

  4057. if #filenameddst == 0 then

  4058. return

  4059. end

  4060. rawfile = string.format("%s/%s.txt", common_string, filenameddst)

  4061. end

  4062. if savecallback then

  4063. local x, e = pcall(savecallback, rawfile, library_flags[flagName])

  4064. if not x and e then

  4065. warn("Error while calling the Pre-Save callback:", e, debug.traceback(""))

  4066. end

  4067. end

  4068. local working_with = {}

  4069. if persistiveflags == 1 or persistiveflags == true or persistiveflags == "*" then

  4070. persistiveflags = "all"

  4071. elseif persistiveflags == 2 then

  4072. persistiveflags = "tab"

  4073. elseif persistiveflags == 3 then

  4074. persistiveflags = "section"

  4075. end

  4076. if persistiveflags == "all" or persistiveflags == "tab" or persistiveflags == "section" then

  4077. for cflag, data in next, (persistiveflags == "all" and elements) or (persistiveflags == "tab" and tabFunctions.Flags) or (persistiveflags == "section" and sectionFunctions.Flags) do

  4078. if data.Type ~= "Persistence" and (designerpersists or string.sub(cflag, 1, 11) ~= "__Designer.") then

  4079. working_with[cflag] = data

  4080. end

  4081. end

  4082. elseif type(persistiveflags) == "table" then

  4083. if #persistiveflags > 0 then

  4084. local inverted = persistiveflags[0] == false or persistiveflags.Inverted

  4085. for k, cflag in next, persistiveflags do

  4086. if k > 0 then

  4087. local data = elements[cflag]

  4088. if data and data.Type ~= "Persistence" and (designerpersists or string.sub(cflag, 1, 11) ~= "__Designer.") then

  4089. working_with[cflag] = (not inverted and data) or nil

  4090. end

  4091. end

  4092. end

  4093. else

  4094. for cflag, persists in next, elements do

  4095. if persists and (designerpersists or string.sub(cflag, 1, 11) ~= "__Designer.") then

  4096. local data = elements[cflag]

  4097. if data then

  4098. working_with[cflag] = data

  4099. end

  4100. end

  4101. end

  4102. end

  4103. end

  4104. local saving = {}

  4105. for cflag in next, working_with do

  4106. local value = library_flags[cflag]

  4107. local good, jval = nil, nil

  4108. if value ~= nil then

  4109. good, jval = JSONEncode(value)

  4110. else

  4111. good, jval = true, "null"

  4112. end

  4113. if not good or (jval == "null" and value ~= nil) then

  4114. local typ = typeof(value)

  4115. if typ == "Color3" then

  4116. value = (library.rainbowflags[cflag] and "rainbow") or Color3ToHex(value)

  4117. end

  4118. value = tostring(value)

  4119. good, jval = JSONEncode(value)

  4120. if not good or (jval == "null" and value ~= nil) then

  4121. warn("Could not save value:", value, debug.traceback(""))

  4122. end

  4123. end

  4124. if good and jval then

  4125. saving[cflag] = value

  4126. end

  4127. end

  4128. local ret = nil

  4129. local good, content = JSONEncode(saving)

  4130. if good and content then

  4131. if not get then

  4132. if not isfolder(common_string) then

  4133. makefolder(common_string)

  4134. end

  4135. writefile(rawfile, content)

  4136. else

  4137. ret = content

  4138. end

  4139. end

  4140. if postsave then

  4141. local x, e = pcall(postsave, rawfile, library_flags[flagName])

  4142. if not x and e then

  4143. warn("Error while calling the Post-Save callback:", e, debug.traceback(""))

  4144. end

  4145. end

  4146. return ret

  4147. end

  4148. local function loadstuff(s, jsonmode, silent)

  4149. if not s or type(s) ~= "string" then

  4150. s = nil

  4151. end

  4152. local filename = "json__load"

  4153. if not jsonmode then

  4154. local filenameddst = convertfilename(s or dropdownSelection.Text, nil, "")

  4155. if #filenameddst == 0 then

  4156. return

  4157. end

  4158. filename = string.format("%s/%s.txt", common_string, filenameddst)

  4159. end

  4160. if loadcallback then

  4161. local x, e = pcall(loadcallback, (jsonmode and s) or filename, library_flags[flagName])

  4162. if not x and e then

  4163. warn("Error while calling the Pre-Load callback:", e, debug.traceback(""))

  4164. end

  4165. end

  4166. if jsonmode or not isfile or isfile(filename) then

  4167. local content = (jsonmode and s) or (not jsonmode and readfile(filename))

  4168. if content and #content > 1 then

  4169. local good, jcontent = JSONDecode(content)

  4170. if good and jcontent then

  4171. for cflag, val in next, jcontent do

  4172. if val and type(val) == "string" and #val > 7 and #val < 64 and string.sub(val, 1, 5) == "Enum." then

  4173. local e = string.find(val, ".", 6, true)

  4174. if e then

  4175. local en = Enum[string.sub(val, 6, e - 1)]

  4176. en = en and en[string.sub(val, e + 1)]

  4177. if en then

  4178. val = en

  4179. else

  4180. warn("Tried & failed to convert '" .. val .. "' to EnumItem")

  4181. end

  4182. end

  4183. end

  4184. local data = elements[cflag]

  4185. if data and data.Type ~= "Persistence" then

  4186. if silent and data.RawSet then

  4187. data:RawSet(val)

  4188. elseif data.Set then

  4189. data:Set(val)

  4190. else

  4191. library_flags[cflag] = val

  4192. end

  4193. end

  4194. end

  4195. end

  4196. end

  4197. end

  4198. if postload then

  4199. local x, e = pcall(postload, filename, library_flags[flagName])

  4200. if not x and e then

  4201. warn("Error while calling the Post-Load callback:", e, debug.traceback(""))

  4202. end

  4203. end

  4204. end

  4205. do

  4206. local buttons, offset = {}, 0

  4207. local fram = nil

  4208. for _, options in next, {{

  4209. Name = "Save" .. ((suffix and (" " .. tostring(suffix))) or ""),

  4210. Callback = savestuff

  4211. }, {

  4212. Name = "Load" .. ((suffix and (" " .. tostring(suffix))) or ""),

  4213. Callback = loadstuff

  4214. }} do

  4215. local buttonName, callback = options.Name, options.Callback

  4216. local realButton = Instance_new("TextButton")

  4217. realButton.Name = "realButton"

  4218. realButton.BackgroundColor3 = Color3.new(1, 1, 1)

  4219. realButton.BackgroundTransparency = 1

  4220. realButton.Size = UDim2.fromScale(1, 1)

  4221. realButton.ZIndex = 5

  4222. realButton.Font = Enum.Font.Code

  4223. realButton.Text = (buttonName and tostring(buttonName)) or "???"

  4224. realButton.TextColor3 = library.colors.elementText

  4225. colored[1 + #colored] = {realButton, "TextColor3", "elementText"}

  4226. realButton.TextSize = 14

  4227. local textsize = textToSize(realButton).X + 14

  4228. if newSection.Parent.AbsoluteSize.X < offset + textsize + 8 then

  4229. offset, fram = 0, nil

  4230. end

  4231. local newButton = fram or Instance_new("Frame")

  4232. fram = newButton

  4233. local button = Instance_new("ImageLabel")

  4234. newButton.Name = removeSpaces((buttonName and buttonName:lower() or "???") .. "Holder")

  4235. newButton.Parent = sectionHolder

  4236. newButton.BackgroundColor3 = Color3.new(1, 1, 1)

  4237. newButton.BackgroundTransparency = 1

  4238. newButton.Size = UDim2.new(1, 0, 0, 24)

  4239. button.Name = "button"

  4240. button.Parent = newButton

  4241. button.Active = true

  4242. button.BackgroundColor3 = library.colors.topGradient

  4243. local colored_button_BackgroundColor3 = {button, "BackgroundColor3", "topGradient"}

  4244. colored[1 + #colored] = colored_button_BackgroundColor3

  4245. button.BorderColor3 = library.colors.elementBorder

  4246. colored[1 + #colored] = {button, "BorderColor3", "elementBorder"}

  4247. button.Position = UDim2.new(0.031, offset, 0.166)

  4248. button.Selectable = true

  4249. button.Size = UDim2.fromOffset(28, 18)

  4250. button.Image = "rbxassetid://2454009026"

  4251. button.ImageColor3 = library.colors.bottomGradient

  4252. local colored_button_ImageColor3 = {button, "ImageColor3", "bottomGradient"}

  4253. colored[1 + #colored] = colored_button_ImageColor3

  4254. local buttonInner = Instance_new("ImageLabel")

  4255. buttonInner.Name = "buttonInner"

  4256. buttonInner.Parent = button

  4257. buttonInner.Active = true

  4258. buttonInner.AnchorPoint = Vector2.new(0.5, 0.5)

  4259. buttonInner.BackgroundColor3 = library.colors.topGradient

  4260. colored[1 + #colored] = {buttonInner, "BackgroundColor3", "topGradient"}

  4261. buttonInner.BorderColor3 = library.colors.elementBorder

  4262. colored[1 + #colored] = {buttonInner, "BorderColor3", "elementBorder"}

  4263. buttonInner.Position = UDim2.fromScale(0.5, 0.5)

  4264. buttonInner.Selectable = true

  4265. buttonInner.Size = UDim2.new(1, -4, 1, -4)

  4266. buttonInner.Image = "rbxassetid://2454009026"

  4267. buttonInner.ImageColor3 = library.colors.bottomGradient

  4268. colored[1 + #colored] = {buttonInner, "ImageColor3", "bottomGradient"}

  4269. button.Size = UDim2.fromOffset(textsize, 18)

  4270. realButton.Parent = button

  4271. offset = offset + textsize + 6

  4272. sectionFunctions:Update()

  4273. local presses = 0

  4274. library.signals[1 + #library.signals] = realButton.MouseButton1Click:Connect(function()

  4275. if not library.colorpicker and not submenuOpen then

  4276. presses = 1 + presses

  4277. task.spawn(callback, presses)

  4278. end

  4279. end)

  4280. library.signals[1 + #library.signals] = button.MouseEnter:Connect(function()

  4281. colored_button_BackgroundColor3[3] = "main"

  4282. colored_button_BackgroundColor3[4] = 1.5

  4283. colored_button_ImageColor3[3] = "main"

  4284. colored_button_ImageColor3[4] = 2.5

  4285. tweenService:Create(button, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  4286. BackgroundColor3 = darkenColor(library.colors.main, 1.5),

  4287. ImageColor3 = darkenColor(library.colors.main, 2.5)

  4288. }):Play()

  4289. end)

  4290. library.signals[1 + #library.signals] = button.MouseLeave:Connect(function()

  4291. colored_button_BackgroundColor3[3] = "topGradient"

  4292. colored_button_BackgroundColor3[4] = nil

  4293. colored_button_ImageColor3[3] = "bottomGradient"

  4294. colored_button_ImageColor3[4] = nil

  4295. tweenService:Create(button, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  4296. BackgroundColor3 = library.colors.topGradient,

  4297. ImageColor3 = library.colors.bottomGradient

  4298. }):Play()

  4299. end)

  4300. end

  4301. end

  4302. local default = library_flags[flagName]

  4303. local function update()

  4304. dropdownName, custom_workspace, persistiveflags, suffix, callback, loadcallback, savecallback, postload, postsave = options.Name or dropdownName, options.Workspace or library.WorkspaceName, options.Persistive or options.Flags or "all", options.Suffix, options.Callback, options.LoadCallback, options.SaveCallback, options.PostLoadCallback, options.PostSaveCallback

  4305. local sstr = tostring(library_flags[flagName])

  4306. if dropdownSelection.Text ~= sstr then

  4307. dropdownSelection.Text = sstr

  4308. end

  4309. dropdownHeadline.Text = (dropdownName and tostring(dropdownName)) or "???"

  4310. return sstr

  4311. end

  4312. local objectdata = {

  4313. Options = options,

  4314. Name = flagName,

  4315. Flag = flagName,

  4316. Type = "Persistence",

  4317. Default = default,

  4318. Parent = sectionFunctions,

  4319. Instance = dropdownSelection,

  4320. Set = Set,

  4321. SaveFile = function(t, str, ret)

  4322. if t ~= nil and type(t) ~= "table" then

  4323. str, ret = t, str

  4324. end

  4325. if type(str) == "string" then

  4326. str = str:match("(.+)%..+$") or str

  4327. end

  4328. return savestuff(str, ret)

  4329. end,

  4330. LoadFile = function(t, str, jsonmode)

  4331. if t ~= nil and type(t) ~= "table" then

  4332. str, jsonmode = t, str

  4333. end

  4334. if isfile and isfile(str) then

  4335. return loadstuff(readfile(str), true)

  4336. elseif not jsonmode and type(str) == "string" then

  4337. str = str:match("(.+)%..+$") or str

  4338. end

  4339. return loadstuff(str, jsonmode)

  4340. end,

  4341. LoadJSON = function(_, json)

  4342. return loadstuff(json, true)

  4343. end,

  4344. LoadFileRaw = function(t, str, jsonmode)

  4345. if t ~= nil and type(t) ~= "table" then

  4346. str, jsonmode = t, str

  4347. end

  4348. if isfile and isfile(str) then

  4349. return loadstuff(readfile(str), true, true)

  4350. elseif not jsonmode and type(str) == "string" then

  4351. str = str:match("(.+)%..+$") or str

  4352. end

  4353. return loadstuff(str, jsonmode, true)

  4354. end,

  4355. LoadJSONRaw = function(_, json)

  4356. return loadstuff(json, true, true)

  4357. end,

  4358. GetJSON = function(t, clipboard)

  4359. if nil == clipboard and t ~= nil then

  4360. clipboard = t

  4361. end

  4362. local json = savestuff(nil, true)

  4363. local clipfunc = (clipboard and type(clipboard) == "function" and clipboard) or setclipboard

  4364. if clipboard and clipfunc then

  4365. clipfunc(json)

  4366. end

  4367. return json

  4368. end,

  4369. RawSet = function(t, str)

  4370. if nil == str and t ~= nil then

  4371. str = t

  4372. end

  4373. selectedOption = str

  4374. last_v = library_flags[flagName]

  4375. library_flags[flagName] = str

  4376. if options.Location then

  4377. options.Location[options.LocationFlag or flagName] = str

  4378. end

  4379. update()

  4380. return str

  4381. end,

  4382. Get = function()

  4383. return library_flags[flagName]

  4384. end,

  4385. Update = update,

  4386. Reset = function()

  4387. return Set(nil, default)

  4388. end

  4389. }

  4390. tabFunctions.Flags[flagName], sectionFunctions.Flags[flagName], elements[flagName] = objectdata, objectdata, objectdata

  4391. return objectdata

  4392. end

  4393. else

  4394. function sectionFunctions.AddPersistence()

  4395. if not library.warnedpersistance then

  4396. library.warnedpersistance = 1

  4397. warn(debug.traceback("Persistance not supported"))

  4398. end

  4399. function sectionFunctions.AddPersistence()

  4400. end

  4401. end

  4402. end

  4403. sectionFunctions.NewPersistence = sectionFunctions.AddPersistence

  4404. sectionFunctions.CreatePersistence = sectionFunctions.AddPersistence

  4405. sectionFunctions.Persistence = sectionFunctions.AddPersistence

  4406. sectionFunctions.CreateSaveLoad = sectionFunctions.AddPersistence

  4407. sectionFunctions.SaveLoad = sectionFunctions.AddPersistence

  4408. sectionFunctions.SL = sectionFunctions.AddPersistence

  4409. function sectionFunctions:AddDropdown(options, ...)

  4410. options = (options and type(options) == "string" and resolvevararg("Dropdown", options, ...)) or options

  4411. local dropdownName, listt, val, callback, flagName = assert(options.Name, "Missing Name for new searchbox."), assert(options.List, "Missing List for new searchbox."), options.Value, options.Callback, options.Flag or (function()

  4412. library.unnameddropdown = 1 + (library.unnameddropdown or 0)

  4413. return "Dropdown" .. tostring(library.unnameddropdown)

  4414. end)()

  4415. if elements[flagName] ~= nil then

  4416. warn(debug.traceback("Warning! Re-used flag '" .. flagName .. "'", 3))

  4417. end

  4418. local newDropdown = Instance_new("Frame")

  4419. local dropdown = Instance_new("ImageLabel")

  4420. local dropdownInner = Instance_new("ImageLabel")

  4421. local dropdownToggle = Instance_new("ImageButton")

  4422. local dropdownSelection = Instance_new("TextLabel")

  4423. local dropdownHeadline = Instance_new("TextLabel")

  4424. local dropdownHolderFrame = Instance_new("ImageLabel")

  4425. local dropdownHolderInner = Instance_new("ImageLabel")

  4426. local realDropdownHolder = Instance_new("ScrollingFrame")

  4427. local realDropdownHolderList = Instance_new("UIListLayout")

  4428. local dropdownEnabled = false

  4429. local multiselect = options.MultiSelect or options.Multi or options.Multiple

  4430. local addcallback = options.ItemAdded or options.AddedCallback

  4431. local delcallback = options.ItemRemoved or options.RemovedCallback

  4432. local clrcallback = options.ItemsCleared or options.ClearedCallback

  4433. local modcallback = options.ItemChanged or options.ChangedCallback

  4434. local blankstring = not multiselect and (options.BlankValue or options.NoValueString or options.Nothing)

  4435. local resolvelist = getresolver(listt, options.Filter, options.Method)

  4436. local list = resolvelist()

  4437. local selectedOption = list[1]

  4438. local passed_multiselect = multiselect and type(multiselect)

  4439. if blankstring and val == nil then

  4440. val = blankstring

  4441. end

  4442. if val ~= nil then

  4443. selectedOption = val

  4444. end

  4445. if multiselect and (not selectedOption or type(selectedOption) ~= "table") then

  4446. selectedOption = {}

  4447. end

  4448. local selectedObjects = {}

  4449. local optionCount = 0

  4450. newDropdown.Name = "newDropdown"

  4451. newDropdown.Parent = sectionHolder

  4452. newDropdown.BackgroundColor3 = Color3.new(1, 1, 1)

  4453. newDropdown.BackgroundTransparency = 1

  4454. newDropdown.Size = UDim2.new(1, 0, 0, 42)

  4455. dropdown.Name = "dropdown"

  4456. dropdown.Parent = newDropdown

  4457. dropdown.Active = true

  4458. dropdown.BackgroundColor3 = library.colors.topGradient

  4459. local colored_dropdown_BackgroundColor3 = {dropdown, "BackgroundColor3", "topGradient"}

  4460. colored[1 + #colored] = colored_dropdown_BackgroundColor3

  4461. dropdown.BorderColor3 = library.colors.elementBorder

  4462. colored[1 + #colored] = {dropdown, "BorderColor3", "elementBorder"}

  4463. dropdown.Position = UDim2.fromScale(0.027, 0.45)

  4464. dropdown.Selectable = true

  4465. dropdown.Size = UDim2.fromOffset(206, 18)

  4466. dropdown.Image = "rbxassetid://2454009026"

  4467. dropdown.ImageColor3 = library.colors.bottomGradient

  4468. local colored_dropdown_ImageColor3 = {dropdown, "ImageColor3", "bottomGradient"}

  4469. colored[1 + #colored] = colored_dropdown_ImageColor3

  4470. dropdownInner.Name = "dropdownInner"

  4471. dropdownInner.Parent = dropdown

  4472. dropdownInner.Active = true

  4473. dropdownInner.AnchorPoint = Vector2.new(0.5, 0.5)

  4474. dropdownInner.BackgroundColor3 = library.colors.topGradient

  4475. colored[1 + #colored] = {dropdownInner, "BackgroundColor3", "topGradient"}

  4476. dropdownInner.BorderColor3 = library.colors.elementBorder

  4477. colored[1 + #colored] = {dropdownInner, "BorderColor3", "elementBorder"}

  4478. dropdownInner.Position = UDim2.fromScale(0.5, 0.5)

  4479. dropdownInner.Selectable = true

  4480. dropdownInner.Size = UDim2.new(1, -4, 1, -4)

  4481. dropdownInner.Image = "rbxassetid://2454009026"

  4482. dropdownInner.ImageColor3 = library.colors.bottomGradient

  4483. colored[1 + #colored] = {dropdownInner, "ImageColor3", "bottomGradient"}

  4484. dropdownToggle.Name = "dropdownToggle"

  4485. dropdownToggle.Parent = dropdown

  4486. dropdownToggle.BackgroundColor3 = Color3.new(1, 1, 1)

  4487. dropdownToggle.BackgroundTransparency = 1

  4488. dropdownToggle.Position = UDim2.fromScale(0.9, 0.17)

  4489. dropdownToggle.Rotation = 90

  4490. dropdownToggle.Size = UDim2.fromOffset(12, 12)

  4491. dropdownToggle.ZIndex = 2

  4492. dropdownToggle.Image = "rbxassetid://71659683"

  4493. dropdownToggle.ImageColor3 = Color3.fromRGB(171, 171, 171)

  4494. dropdownSelection.Name = "dropdownSelection"

  4495. dropdownSelection.Parent = dropdown

  4496. dropdownSelection.Active = true

  4497. dropdownSelection.BackgroundColor3 = Color3.new(1, 1, 1)

  4498. dropdownSelection.BackgroundTransparency = 1

  4499. dropdownSelection.Position = UDim2.new(0.0295)

  4500. dropdownSelection.Selectable = true

  4501. dropdownSelection.Size = UDim2.fromScale(0.97, 1)

  4502. dropdownSelection.ZIndex = 5

  4503. dropdownSelection.Font = Enum.Font.Code

  4504. dropdownSelection.Text = (passed_multiselect == "string" and multiselect) or (multiselect and (blankstring or "Select Item(s)")) or (selectedOption and tostring(selectedOption)) or blankstring or "No Blank String"

  4505. dropdownSelection.TextColor3 = library.colors.otherElementText

  4506. colored[1 + #colored] = {dropdownSelection, "TextColor3", "otherElementText"}

  4507. dropdownSelection.TextSize = 14

  4508. dropdownSelection.TextXAlignment = Enum.TextXAlignment.Left

  4509. dropdownHeadline.Name = "dropdownHeadline"

  4510. dropdownHeadline.Parent = newDropdown

  4511. dropdownHeadline.BackgroundColor3 = Color3.new(1, 1, 1)

  4512. dropdownHeadline.BackgroundTransparency = 1

  4513. dropdownHeadline.Position = UDim2.fromScale(0.034, 0.03)

  4514. dropdownHeadline.Size = UDim2.fromOffset(167, 11)

  4515. dropdownHeadline.Font = Enum.Font.Code

  4516. dropdownHeadline.Text = (dropdownName and tostring(dropdownName)) or "???"

  4517. dropdownHeadline.TextColor3 = library.colors.elementText

  4518. colored[1 + #colored] = {dropdownHeadline, "TextColor3", "elementText"}

  4519. dropdownHeadline.TextSize = 14

  4520. dropdownHeadline.TextXAlignment = Enum.TextXAlignment.Left

  4521. dropdownHolderFrame.Name = "dropdownHolderFrame"

  4522. dropdownHolderFrame.Parent = newDropdown

  4523. dropdownHolderFrame.Active = true

  4524. dropdownHolderFrame.BackgroundColor3 = library.colors.topGradient

  4525. colored[1 + #colored] = {dropdownHolderFrame, "BackgroundColor3", "topGradient"}

  4526. dropdownHolderFrame.BorderColor3 = library.colors.elementBorder

  4527. colored[1 + #colored] = {dropdownHolderFrame, "BorderColor3", "elementBorder"}

  4528. dropdownHolderFrame.Position = UDim2.fromScale(0.025, 1.012)

  4529. dropdownHolderFrame.Selectable = true

  4530. dropdownHolderFrame.Size = UDim2.fromOffset(206, 22)

  4531. dropdownHolderFrame.Visible = false

  4532. dropdownHolderFrame.Image = "rbxassetid://2454009026"

  4533. dropdownHolderFrame.ImageColor3 = library.colors.bottomGradient

  4534. colored[1 + #colored] = {dropdownHolderFrame, "ImageColor3", "bottomGradient"}

  4535. dropdownHolderInner.Name = "dropdownHolderInner"

  4536. dropdownHolderInner.Parent = dropdownHolderFrame

  4537. dropdownHolderInner.Active = true

  4538. dropdownHolderInner.AnchorPoint = Vector2.new(0.5, 0.5)

  4539. dropdownHolderInner.BackgroundColor3 = library.colors.topGradient

  4540. colored[1 + #colored] = {dropdownHolderInner, "BackgroundColor3", "topGradient"}

  4541. dropdownHolderInner.BorderColor3 = library.colors.elementBorder

  4542. colored[1 + #colored] = {dropdownHolderInner, "BorderColor3", "elementBorder"}

  4543. dropdownHolderInner.Position = UDim2.fromScale(0.5, 0.5)

  4544. dropdownHolderInner.Selectable = true

  4545. dropdownHolderInner.Size = UDim2.new(1, -4, 1, -4)

  4546. dropdownHolderInner.Image = "rbxassetid://2454009026"

  4547. dropdownHolderInner.ImageColor3 = library.colors.bottomGradient

  4548. colored[1 + #colored] = {dropdownHolderInner, "ImageColor3", "bottomGradient"}

  4549. realDropdownHolder.Name = "realDropdownHolder"

  4550. realDropdownHolder.Parent = dropdownHolderInner

  4551. realDropdownHolder.BackgroundColor3 = Color3.new(1, 1, 1)

  4552. realDropdownHolder.BackgroundTransparency = 1

  4553. realDropdownHolder.Selectable = false

  4554. realDropdownHolder.Size = UDim2.fromScale(1, 1)

  4555. realDropdownHolder.CanvasSize = UDim2.new()

  4556. realDropdownHolder.ScrollBarThickness = 5

  4557. realDropdownHolder.ScrollingDirection = Enum.ScrollingDirection.Y

  4558. realDropdownHolder.AutomaticCanvasSize = Enum.AutomaticSize.Y

  4559. realDropdownHolder.ScrollBarImageTransparency = 0.5

  4560. realDropdownHolder.ScrollBarImageColor3 = library.colors.section

  4561. colored[1 + #colored] = {realDropdownHolder, "ScrollBarImageColor3", "section"}

  4562. realDropdownHolderList.Name = "realDropdownHolderList"

  4563. realDropdownHolderList.Parent = realDropdownHolder

  4564. realDropdownHolderList.HorizontalAlignment = Enum.HorizontalAlignment.Center

  4565. realDropdownHolderList.SortOrder = Enum.SortOrder.LayoutOrder

  4566. sectionFunctions:Update()

  4567. local showing = false

  4568. local function UpdateDropdownHolder()

  4569. if optionCount >= 6 then

  4570. realDropdownHolder.CanvasSize = UDim2:fromOffset(realDropdownHolderList.AbsoluteContentSize.Y + 2)

  4571. elseif optionCount <= 5 then

  4572. dropdownHolderFrame.Size = UDim2.fromOffset(206, realDropdownHolderList.AbsoluteContentSize.Y + 4)

  4573. end

  4574. end

  4575. local restorezindex = {}

  4576. local Set = (multiselect and function(t, dat)

  4577. if nil == dat and t ~= nil then

  4578. dat = t

  4579. end

  4580. local lastv = library_flags[flagName]

  4581. if not lastv or selectedOption ~= lastv then

  4582. if lastv and type(lastv) == "table" then

  4583. selectedOption = library_flags[flagName]

  4584. else

  4585. library_flags[flagName] = selectedOption

  4586. end

  4587. warn("Attempting to use new table for", flagName, " Please use :Set(), as setting through flags table may cause errors", debug.traceback(""))

  4588. lastv = library_flags[flagName]

  4589. end

  4590. local cloned = {unpack(selectedOption)}

  4591. if not dat then

  4592. if #selectedOption ~= 0 then

  4593. table.clear(selectedOption)

  4594. if callback then

  4595. task.spawn(callback, selectedOption, cloned)

  4596. end

  4597. end

  4598. return selectedOption

  4599. elseif type(dat) ~= "table" then

  4600. warn("Expected table for argument #1 on Set for MultiSelect dropdown. Got", dat, debug.traceback(""))

  4601. return selectedOption

  4602. end

  4603. for k = table.pack(unpack(dat)).n, 1, -1 do

  4604. if dat[k] == nil then

  4605. table.remove(dat, k)

  4606. end

  4607. end

  4608. local proceed = #cloned ~= #dat

  4609. table.clear(selectedOption)

  4610. for k, v in next, dat do

  4611. selectedOption[k] = v

  4612. if not proceed and cloned[k] ~= v then

  4613. proceed = 1

  4614. end

  4615. end

  4616. dropdownSelection.Text = (passed_multiselect == "string" and multiselect) or blankstring or "Select Item(s)"

  4617. if proceed and callback then

  4618. task.spawn(callback, selectedOption, cloned)

  4619. end

  4620. return selectedOption

  4621. end) or function(t, str)

  4622. if nil == str and t ~= nil then

  4623. str = t

  4624. end

  4625. local last_v = library_flags[flagName]

  4626. selectedOption = str

  4627. library_flags[flagName] = str

  4628. if options.Location then

  4629. options.Location[options.LocationFlag or flagName] = str

  4630. end

  4631. local sstr = (selectedOption and tostring(selectedOption)) or blankstring or "No Blank String"

  4632. if dropdownSelection.Text ~= sstr then

  4633. dropdownSelection.Text = sstr

  4634. end

  4635. if callback and (last_v ~= str or options.AllowDuplicateCalls) then

  4636. task.spawn(callback, str, last_v)

  4637. end

  4638. return str

  4639. end

  4640. if val ~= nil then

  4641. Set(val)

  4642. else

  4643. library_flags[flagName] = selectedOption

  4644. if options.Location then

  4645. options.Location[options.LocationFlag or flagName] = selectedOption

  4646. end

  4647. end

  4648. local function AddOptions(optionsTable)

  4649. if options.Sort then

  4650. local didstuff, dosort = nil, options.Sort

  4651. if type(dosort) == "function" then

  4652. local g, h = pcall(table.sort, optionsTable, dosort)

  4653. if g then

  4654. didstuff = true

  4655. elseif h then

  4656. warn("Error sorting list:", h, debug.traceback(""))

  4657. end

  4658. elseif dosort ~= 1 and dosort ~= true then

  4659. warn("Potential mistake for passed Sort argument:", dosort, debug.traceback(""))

  4660. end

  4661. if not didstuff then

  4662. table.sort(optionsTable, library.defaultSort)

  4663. end

  4664. end

  4665. if blankstring and (optionsTable[1] ~= blankstring or table.find(optionsTable, blankstring, 2)) then

  4666. local exists = table.find(optionsTable, blankstring)

  4667. if exists then

  4668. for _ = 1, 35 do

  4669. table.remove(optionsTable, exists)

  4670. exists = table.find(optionsTable, blankstring)

  4671. if not exists then

  4672. break

  4673. end

  4674. end

  4675. end

  4676. table.insert(optionsTable, 1, blankstring)

  4677. end

  4678. optionCount = 0

  4679. realDropdownHolderList.Parent = nil

  4680. realDropdownHolder:ClearAllChildren()

  4681. realDropdownHolderList.Parent = realDropdownHolder

  4682. for _, v in next, optionsTable do

  4683. optionCount = optionCount + 1

  4684. local newOption = Instance_new("ImageLabel")

  4685. local optionButton = Instance_new("TextButton")

  4686. if selectedOption == v then

  4687. selectedObjects[1] = newOption

  4688. selectedObjects[2] = optionButton

  4689. end

  4690. newOption.Name = "Frame"

  4691. newOption.Parent = realDropdownHolder

  4692. local togged = (not multiselect and selectedOption == v) or (multiselect and table.find(selectedOption, v))

  4693. newOption.BackgroundColor3 = (togged and library.colors.selectedOption) or library.colors.topGradient

  4694. newOption.BorderSizePixel = 0

  4695. newOption.Size = UDim2.fromOffset(202, 18)

  4696. newOption.Image = "rbxassetid://2454009026"

  4697. newOption.ImageColor3 = (togged and library.colors.unselectedOption) or library.colors.bottomGradient

  4698. local stringed = tostring(v)

  4699. optionButton.Name = stringed

  4700. optionButton.Parent = newOption

  4701. optionButton.AnchorPoint = Vector2.new(0.5, 0.5)

  4702. optionButton.BackgroundColor3 = Color3.new(1, 1, 1)

  4703. optionButton.BackgroundTransparency = 1

  4704. optionButton.Position = UDim2.fromScale(0.5, 0.5)

  4705. optionButton.Size = UDim2.new(1, -10, 1)

  4706. optionButton.ZIndex = 5

  4707. optionButton.Font = Enum.Font.Code

  4708. optionButton.Text = (togged and (" " .. stringed)) or stringed

  4709. optionButton.TextColor3 = (togged and library.colors.main) or library.colors.otherElementText

  4710. optionButton.TextSize = 14

  4711. optionButton.TextXAlignment = Enum.TextXAlignment.Left

  4712. library.signals[1 + #library.signals] = optionButton.MouseButton1Click:Connect(function()

  4713. if not library.colorpicker then

  4714. restorezindex[newSection] = restorezindex[newSection] or newSection.ZIndex

  4715. restorezindex[newDropdown] = restorezindex[newDropdown] or newDropdown.ZIndex

  4716. restorezindex[sectionHolder] = restorezindex[sectionHolder] or sectionHolder.ZIndex

  4717. if multiselect then

  4718. local cloned = {unpack(selectedOption)}

  4719. local togged = table.find(selectedOption, v)

  4720. if togged then

  4721. table.remove(selectedOption, togged)

  4722. else

  4723. selectedOption[1 + #selectedOption] = v

  4724. end

  4725. togged = table.find(selectedOption, v)

  4726. optionButton.Text = (togged and (" " .. stringed)) or stringed

  4727. newOption.BackgroundColor3 = (togged and library.colors.selectedOption) or library.colors.topGradient

  4728. newOption.ImageColor3 = (togged and library.colors.unselectedOption) or library.colors.bottomGradient

  4729. optionButton.TextColor3 = (togged and library.colors.main) or library.colors.otherElementText

  4730. dropdownSelection.Text = (passed_multiselect == "string" and multiselect) or blankstring or "Select Item(s)"

  4731. if callback then

  4732. task.spawn(callback, selectedOption, cloned)

  4733. end

  4734. if togged then

  4735. if addcallback then

  4736. task.spawn(addcallback, v, selectedOption)

  4737. end

  4738. elseif delcallback then

  4739. task.spawn(delcallback, v, selectedOption)

  4740. end

  4741. if modcallback then

  4742. task.spawn(modcallback, v, togged, selectedOption)

  4743. end

  4744. if #selectedOption == 0 and clrcallback then

  4745. task.spawn(clrcallback, selectedOption, cloned)

  4746. end

  4747. return

  4748. else

  4749. if selectedOption ~= v then

  4750. local last_v = library_flags[flagName]

  4751. selectedObjects[1].BackgroundColor3 = library.colors.topGradient

  4752. selectedObjects[1].ImageColor3 = library.colors.bottomGradient

  4753. selectedObjects[2].Text = selectedObjects[2].Name

  4754. selectedObjects[2].TextColor3 = library.colors.otherElementText

  4755. selectedOption = v

  4756. dropdownSelection.Text = stringed

  4757. selectedObjects[1] = newOption

  4758. selectedObjects[2] = optionButton

  4759. newOption.BackgroundColor3 = library.colors.selectedOption

  4760. newOption.ImageColor3 = library.colors.unselectedOption

  4761. optionButton.Text = " " .. stringed

  4762. optionButton.TextColor3 = library.colors.main

  4763. dropdownHolderFrame.Visible = false

  4764. dropdownToggle.Rotation = 90

  4765. dropdownEnabled = false

  4766. newDropdown.ZIndex = 1

  4767. colored_dropdown_BackgroundColor3[3] = "topGradient"

  4768. colored_dropdown_BackgroundColor3[4] = nil

  4769. colored_dropdown_ImageColor3[3] = "bottomGradient"

  4770. colored_dropdown_ImageColor3[4] = nil

  4771. tweenService:Create(dropdown, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  4772. BackgroundColor3 = library.colors.topGradient,

  4773. ImageColor3 = library.colors.bottomGradient

  4774. }):Play()

  4775. library_flags[flagName] = selectedOption

  4776. if options.Location then

  4777. options.Location[options.LocationFlag or flagName] = selectedOption

  4778. end

  4779. submenuOpen = nil

  4780. showing = false

  4781. if callback then

  4782. task.spawn(callback, selectedOption, last_v)

  4783. end

  4784. else

  4785. showing = false

  4786. submenuOpen = nil

  4787. dropdownToggle.Rotation = 90

  4788. newDropdown.ZIndex = 1

  4789. sectionHolder.ZIndex = 1

  4790. colored_dropdown_BackgroundColor3[3] = "topGradient"

  4791. colored_dropdown_BackgroundColor3[4] = nil

  4792. colored_dropdown_ImageColor3[3] = "bottomGradient"

  4793. colored_dropdown_ImageColor3[4] = nil

  4794. tweenService:Create(dropdown, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  4795. BackgroundColor3 = library.colors.topGradient,

  4796. ImageColor3 = library.colors.bottomGradient

  4797. }):Play()

  4798. dropdownHolderFrame.Visible = false

  4799. end

  4800. end

  4801. for ins, z in next, restorezindex do

  4802. ins.ZIndex = z

  4803. end

  4804. end

  4805. end)

  4806. library.signals[1 + #library.signals] = optionButton.MouseEnter:Connect(function()

  4807. tweenService:Create(newOption, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  4808. BackgroundColor3 = library.colors.hoveredOptionTop,

  4809. ImageColor3 = library.colors.hoveredOptionBottom

  4810. }):Play()

  4811. end)

  4812. library.signals[1 + #library.signals] = optionButton.MouseLeave:Connect(function()

  4813. local togged = (not multiselect and selectedOption == v) or (multiselect and table.find(selectedOption, v))

  4814. tweenService:Create(newOption, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  4815. BackgroundColor3 = (togged and library.colors.selectedOption) or library.colors.topGradient,

  4816. ImageColor3 = (togged and library.colors.unselectedOption) or library.colors.bottomGradient

  4817. }):Play()

  4818. end)

  4819. UpdateDropdownHolder()

  4820. end

  4821. end

  4822. local precisionscrolling = nil

  4823. local function display(dropdownEnabled)

  4824. list = resolvelist()

  4825. if dropdownEnabled then

  4826. AddOptions(list)

  4827. submenuOpen = dropdown

  4828. dropdownToggle.Rotation = 270

  4829. restorezindex[newSection] = restorezindex[newSection] or newSection.ZIndex

  4830. restorezindex[newDropdown] = restorezindex[newDropdown] or newDropdown.ZIndex

  4831. restorezindex[sectionHolder] = restorezindex[sectionHolder] or sectionHolder.ZIndex

  4832. newSection.ZIndex = 50 + newSection.ZIndex

  4833. newDropdown.ZIndex = 2

  4834. sectionHolder.ZIndex = 2

  4835. colored_dropdown_BackgroundColor3[3] = "main"

  4836. colored_dropdown_BackgroundColor3[4] = 1.5

  4837. colored_dropdown_ImageColor3[3] = "main"

  4838. colored_dropdown_ImageColor3[4] = 2.5

  4839. tweenService:Create(dropdown, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  4840. BackgroundColor3 = darkenColor(library.colors.main, 1.5),

  4841. ImageColor3 = darkenColor(library.colors.main, 2.5)

  4842. }):Play()

  4843. dropdownHolderFrame.Visible = true

  4844. if not options.DisablePrecisionScrolling then

  4845. local upkey = options.ScrollUpButton or library.scrollupbutton or shared.scrollupbutton or Enum.KeyCode.Up

  4846. local downkey = options.ScrollDownButton or library.scrolldownbutton or shared.scrolldownbutton or Enum.KeyCode.Down

  4847. precisionscrolling = (precisionscrolling and precisionscrolling:Disconnect() and nil) or userInputService.InputBegan:Connect(function(input)

  4848. if input.UserInputType == Enum.UserInputType.Keyboard then

  4849. local code = input.KeyCode

  4850. local isup = code == upkey

  4851. local isdown = code == downkey

  4852. if isup or isdown then

  4853. local txt = userInputService:GetFocusedTextBox()

  4854. if not txt or txt == dropdownSelection then

  4855. while wait_check() and userInputService:IsKeyDown(code) do

  4856. realDropdownHolder.CanvasPosition = Vector2:new(math.clamp(realDropdownHolder.CanvasPosition.Y + ((isup and -5) or 5), 0, realDropdownHolder.AbsoluteCanvasSize.Y))

  4857. end

  4858. end

  4859. end

  4860. end

  4861. end)

  4862. library.signals[1 + #library.signals] = precisionscrolling

  4863. end

  4864. else

  4865. submenuOpen = nil

  4866. dropdownToggle.Rotation = 90

  4867. colored_dropdown_BackgroundColor3[3] = "topGradient"

  4868. colored_dropdown_BackgroundColor3[4] = nil

  4869. colored_dropdown_ImageColor3[3] = "bottomGradient"

  4870. colored_dropdown_ImageColor3[4] = nil

  4871. tweenService:Create(dropdown, TweenInfo.new(0.35, library.configuration.easingStyle, library.configuration.easingDirection), {

  4872. BackgroundColor3 = library.colors.topGradient,

  4873. ImageColor3 = library.colors.bottomGradient

  4874. }):Play()

  4875. dropdownHolderFrame.Visible = false

  4876. for ins, z in next, restorezindex do

  4877. ins.ZIndex = z

  4878. end

  4879. precisionscrolling = (precisionscrolling and precisionscrolling:Disconnect() and nil) or nil

  4880. end

  4881. if not multiselect and (not next(list) or not table.find(list, library_flags[flagName])) then

  4882. Set(list[1])

  4883. end

  4884. showing = dropdownEnabled

  4885. end

  4886. library.signals[1 + #library.signals] = newDropdown.InputEnded:Connect(function(input)

  4887. if not library.colorpicker and input.UserInputType == Enum.UserInputType.MouseButton1 then

  4888. showing = not showing

  4889. display(showing)

  4890. end

  4891. end)

  4892. library.signals[1 + #library.signals] = newDropdown.MouseEnter:Connect(function()

  4893. colored_dropdown_BackgroundColor3[3] = "main"

  4894. colored_dropdown_BackgroundColor3[4] = 1.5

  4895. colored_dropdown_ImageColor3[3] = "main"

  4896. colored_dropdown_ImageColor3[4] = 2.5

  4897. tweenService:Create(dropdown, TweenInfo.new(0.25, library.configuration.easingStyle, library.configuration.easingDirection), {

  4898. BackgroundColor3 = darkenColor(library.colors.main, 1.5),

  4899. ImageColor3 = darkenColor(library.colors.main, 2.5)

  4900. }):Play()

  4901. end)

  4902. library.signals[1 + #library.signals] = newDropdown.MouseLeave:Connect(function()

  4903. if not dropdownEnabled then

  4904. colored_dropdown_BackgroundColor3[3] = "topGradient"

  4905. colored_dropdown_BackgroundColor3[4] = nil

  4906. colored_dropdown_ImageColor3[3] = "bottomGradient"

  4907. colored_dropdown_ImageColor3[4] = nil

  4908. tweenService:Create(dropdown, TweenInfo.new(0.25, library.configuration.easingStyle, library.configuration.easingDirection), {

  4909. BackgroundColor3 = library.colors.topGradient,

  4910. ImageColor3 = library.colors.bottomGradient

  4911. }):Play()

  4912. end

  4913. end)

  4914. library.signals[1 + #library.signals] = dropdownToggle.MouseButton1Click:Connect(function()

  4915. if not library.colorpicker then

  4916. showing = not showing

  4917. display(showing)

  4918. end

  4919. end)

  4920. AddOptions(list)

  4921. local default = library_flags[flagName]

  4922. local function update()

  4923. dropdownName, callback = options.Name or dropdownName, options.Callback

  4924. local sstr = (passed_multiselect == "string" and multiselect) or (library_flags[flagName] and tostring(library_flags[flagName])) or (selectedOption and tostring(selectedOption)) or blankstring or "nil"

  4925. if dropdownSelection.Text ~= sstr then

  4926. dropdownSelection.Text = sstr

  4927. end

  4928. dropdownHeadline.Text = (dropdownName and tostring(dropdownName)) or "???"

  4929. return sstr

  4930. end

  4931. local function validate(fallbackValue)

  4932. if list and table.find(list, library_flags[flagName]) then

  4933. update()

  4934. return true

  4935. end

  4936. if fallbackValue ~= nil then

  4937. if fallbackValue == "__DEFAULT" then

  4938. fallbackValue = fallbackValue

  4939. end

  4940. else

  4941. fallbackValue = list[1]

  4942. end

  4943. return Set((multiselect and {fallbackValue}) or fallbackValue)

  4944. end

  4945. local objectdata = {

  4946. Options = options,

  4947. Name = flagName,

  4948. Flag = flagName,

  4949. Type = "Dropdown",

  4950. Default = default,

  4951. Parent = sectionFunctions,

  4952. Instance = dropdownSelection,

  4953. Get = function()

  4954. return library_flags[flagName]

  4955. end,

  4956. Set = Set,

  4957. RawSet = ((multiselect and function(t, dat)

  4958. if nil == dat and t ~= nil then

  4959. dat = t

  4960. end

  4961. local lastv = library_flags[flagName]

  4962. if not lastv or selectedOption ~= lastv then

  4963. if lastv and type(lastv) == "table" then

  4964. selectedOption = library_flags[flagName]

  4965. else

  4966. library_flags[flagName] = selectedOption

  4967. end

  4968. warn("Attempting to use new table for", flagName, " Please use :Set(), as setting through flags table may cause errors", debug.traceback(""))

  4969. lastv = library_flags[flagName]

  4970. end

  4971. local cloned = {unpack(selectedOption)}

  4972. if not dat then

  4973. if #selectedOption ~= 0 then

  4974. table.clear(selectedOption)

  4975. end

  4976. return selectedOption

  4977. elseif type(dat) ~= "table" then

  4978. warn("Expected table for argument #1 on Set for MultiSelect dropdown. Got", dat, debug.traceback(""))

  4979. return selectedOption

  4980. end

  4981. for k = table.pack(unpack(dat)).n, 1, -1 do

  4982. if dat[k] == nil then

  4983. table.remove(dat, k)

  4984. end

  4985. end

  4986. table.clear(selectedOption)

  4987. for k, v in next, dat do

  4988. selectedOption[k] = v

  4989. end

  4990. return selectedOption

  4991. end) or function(t, str)

  4992. if nil == str and t ~= nil then

  4993. str = t

  4994. end

  4995. selectedOption = str

  4996. library_flags[flagName] = str

  4997. if options.Location then

  4998. options.Location[options.LocationFlag or flagName] = str

  4999. end

  5000. update()

  5001. return str

  5002. end),

  5003. Update = update,

  5004. Reset = function()

  5005. return Set(nil, default)

  5006. end

  5007. }

  5008. function objectdata.UpdateList(t, listt, updateValues)

  5009. if (nil == listt and t ~= nil) or (type(t) == "table" and type(listt) ~= "table") then

  5010. listt, updateValues = t, listt

  5011. end

  5012. if listt == objectdata then

  5013. listt = nil

  5014. end

  5015. resolvelist = getresolver(listt or options.List, options.Filter, options.Method)

  5016. list = resolvelist()

  5017. if updateValues then

  5018. validate()

  5019. end

  5020. if showing then

  5021. display(false)

  5022. display(true)

  5023. end

  5024. return list

  5025. end

  5026. tabFunctions.Flags[flagName], sectionFunctions.Flags[flagName], elements[flagName] = objectdata, objectdata, objectdata

  5027. return objectdata

  5028. end

  5029. sectionFunctions.AddDropDown = sectionFunctions.AddDropdown

  5030. sectionFunctions.NewDropDown = sectionFunctions.AddDropdown

  5031. sectionFunctions.NewDropdown = sectionFunctions.AddDropdown

  5032. sectionFunctions.CreateDropdown = sectionFunctions.AddDropdown

  5033. sectionFunctions.CreateDropdown = sectionFunctions.AddDropdown

  5034. sectionFunctions.DropDown = sectionFunctions.AddDropdown

  5035. sectionFunctions.Dropdown = sectionFunctions.AddDropdown

  5036. sectionFunctions.DD = sectionFunctions.AddDropdown

  5037. sectionFunctions.Dd = sectionFunctions.AddDropdown

  5038. function sectionFunctions:AddColorpicker(options, ...)

  5039. options = (options and type(options) == "string" and resolvevararg("Colorpicker", options, ...)) or options

  5040. if options.Random == true then

  5041. options.Value = "random"

  5042. elseif options.Rainbow == true then

  5043. options.Value = "rainbow"

  5044. end

  5045. local colorPickerName, presetColor, callback, flagName = assert(options.Name, "Missing Name for new colorpicker."), options.Value, options.Callback, options.Flag or (function()

  5046. library.unnamedcolorpicker = 1 + (library.unnamedcolorpicker or 0)

  5047. return "Colorpicker" .. tostring(library.unnamedcolorpicker)

  5048. end)()

  5049. if elements[flagName] ~= nil then

  5050. warn(debug.traceback("Warning! Re-used flag '" .. flagName .. "'", 3))

  5051. end

  5052. local designers = options.__designer

  5053. options.__designer = nil

  5054. local rainbowColorMode = false

  5055. if presetColor == "random" then

  5056. presetColor = Color3.new(math.random(), math.random(), math.random())

  5057. elseif presetColor == "rainbow" then

  5058. presetColor = Color3.new(1, 1, 1)

  5059. rainbowColorMode = true

  5060. end

  5061. local newColorPicker = Instance_new("Frame")

  5062. local colorPicker = Instance_new("ImageLabel")

  5063. local colorPickerInner = Instance_new("ImageLabel")

  5064. local colorPickerHeadline = Instance_new("TextLabel")

  5065. local colorPickerButton = Instance_new("TextButton")

  5066. local colorPickerHolderFrame = Instance_new("ImageLabel")

  5067. local colorPickerHolderInner = Instance_new("ImageLabel")

  5068. local color = Instance_new("ImageLabel")

  5069. local selectorColor = Instance_new("Frame")

  5070. local hue = Instance_new("ImageLabel")

  5071. local hueGradient = Instance_new("UIGradient")

  5072. local selectorHue = Instance_new("Frame")

  5073. local randomColor = Instance_new("ImageLabel")

  5074. local randomColorInner = Instance_new("ImageLabel")

  5075. local randomColorButton = Instance_new("ImageButton")

  5076. local hexInputBox = Instance_new("TextBox")

  5077. local hexInput = Instance_new("ImageLabel")

  5078. local hexInputInner = Instance_new("ImageLabel")

  5079. local rainbow = Instance_new("ImageLabel")

  5080. local rainbowInner = Instance_new("ImageLabel")

  5081. local rainbowButton = Instance_new("ImageButton")

  5082. local startingColor = presetColor or Color3.new(1, 1, 1)

  5083. local colorPickerEnabled = false

  5084. local colorH, colorS, colorV = 1, 1, 1

  5085. local colorInput, hueInput = nil, nil

  5086. local oldBackgroundColor = Color3.new()

  5087. local oldImageColor = oldBackgroundColor

  5088. local oldColor = oldBackgroundColor

  5089. local rainbowColorValue = 0

  5090. newColorPicker.Name = "newColorPicker"

  5091. newColorPicker.Parent = sectionHolder

  5092. newColorPicker.BackgroundColor3 = Color3.new(1, 1, 1)

  5093. newColorPicker.BackgroundTransparency = 1

  5094. newColorPicker.Size = UDim2.new(1, 0, 0, 19)

  5095. colorPicker.Name = "colorPicker"

  5096. colorPicker.Parent = newColorPicker

  5097. colorPicker.Active = true

  5098. colorPicker.BackgroundColor3 = library.colors.topGradient

  5099. local colored_colorPicker_BackgroundColor3 = {colorPicker, "BackgroundColor3", "topGradient"}

  5100. colored[1 + #colored] = colored_colorPicker_BackgroundColor3

  5101. colorPicker.BorderColor3 = library.colors.elementBorder

  5102. colored[1 + #colored] = {colorPicker, "BorderColor3", "elementBorder"}

  5103. colorPicker.Position = UDim2.fromScale(0.842, 0.113)

  5104. colorPicker.Selectable = true

  5105. colorPicker.Size = UDim2.fromOffset(24, 12)

  5106. colorPicker.Image = "rbxassetid://2454009026"

  5107. colorPicker.ImageColor3 = library.colors.bottomGradient

  5108. local colored_colorPicker_ImageColor3 = {colorPicker, "ImageColor3", "bottomGradient"}

  5109. colored[1 + #colored] = colored_colorPicker_ImageColor3

  5110. colorPickerInner.Name = "colorPickerInner"

  5111. colorPickerInner.Parent = colorPicker

  5112. colorPickerInner.Active = true

  5113. colorPickerInner.AnchorPoint = Vector2.new(0.5, 0.5)

  5114. colorPickerInner.BorderColor3 = library.colors.elementBorder

  5115. colored[1 + #colored] = {colorPickerInner, "BorderColor3", "elementBorder"}

  5116. colorPickerInner.Position = UDim2.fromScale(0.5, 0.5)

  5117. colorPickerInner.Selectable = true

  5118. colorPickerInner.Size = UDim2.new(1, -4, 1, -4)

  5119. colorPickerInner.Image = "rbxassetid://2454009026"

  5120. colorPickerInner.BackgroundColor3 = darkenColor(startingColor, 1.5)

  5121. colorPickerInner.ImageColor3 = darkenColor(startingColor, 2.5)

  5122. colorPickerHeadline.Name = "colorPickerHeadline"

  5123. colorPickerHeadline.Parent = newColorPicker

  5124. colorPickerHeadline.BackgroundColor3 = Color3.new(1, 1, 1)

  5125. colorPickerHeadline.BackgroundTransparency = 1

  5126. colorPickerHeadline.Position = UDim2.fromScale(0.034, 0.113)

  5127. colorPickerHeadline.Size = UDim2.fromOffset(173, 11)

  5128. colorPickerHeadline.Font = Enum.Font.Code

  5129. colorPickerHeadline.Text = colorPickerName or "???"

  5130. colorPickerHeadline.TextColor3 = library.colors.elementText

  5131. colored[1 + #colored] = {colorPickerHeadline, "TextColor3", "elementText"}

  5132. colorPickerHeadline.TextSize = 14

  5133. colorPickerHeadline.TextXAlignment = Enum.TextXAlignment.Left

  5134. colorPickerButton.Name = "colorPickerButton"

  5135. colorPickerButton.Parent = newColorPicker

  5136. colorPickerButton.BackgroundColor3 = Color3.new(1, 1, 1)

  5137. colorPickerButton.BackgroundTransparency = 1

  5138. colorPickerButton.Size = UDim2.fromScale(1, 1)

  5139. colorPickerButton.ZIndex = 5

  5140. colorPickerButton.Font = Enum.Font.SourceSans

  5141. colorPickerButton.Text = ""

  5142. colorPickerButton.TextColor3 = Color3.new()

  5143. colorPickerButton.TextSize = 14

  5144. colorPickerButton.TextTransparency = 1

  5145. colorPickerButton.BorderColor3 = library.colors.elementBorder

  5146. local colored_colorPickerButton_BorderColor3 = {colorPickerButton, "BorderColor3", "elementBorder"}

  5147. colored[1 + #colored] = colored_colorPickerButton_BorderColor3

  5148. local function UpdateColorPicker(force, rainbsow)

  5149. local last_vv = library_flags[flagName]

  5150. local newColor = force or Color3.fromHSV(colorH, colorS, colorV)

  5151. if not force then

  5152. colorH, colorS, colorV = newColor:ToHSV()

  5153. end

  5154. colorPickerInner.BackgroundColor3 = darkenColor(newColor, 1.5)

  5155. colorPickerInner.ImageColor3 = darkenColor(newColor, 2.5)

  5156. color.BackgroundColor3 = Color3.fromHSV(colorH, 1, 1)

  5157. library_flags[flagName] = newColor

  5158. if options.Location then

  5159. options.Location[options.LocationFlag or flagName] = newColor

  5160. end

  5161. hexInputBox.Text = Color3ToHex(newColor)

  5162. if force then

  5163. color.BackgroundColor3 = force

  5164. selectorColor.Position = UDim2.new(force and select(3, Color3.toHSV(force)))

  5165. end

  5166. local pos = 1 - (Color3.toHSV(newColor))

  5167. local scalex = selectorHue.Position.X.Scale

  5168. if scalex ~= pos and not ((pos == 0 or pos == 1) and (scalex == 1 or scalex == 0)) then

  5169. selectorHue.Position = UDim2.new(pos)

  5170. end

  5171. if callback and last_vv ~= newColor then

  5172. task.spawn(callback, newColor, last_vv, rainbsow)

  5173. end

  5174. end

  5175. library.signals[1 + #library.signals] = colorPickerButton.MouseButton1Click:Connect(function()

  5176. if submenuOpen == colorPicker or submenuOpen == nil then

  5177. colorPickerEnabled = not colorPickerEnabled

  5178. library.colorpicker = colorPickerEnabled

  5179. colorPickerHolderFrame.Visible = colorPickerEnabled

  5180. if colorPickerEnabled then

  5181. for _, v in next, colorpickerconflicts do

  5182. v.Visible = false

  5183. end

  5184. submenuOpen = colorPicker

  5185. newColorPicker.ZIndex = 2

  5186. newSection.ZIndex = 100 + newSection.ZIndex

  5187. colorPickerButton.BorderColor3 = library.colors.main

  5188. colored_colorPickerButton_BorderColor3[3] = "main"

  5189. UpdateColorPicker()

  5190. else

  5191. for _, v in next, colorpickerconflicts do

  5192. v.Visible = true

  5193. end

  5194. submenuOpen = nil

  5195. newColorPicker.ZIndex = 0

  5196. newSection.ZIndex = newSection.ZIndex - 100

  5197. colorPickerButton.BorderColor3 = library.colors.elementBorder

  5198. colored_colorPickerButton_BorderColor3[3] = "elementBorder"

  5199. end

  5200. end

  5201. end)

  5202. colorPickerHolderFrame.Name = "colorPickerHolderFrame"

  5203. colorPickerHolderFrame.Parent = newColorPicker

  5204. colorPickerHolderFrame.Active = true

  5205. colorPickerHolderFrame.BackgroundColor3 = library.colors.topGradient

  5206. colored[1 + #colored] = {colorPickerHolderFrame, "BackgroundColor3", "topGradient"}

  5207. colorPickerHolderFrame.BorderColor3 = library.colors.elementBorder

  5208. colored[1 + #colored] = {colorPickerHolderFrame, "BorderColor3", "elementBorder"}

  5209. colorPickerHolderFrame.Selectable = true

  5210. colorPickerHolderFrame.Position = UDim2.fromScale(0.025, 1.012)

  5211. colorPickerHolderFrame.Size = UDim2.fromOffset(206, 250)

  5212. if math.ceil(colorPickerHolderFrame.AbsolutePosition.Y + colorPickerHolderFrame.AbsoluteSize.Y) > floor(newTabHolder.AbsoluteSize.Y + newTabHolder.AbsolutePosition.Y) then

  5213. colorPickerHolderFrame.Position = UDim2.new(0.025, 0, 1.012, -colorPickerHolderFrame.AbsoluteSize.Y - colorPickerButton.AbsoluteSize.Y - 2)

  5214. end

  5215. colorPickerHolderFrame.Visible = false

  5216. colorPickerHolderFrame.Image = "rbxassetid://2454009026"

  5217. colorPickerHolderFrame.ImageColor3 = library.colors.bottomGradient

  5218. colored[1 + #colored] = {colorPickerHolderFrame, "ImageColor3", "bottomGradient"}

  5219. colorPickerHolderInner.Name = "colorPickerHolderInner"

  5220. colorPickerHolderInner.Parent = colorPickerHolderFrame

  5221. colorPickerHolderInner.Active = true

  5222. colorPickerHolderInner.AnchorPoint = Vector2.new(0.5, 0.5)

  5223. colorPickerHolderInner.BackgroundColor3 = library.colors.topGradient

  5224. colored[1 + #colored] = {colorPickerHolderInner, "BackgroundColor3", "topGradient"}

  5225. colorPickerHolderInner.BorderColor3 = library.colors.elementBorder

  5226. colored[1 + #colored] = {colorPickerHolderInner, "BorderColor3", "elementBorder"}

  5227. colorPickerHolderInner.Position = UDim2.fromScale(0.5, 0.5)

  5228. colorPickerHolderInner.Selectable = true

  5229. colorPickerHolderInner.Size = UDim2.new(1, -4, 1, -4)

  5230. colorPickerHolderInner.Image = "rbxassetid://2454009026"

  5231. colorPickerHolderInner.ImageColor3 = library.colors.bottomGradient

  5232. colored[1 + #colored] = {colorPickerHolderInner, "ImageColor3", "bottomGradient"}

  5233. color.Name = "color"

  5234. color.Parent = colorPickerHolderInner

  5235. color.BackgroundColor3 = startingColor

  5236. color.BorderSizePixel = 0

  5237. color.Position = UDim2.fromOffset(5, 5)

  5238. color.Size = UDim2.new(1, -10, 0, 192)

  5239. color.Image = "rbxassetid://4155801252"

  5240. selectorColor.Name = "selectorColor"

  5241. selectorColor.Parent = color

  5242. selectorColor.AnchorPoint = Vector2.new(0.5, 0.5)

  5243. selectorColor.BackgroundColor3 = Color3.fromRGB(144, 144, 144)

  5244. selectorColor.BorderColor3 = Color3.fromRGB(69, 65, 70)

  5245. selectorColor.Position = UDim2.new(startingColor and select(3, Color3.toHSV(startingColor)))

  5246. selectorColor.Size = UDim2.fromOffset(4, 4)

  5247. hue.Name = "hue"

  5248. hue.Parent = colorPickerHolderInner

  5249. hue.BackgroundColor3 = Color3.new(1, 1, 1)

  5250. hue.BorderSizePixel = 0

  5251. hue.Position = UDim2.fromOffset(5, 202)

  5252. hue.Size = UDim2.new(1, -10, 0, 14)

  5253. hue.Image = "rbxassetid://3570695787"

  5254. hue.ScaleType = Enum.ScaleType.Slice

  5255. hue.SliceScale = 0.01

  5256. hueGradient.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 4)), ColorSequenceKeypoint.new(0.17, Color3.fromRGB(235, 7, 255)), ColorSequenceKeypoint.new(0.33, Color3:fromRGB(9, 189)), ColorSequenceKeypoint.new(0.5, Color3:fromRGB(193, 196)), ColorSequenceKeypoint.new(0.66, Color3:new(1)), ColorSequenceKeypoint.new(0.84, Color3.fromRGB(255, 247)), ColorSequenceKeypoint.new(1, Color3.new(1))})

  5257. hueGradient.Name = "hueGradient"

  5258. hueGradient.Parent = hue

  5259. selectorHue.Name = "selectorHue"

  5260. selectorHue.Parent = hue

  5261. selectorHue.BackgroundColor3 = Color3:fromRGB(125, 255)

  5262. selectorHue.BackgroundTransparency = 0.2

  5263. selectorHue.BorderColor3 = Color3:fromRGB(84, 91)

  5264. selectorHue.Position = UDim2.new(1 - (Color3.toHSV(startingColor)))

  5265. selectorHue.Size = UDim2:new(2, 1)

  5266. hexInput.Name = "hexInput"

  5267. hexInput.Parent = colorPickerHolderInner

  5268. hexInput.Active = true

  5269. hexInput.BackgroundColor3 = library.colors.topGradient

  5270. colored[1 + #colored] = {hexInput, "BackgroundColor3", "topGradient"}

  5271. hexInput.BorderColor3 = library.colors.elementBorder

  5272. colored[1 + #colored] = {hexInput, "BorderColor3", "elementBorder"}

  5273. hexInput.Position = UDim2.fromOffset(5, 223)

  5274. hexInput.Selectable = true

  5275. hexInput.Size = UDim2.fromOffset(150, 18)

  5276. hexInput.Image = "rbxassetid://2454009026"

  5277. hexInput.ImageColor3 = library.colors.bottomGradient

  5278. colored[1 + #colored] = {hexInput, "ImageColor3", "bottomGradient"}

  5279. hexInputInner.Name = "hexInputInner"

  5280. hexInputInner.Parent = hexInput

  5281. hexInputInner.Active = true

  5282. hexInputInner.AnchorPoint = Vector2.new(0.5, 0.5)

  5283. hexInputInner.BackgroundColor3 = library.colors.topGradient

  5284. colored[1 + #colored] = {hexInputInner, "BackgroundColor3", "topGradient"}

  5285. hexInputInner.BorderColor3 = library.colors.elementBorder

  5286. colored[1 + #colored] = {hexInputInner, "BorderColor3", "elementBorder"}

  5287. hexInputInner.Position = UDim2.fromScale(0.5, 0.5)

  5288. hexInputInner.Selectable = true

  5289. hexInputInner.Size = UDim2.new(1, -4, 1, -4)

  5290. hexInputInner.Image = "rbxassetid://2454009026"

  5291. hexInputInner.ImageColor3 = library.colors.bottomGradient

  5292. colored[1 + #colored] = {hexInputInner, "ImageColor3", "bottomGradient"}

  5293. hexInputBox.Name = "hexInputBox"

  5294. hexInputBox.Parent = hexInput

  5295. hexInputBox.BackgroundColor3 = Color3.new(1, 1, 1)

  5296. hexInputBox.BackgroundTransparency = 1

  5297. hexInputBox.Size = UDim2.fromScale(1, 1)

  5298. hexInputBox.ZIndex = 5

  5299. hexInputBox.Font = Enum.Font.Code

  5300. hexInputBox.PlaceholderText = "Hex Input"

  5301. hexInputBox.Text = Color3ToHex(startingColor)

  5302. hexInputBox.TextColor3 = library.colors.elementText

  5303. colored[1 + #colored] = {hexInputBox, "TextColor3", "elementText"}

  5304. hexInputBox.TextSize = 14

  5305. hexInputBox.ClearTextOnFocus = false

  5306. randomColor.Name = "randomColor"

  5307. randomColor.Parent = colorPickerHolderInner

  5308. randomColor.Active = true

  5309. randomColor.BackgroundColor3 = library.colors.topGradient

  5310. colored[1 + #colored] = {randomColor, "BackgroundColor3", "topGradient"}

  5311. randomColor.BorderColor3 = library.colors.elementBorder

  5312. colored[1 + #colored] = {randomColor, "BorderColor3", "elementBorder"}

  5313. randomColor.Position = UDim2.fromOffset(158, 223)

  5314. randomColor.Selectable = true

  5315. randomColor.Size = UDim2.fromOffset(18, 18)

  5316. randomColor.Image = "rbxassetid://2454009026"

  5317. randomColor.ImageColor3 = library.colors.bottomGradient

  5318. colored[1 + #colored] = {randomColor, "ImageColor3", "bottomGradient"}

  5319. randomColorInner.Name = "randomColorInner"

  5320. randomColorInner.Parent = randomColor

  5321. randomColorInner.Active = true

  5322. randomColorInner.AnchorPoint = Vector2.new(0.5, 0.5)

  5323. randomColorInner.BackgroundColor3 = library.colors.topGradient

  5324. colored[1 + #colored] = {randomColorInner, "BackgroundColor3", "topGradient"}

  5325. randomColorInner.BorderColor3 = library.colors.elementBorder

  5326. colored[1 + #colored] = {randomColorInner, "BorderColor3", "elementBorder"}

  5327. randomColorInner.Position = UDim2.fromScale(0.5, 0.5)

  5328. randomColorInner.Selectable = true

  5329. randomColorInner.Size = UDim2.new(1, -4, 1, -4)

  5330. randomColorInner.Image = "rbxassetid://2454009026"

  5331. randomColorInner.ImageColor3 = library.colors.bottomGradient

  5332. colored[1 + #colored] = {randomColorInner, "ImageColor3", "bottomGradient"}

  5333. randomColorButton.Name = "randomColorButton"

  5334. randomColorButton.Parent = randomColor

  5335. randomColorButton.BackgroundColor3 = Color3.new(1, 1, 1)

  5336. randomColorButton.BackgroundTransparency = 1

  5337. randomColorButton.Size = UDim2.fromScale(1, 1)

  5338. randomColorButton.ZIndex = 5

  5339. randomColorButton.Image = "rbxassetid://7484765651"

  5340. rainbow.Name = "rainbow"

  5341. rainbow.Parent = colorPickerHolderInner

  5342. rainbow.Active = true

  5343. rainbow.BackgroundColor3 = library.colors.topGradient

  5344. colored[1 + #colored] = {rainbow, "BackgroundColor3", "topGradient"}

  5345. rainbow.BorderColor3 = library.colors.elementBorder

  5346. colored[1 + #colored] = {rainbow, "BorderColor3", "elementBorder"}

  5347. rainbow.Position = UDim2.fromOffset(158 + 18 + 4, 223)

  5348. rainbow.Selectable = true

  5349. rainbow.Size = UDim2.fromOffset(18, 18)

  5350. rainbow.Image = "rbxassetid://2454009026"

  5351. rainbow.ImageColor3 = library.colors.bottomGradient

  5352. colored[1 + #colored] = {rainbow, "ImageColor3", "bottomGradient"}

  5353. rainbowInner.Name = "rainbowInner"

  5354. rainbowInner.Parent = randomColor

  5355. rainbowInner.Active = true

  5356. rainbowInner.AnchorPoint = Vector2.new(0.5, 0.5)

  5357. rainbowInner.BackgroundColor3 = library.colors.topGradient

  5358. colored[1 + #colored] = {rainbowInner, "BackgroundColor3", "topGradient"}

  5359. rainbowInner.BorderColor3 = library.colors.elementBorder

  5360. colored[1 + #colored] = {rainbowInner, "BorderColor3", "elementBorder"}

  5361. rainbowInner.Position = UDim2.fromScale(0.5, 0.5)

  5362. rainbowInner.Selectable = true

  5363. rainbowInner.Size = UDim2.new(1, -4, 1, -4)

  5364. rainbowInner.Image = "rbxassetid://2454009026"

  5365. rainbowInner.ImageColor3 = library.colors.bottomGradient

  5366. colored[1 + #colored] = {rainbowInner, "ImageColor3", "bottomGradient"}

  5367. rainbowButton.Name = "rainbowButton"

  5368. rainbowButton.Parent = rainbow

  5369. rainbowButton.BackgroundColor3 = Color3.new(1, 1, 1)

  5370. rainbowButton.BackgroundTransparency = 1

  5371. rainbowButton.Size = UDim2.fromScale(1, 1)

  5372. rainbowButton.ZIndex = 5

  5373. rainbowButton.Image = "rbxassetid://7484772919"

  5374. local indexwith = (designers and "rainbows") or "rainbowsg"

  5375. local function setrainbow(t, rainbowColorMod)

  5376. if nil == rainbowColorMod and t ~= nil then

  5377. rainbowColorMod = t

  5378. end

  5379. if rainbowColorMod == nil or type(rainbowColorMod) ~= "boolean" then

  5380. rainbowColorMode = not rainbowColorMode

  5381. else

  5382. rainbowColorMode = rainbowColorMod

  5383. end

  5384. if colorInput then

  5385. colorInput = (colorInput:Disconnect() and nil) or nil

  5386. end

  5387. if hueInput then

  5388. hueInput = (hueInput:Disconnect() and nil) or nil

  5389. end

  5390. pcall(function()

  5391. if destroyrainbows and library.rainbows <= 0 then

  5392. destroyrainbows = nil

  5393. end

  5394. if destroyrainbowsg and library.rainbowsg <= 0 then

  5395. destroyrainbowsg = nil

  5396. end

  5397. end)

  5398. if rainbowColorMode then

  5399. pcall(function()

  5400. if not library.rainbowflags[flagName] then

  5401. library[indexwith] = 1 + library[indexwith]

  5402. end

  5403. library.rainbowflags[flagName] = true

  5404. oldImageColor = colorPickerInner.ImageColor3

  5405. oldBackgroundColor = colorPickerInner.BackgroundColor3

  5406. oldColor = color.BackgroundColor3

  5407. pcall(function()

  5408. local common_float = 1 / 255

  5409. while wait_check() and rainbowColorMode and (options.Value == "rainbow" or ((not designers and not destroyrainbowsg) or (designers and not destroyrainbows))) do

  5410. rainbowColorValue = common_float + rainbowColorValue

  5411. if rainbowColorValue > 1 then

  5412. rainbowColorValue = 0

  5413. end

  5414. colorH = rainbowColorValue

  5415. UpdateColorPicker(Color3.fromHSV(rainbowColorValue, 1, 1), true)

  5416. end

  5417. end)

  5418. end)

  5419. pcall(function()

  5420. rainbowColorMode = nil

  5421. if library.rainbowflags[flagName] then

  5422. library[indexwith] = library[indexwith] - 1

  5423. end

  5424. library.rainbowflags[flagName] = nil

  5425. end)

  5426. end

  5427. UpdateColorPicker(library_flags[flagName])

  5428. end

  5429. library.signals[1 + #library.signals] = randomColorButton.MouseButton1Click:Connect(function()

  5430. if rainbowColorMode then

  5431. setrainbow(false)

  5432. end

  5433. UpdateColorPicker(Color3.fromRGB(math.random(0, 255), math.random(0, 255), math.random(0, 255)))

  5434. end)

  5435. library.signals[1 + #library.signals] = rainbowButton.MouseButton1Click:Connect(setrainbow)

  5436. sectionFunctions:Update()

  5437. library.signals[1 + #library.signals] = newColorPicker.MouseEnter:Connect(function()

  5438. tweenService:Create(colorPicker, TweenInfo.new(0.25, library.configuration.easingStyle, library.configuration.easingDirection), {

  5439. BackgroundColor3 = darkenColor(library.colors.main, 1.5),

  5440. ImageColor3 = darkenColor(library.colors.main, 2.5)

  5441. }):Play()

  5442. colored_colorPicker_BackgroundColor3[3] = "main"

  5443. colored_colorPicker_BackgroundColor3[4] = 1.5

  5444. colored_colorPicker_ImageColor3[3] = "main"

  5445. colored_colorPicker_ImageColor3[4] = 2.5

  5446. end)

  5447. library.signals[1 + #library.signals] = newColorPicker.MouseLeave:Connect(function()

  5448. if not colorPickerEnabled then

  5449. tweenService:Create(colorPicker, TweenInfo.new(0.25, library.configuration.easingStyle, library.configuration.easingDirection), {

  5450. BackgroundColor3 = library.colors.topGradient,

  5451. ImageColor3 = library.colors.bottomGradient

  5452. }):Play()

  5453. colored_colorPicker_BackgroundColor3[3] = "topGradient"

  5454. colored_colorPicker_BackgroundColor3[4] = nil

  5455. colored_colorPicker_ImageColor3[3] = "bottomGradient"

  5456. colored_colorPicker_ImageColor3[4] = nil

  5457. end

  5458. end)

  5459. hexInputBox.FocusLost:Connect(function()

  5460. if #hexInputBox.Text > 5 then

  5461. local last_vv = library_flags[flagName]

  5462. local not_fucked, clr = pcall(Color3FromHex, hexInputBox.Text)

  5463. UpdateColorPicker((not_fucked and clr) or last_vv)

  5464. end

  5465. end)

  5466. colorH = 1 - (math.clamp(selectorHue.AbsolutePosition.X - hue.AbsolutePosition.X, 0, hue.AbsoluteSize.X) / hue.AbsoluteSize.X)

  5467. colorS = (math.clamp(selectorColor.AbsolutePosition.X - color.AbsolutePosition.X, 0, color.AbsoluteSize.X) / color.AbsoluteSize.X)

  5468. colorV = 1 - (math.clamp(selectorColor.AbsolutePosition.Y - color.AbsolutePosition.Y, 0, color.AbsoluteSize.Y) / color.AbsoluteSize.Y)

  5469. library.signals[1 + #library.signals] = color.InputBegan:Connect(function(input)

  5470. if input.UserInputType == Enum.UserInputType.MouseButton1 then

  5471. isDraggingSomething = true

  5472. colorInput = (colorInput and colorInput:Disconnect() and nil) or runService.RenderStepped:Connect(function()

  5473. local colorX = (math.clamp(mouse.X - color.AbsolutePosition.X, 0, color.AbsoluteSize.X) / color.AbsoluteSize.X)

  5474. local colorY = (math.clamp(mouse.Y - color.AbsolutePosition.Y, 0, color.AbsoluteSize.Y) / color.AbsoluteSize.Y)

  5475. selectorColor.Position = UDim2.fromScale(colorX, colorY)

  5476. colorS = colorX

  5477. colorV = 1 - colorY

  5478. UpdateColorPicker()

  5479. end)

  5480. library.signals[1 + #library.signals] = colorInput

  5481. end

  5482. end)

  5483. library.signals[1 + #library.signals] = color.InputEnded:Connect(function(input)

  5484. if input.UserInputType == Enum.UserInputType.MouseButton1 then

  5485. if colorInput then

  5486. isDraggingSomething = false

  5487. colorInput:Disconnect()

  5488. end

  5489. end

  5490. end)

  5491. library.signals[1 + #library.signals] = hue.InputBegan:Connect(function(input)

  5492. if input.UserInputType == Enum.UserInputType.MouseButton1 then

  5493. if hueInput then

  5494. hueInput:Disconnect()

  5495. end

  5496. isDraggingSomething = true

  5497. hueInput = runService.RenderStepped:Connect(function()

  5498. local hueX = math.clamp(mouse.X - hue.AbsolutePosition.X, 0, hue.AbsoluteSize.X) / hue.AbsoluteSize.X

  5499. selectorHue.Position = UDim2.new(hueX)

  5500. colorH = 1 - hueX

  5501. UpdateColorPicker()

  5502. end)

  5503. library.signals[1 + #library.signals] = hueInput

  5504. end

  5505. end)

  5506. library.signals[1 + #library.signals] = hue.InputEnded:Connect(function(input)

  5507. if hueInput and input.UserInputType == Enum.UserInputType.MouseButton1 then

  5508. isDraggingSomething = false

  5509. hueInput:Disconnect()

  5510. end

  5511. end)

  5512. if rainbowColorMode then

  5513. spawn(function()

  5514. rainbowColorMode = nil

  5515. setrainbow(true)

  5516. end)

  5517. end

  5518. local function Set(t, clr)

  5519. if clr == nil and t ~= nil then

  5520. clr = t

  5521. end

  5522. if clr == "rainbow" then

  5523. if not rainbowColorMode then

  5524. task.spawn(setrainbow, true)

  5525. end

  5526. return

  5527. elseif clr == "random" then

  5528. clr = Color3.new(math.random(), math.random(), math.random())

  5529. elseif type(clr) == "string" and tonumber(clr, 16) then

  5530. clr = Color3FromHex(clr)

  5531. end

  5532. task.spawn(setrainbow, false)

  5533. local last_v = library_flags[flagName]

  5534. library_flags[flagName] = clr

  5535. if options.Location then

  5536. options.Location[options.LocationFlag or flagName] = clr

  5537. end

  5538. color.BackgroundColor3 = clr

  5539. selectorColor.Position = UDim2.new(clr and select(3, Color3.toHSV(clr)))

  5540. selectorHue.Position = UDim2.new(1 - (Color3.toHSV(clr)))

  5541. colorPickerInner.BackgroundColor3 = darkenColor(clr, 1.5)

  5542. colorPickerInner.ImageColor3 = darkenColor(clr, 2.5)

  5543. hexInputBox.Text = Color3ToHex(clr)

  5544. colorH, colorS, colorV = Color3.toHSV(clr)

  5545. if callback and (last_v ~= clr or options.AllowDuplicateCalls) then

  5546. task.spawn(callback, clr, last_v)

  5547. end

  5548. return clr

  5549. end

  5550. if presetColor ~= nil then

  5551. Set(presetColor)

  5552. else

  5553. library_flags[flagName] = startingColor

  5554. if options.Location then

  5555. options.Location[options.LocationFlag or flagName] = startingColor

  5556. end

  5557. end

  5558. local default = options.Value or startingColor or library_flags[flagName]

  5559. local function update()

  5560. colorPickerName, callback = options.Name or colorPickerName, options.Callback

  5561. local clr = library_flags[flagName]

  5562. color.BackgroundColor3 = clr

  5563. selectorColor.Position = UDim2.new(clr and select(3, Color3.toHSV(clr)))

  5564. selectorHue.Position = UDim2.new(1 - (Color3.toHSV(clr)))

  5565. colorPickerInner.BackgroundColor3 = darkenColor(clr, 1.5)

  5566. colorPickerInner.ImageColor3 = darkenColor(clr, 2.5)

  5567. hexInputBox.Text = Color3ToHex(clr)

  5568. colorPickerHeadline.Text = colorPickerName or "???"

  5569. return clr

  5570. end

  5571. local objectdata = {

  5572. Options = options,

  5573. Name = flagName,

  5574. Flag = flagName,

  5575. Type = "Colorpicker",

  5576. Default = default,

  5577. Parent = sectionFunctions,

  5578. Instance = newColorPicker,

  5579. SetRainbow = setrainbow,

  5580. Get = function()

  5581. return library_flags[flagName]

  5582. end,

  5583. GetRainbow = function()

  5584. return rainbowColorMode

  5585. end,

  5586. Set = Set,

  5587. RawSet = function(t, clr)

  5588. if clr == nil and t ~= nil then

  5589. clr = t

  5590. end

  5591. if clr == "rainbow" then

  5592. if not rainbowColorMode then

  5593. task.spawn(setrainbow, true)

  5594. end

  5595. return clr

  5596. elseif clr == "random" then

  5597. clr = Color3.new(math.random(), math.random(), math.random())

  5598. elseif clr and type(clr) == "string" and tonumber(clr, 16) then

  5599. clr = Color3FromHex(clr)

  5600. end

  5601. task.spawn(setrainbow, false)

  5602. library_flags[flagName] = clr

  5603. if options.Location then

  5604. options.Location[options.LocationFlag or flagName] = clr

  5605. end

  5606. return clr

  5607. end,

  5608. Update = update,

  5609. Reset = function()

  5610. return Set(nil, default)

  5611. end

  5612. }

  5613. tabFunctions.Flags[flagName], sectionFunctions.Flags[flagName], elements[flagName] = objectdata, objectdata, objectdata

  5614. return objectdata

  5615. end

  5616. sectionFunctions.AddColorPicker = sectionFunctions.AddColorpicker

  5617. sectionFunctions.NewColorpicker = sectionFunctions.AddColorpicker

  5618. sectionFunctions.NewColorPicker = sectionFunctions.AddColorpicker

  5619. sectionFunctions.CreateColorPicker = sectionFunctions.AddColorpicker

  5620. sectionFunctions.CreateColorpicker = sectionFunctions.AddColorpicker

  5621. sectionFunctions.ColorPicker = sectionFunctions.AddColorpicker

  5622. sectionFunctions.Colorpicker = sectionFunctions.AddColorpicker

  5623. sectionFunctions.Cp = sectionFunctions.AddColorpicker

  5624. sectionFunctions.CP = sectionFunctions.AddColorpicker

  5625. function sectionFunctions:UpdateAll()

  5626. local target = self or sectionFunctions

  5627. if target and type(target) == "table" and target.Flags then

  5628. for _, e in next, target.Flags do

  5629. if e and type(e) == "table" and e.Update then

  5630. pcall(e.Update)

  5631. end

  5632. end

  5633. end

  5634. end

  5635. return sectionFunctions

  5636. end

  5637. tabFunctions.AddSection = tabFunctions.CreateSection

  5638. tabFunctions.NewSection = tabFunctions.CreateSection

  5639. tabFunctions.Section = tabFunctions.CreateSection

  5640. tabFunctions.Sec = tabFunctions.CreateSection

  5641. tabFunctions.S = tabFunctions.CreateSection

  5642. function tabFunctions:UpdateAll()

  5643. local target = self or tabFunctions

  5644. if target and type(target) == "table" and target.Flags then

  5645. for _, e in next, target.Flags do

  5646. if e and type(e) == "table" and e.Update then

  5647. pcall(e.Update)

  5648. end

  5649. end

  5650. end

  5651. end

  5652. return tabFunctions

  5653. end

  5654. windowFunctions.AddTab = windowFunctions.CreateTab

  5655. windowFunctions.NewTab = windowFunctions.CreateTab

  5656. windowFunctions.Tab = windowFunctions.CreateTab

  5657. windowFunctions.T = windowFunctions.CreateTab

  5658. function windowFunctions:CreateDesigner(options, ...)

  5659. options = (options and type(options) == "string" and resolvevararg("Tab", options, ...)) or options

  5660. assert(shared.bypasstablimit or library.Designer == nil, "Designer already exists")

  5661. options = options or {}

  5662. options.Image = options.Image or 7483871523

  5663. options.LastTab = true

  5664. local designer = windowFunctions:CreateTab(options)

  5665. local colorsection = designer:CreateSection({

  5666. Name = "Colors"

  5667. })

  5668. local backgroundsection = designer:CreateSection({

  5669. Name = "Background",

  5670. Side = "right"

  5671. })

  5672. local detailssection = designer:CreateSection({

  5673. Name = "Info"

  5674. })

  5675. local filessection = designer:CreateSection({

  5676. Name = "Profiles",

  5677. Side = "right"

  5678. })

  5679. local settingssection = designer:CreateSection({

  5680. Name = "Settings",

  5681. Side = "right"

  5682. })

  5683. local designerelements = {}

  5684. library.designerelements = designerelements

  5685. for _, v in next, {{"Main", "main"}, {"Background", "background"}, {"Outer Border", "outerBorder"}, {"Inner Border", "innerBorder"}, {"Top Gradient", "topGradient"}, {"Bottom Gradient", "bottomGradient"}, {"Section Background", "sectionBackground"}, {"Section", "section"}, {"Element Text", "elementText"}, {"Other Element Text", "otherElementText"}, {"Tab Text", "tabText"}, {"Element Border", "elementBorder"}, {"Selected Option", "selectedOption"}, {"Unselected Option", "unselectedOption"}, {"Hovered Option Top", "hoveredOptionTop"}, {"Unhovered Option Top", "unhoveredOptionTop"}, {"Hovered Option Bottom", "hoveredOptionBottom"}, {"Unhovered Option Bottom", "unhoveredOptionBottom"}} do

  5686. local nam, codename = v[1], v[2]

  5687. local cflag = "__Designer.Colors." .. codename

  5688. designerelements[codename] = {

  5689. Return = colorsection:AddColorpicker({

  5690. Name = nam,

  5691. Flag = cflag,

  5692. Value = library.colors[codename],

  5693. Callback = function(v, y)

  5694. library.colors[codename] = v or y

  5695. end,

  5696. __designer = 1

  5697. }),

  5698. Flag = cflag

  5699. }

  5700. end

  5701. local flags = {}

  5702. local persistoptions = {

  5703. Name = "Workspace Profile",

  5704. Flag = "__Designer.Background.WorkspaceProfile",

  5705. Flags = true,

  5706. Suffix = "Config",

  5707. Workspace = library.WorkspaceName or "Unnamed Workspace",

  5708. Desginer = true

  5709. }

  5710. local daaata = {{"AddTextbox", "__Designer.Textbox.ImageAssetID", backgroundsection, {

  5711. Name = "Image Asset ID",

  5712. Placeholder = "rbxassetid://4427304036",

  5713. Flag = "__Designer.Background.ImageAssetID",

  5714. Value = "rbxassetid://4427304036",

  5715. Callback = updatecolorsnotween

  5716. }}, {"AddColorpicker", "__Designer.Colorpicker.ImageColor", backgroundsection, {

  5717. Name = "Image Color",

  5718. Flag = "__Designer.Background.ImageColor",

  5719. Value = Color3.new(1, 1, 1),

  5720. Callback = updatecolorsnotween,

  5721. __designer = 1

  5722. }}, {"AddSlider", "__Designer.Slider.ImageTransparency", backgroundsection, {

  5723. Name = "Image Transparency",

  5724. Flag = "__Designer.Background.ImageTransparency",

  5725. Value = 95,

  5726. Min = 0,

  5727. Max = 100,

  5728. Format = "Image Transparency: %s%%",

  5729. Textbox = true,

  5730. Callback = updatecolorsnotween

  5731. }}, {"AddToggle", "__Designer.Toggle.UseBackgroundImage", backgroundsection, {

  5732. Name = "Use Background Image",

  5733. Flag = "__Designer.Background.UseBackgroundImage",

  5734. Value = true,

  5735. Callback = updatecolorsnotween

  5736. }}, {"AddPersistence", "__Designer.Persistence.ThemeFile", filessection, {

  5737. Name = "Theme Profile",

  5738. Flag = "__Designer.Files.ThemeFile",

  5739. Workspace = "Function Lib Themes",

  5740. Flags = flags,

  5741. Suffix = "Theme",

  5742. Desginer = true

  5743. }}, {"AddTextbox", "__Designer.Textbox.WorkspaceName", filessection, {

  5744. Name = "Workspace Name",

  5745. Value = library.WorkspaceName or "Unnamed Workspace",

  5746. Flag = "__Designer.Files.WorkspaceFile",

  5747. Callback = function(n, o)

  5748. persistoptions.Workspace = n or o

  5749. end

  5750. }}, {"AddPersistence", "__Designer.Persistence.WorkspaceProfile", filessection, persistoptions}, {"AddButton", "__Designer.Button.TerminateGUI", settingssection, {{

  5751. Name = "Terminate GUI",

  5752. Callback = library.unload

  5753. }, {

  5754. Name = "Reset GUI",

  5755. Callback = resetall

  5756. }}}, {"AddKeybind", "__Designer.Keybind.ShowHideKey", settingssection, {

  5757. Name = "Show/Hide Key",

  5758. Location = library.configuration,

  5759. Flag = "__Designer.Settings.ShowHideKey",

  5760. LocationFlag = "hideKeybind",

  5761. Value = library.configuration.hideKeybind,

  5762. Callback = function()

  5763. lasthidebing = os.clock()

  5764. end

  5765. }}}

  5766. if setclipboard and daaata[8] then

  5767. local common_table = daaata[8][4]

  5768. if common_table then

  5769. common_table[1 + #common_table] = {

  5770. Name = "",

  5771. Callback = function()

  5772. local http = game:GetService('HttpService')

  5773. local req = http_request or request or HttpPost or syn.request

  5774. if req then

  5775. req({

  5776. Url = 'http://127.0.0.1:6463/rpc?v=1',

  5777. Method = 'POST',

  5778. Headers = {

  5779. ['Content-Type'] = 'application/json',

  5780. Origin = 'https://discord.com'

  5781. },

  5782. Body = http:JSONEncode({

  5783. cmd = 'INVITE_BROWSER',

  5784. nonce = http:GenerateGUID(false),

  5785. args = {code = 'uNQRZs6gzm'}

  5786. })

  5787. })

  5788. end

  5789. end

  5790. }

  5791. common_table = nil

  5792. end

  5793. end

  5794. if options.Info then

  5795. local typ = type(options.Info)

  5796. if typ == "string" then

  5797. daaata[1 + #daaata] = {"AddLabel", "__Designer.Label.Creator", detailssection, {

  5798. Text = options.Info

  5799. }}

  5800. elseif typ == "table" and #options.Info > 0 then

  5801. for _, v in next, options.Info do

  5802. daaata[1 + #daaata] = {"AddLabel", "__Designer.Label.Creator", detailssection, {

  5803. Text = tostring(v)

  5804. }}

  5805. end

  5806. end

  5807. end

  5808. for _, v in next, daaata do

  5809. designerelements[v[2]] = v[3][v[1]](v[3], v[4])

  5810. end

  5811. designerelements["__Designer.Textbox.WorkspaceName"]:Set(library.WorkspaceName or "Unnamed Workspace")

  5812. for k, v in next, elements do

  5813. if v and k and string.sub(k, 1, 11) == "__Designer." and v.Type and v.Type ~= "Persistence" then

  5814. flags[1 + #flags] = k

  5815. end

  5816. end

  5817. if library.Backdrop then

  5818. library.Backdrop.Image = resolveid(library_flags["__Designer.Background.ImageAssetID"], "__Designer.Background.ImageAssetID") or ""

  5819. library.Backdrop.Visible = not not library_flags["__Designer.Background.UseBackgroundImage"]

  5820. library.Backdrop.ImageTransparency = (library_flags["__Designer.Background.ImageTransparency"] or 95) / 100

  5821. library.Backdrop.ImageColor3 = library_flags["__Designer.Background.ImageColor"] or Color3.new(1, 1, 1)

  5822. end

  5823. local function setbackground(t, Asset, Transparency, Visible)

  5824. if Visible == nil and t ~= nil and type(t) ~= "table" then

  5825. Asset, Transparency, Visible = t, Transparency, Visible

  5826. end

  5827. if Visible == 0 or ((Asset == 0 or Asset == false) and Visible == nil and Transparency == nil) then

  5828. Visible = false

  5829. elseif Visible == 1 or ((Asset == 1 or Asset == true) and Visible == nil and Transparency == nil) then

  5830. Visible = true

  5831. elseif Asset == nil and Transparency == nil and Visible == nil then

  5832. Visible = not library_flags["__Designer.Background.UseBackgroundImage"]

  5833. end

  5834. local temp = Asset and type(Asset)

  5835. if Transparency == nil and Visible == nil and temp == "number" and ((Asset ~= 1 and Asset ~= 0) or (Asset > 0 and Asset <= 100)) then

  5836. Transparency, Asset, temp = Asset, nil

  5837. end

  5838. if temp and ((temp == "number" and Asset > 1) or temp == "string") then

  5839. designerelements["__Designer.Textbox.ImageAssetID"]:Set(Asset)

  5840. end

  5841. temp = tonumber(Transparency)

  5842. if temp then

  5843. designerelements["__Designer.Slider.ImageTransparency"]:Set(temp)

  5844. end

  5845. if Visible ~= nil then

  5846. designerelements["__Designer.Toggle.UseBackgroundImage"]:Set(not not Visible)

  5847. end

  5848. return Asset, Transparency, Visible

  5849. end

  5850. local bk = options.Background or options.Backdrop or options.Grahpic

  5851. if bk then

  5852. if type(bk) == "table" then

  5853. setbackground(bk.Asset or bk[1], bk.Transparency or bk[2], bk.Visible or bk[3])

  5854. else

  5855. setbackground(bk, 0, 1)

  5856. end

  5857. end

  5858. library.Designer = {

  5859. Options = options,

  5860. Parent = windowFunctions,

  5861. Name = "Designer",

  5862. Flag = "Designer",

  5863. Type = "Designer",

  5864. Instance = designer,

  5865. SetBackground = setbackground

  5866. }

  5867. local savestuff = library.elements["__Designer.Background.WorkspaceProfile"]

  5868. if savestuff then

  5869. library.LoadFile = savestuff.LoadFile

  5870. library.LoadFileRaw = savestuff.LoadFileRaw

  5871. library.LoadJSON = savestuff.LoadJSON

  5872. library.LoadJSONRaw = savestuff.LoadJSONRaw

  5873. library.SaveFile = savestuff.SaveFile

  5874. library.GetJSON = savestuff.GetJSON

  5875. end

  5876. spawn(updatecolorsnotween)

  5877. return library.Designer

  5878. end

  5879. windowFunctions.AddDesigner = windowFunctions.CreateDesigner

  5880. windowFunctions.NewDesigner = windowFunctions.CreateDesigner

  5881. windowFunctions.Designer = windowFunctions.CreateDesigner

  5882. windowFunctions.D = windowFunctions.CreateDesigner

  5883. function windowFunctions:UpdateAll()

  5884. local target = self or windowFunctions

  5885. if target and type(target) == "table" and target.Flags then

  5886. for _, e in next, target.Flags do

  5887. if e and type(e) == "table" and e.Update then

  5888. pcall(e.Update)

  5889. end

  5890. end

  5891. pcall(function()

  5892. if library.Backdrop then

  5893. library.Backdrop.Visible = not not library_flags["__Designer.Background.UseBackgroundImage"]

  5894. library.Backdrop.Image = resolveid(library_flags["__Designer.Background.ImageAssetID"], "__Designer.Background.ImageAssetID") or ""

  5895. library.Backdrop.ImageColor3 = library_flags["__Designer.Background.ImageColor"] or Color3.new(1, 1, 1)

  5896. library.Backdrop.ImageTransparency = (library_flags["__Designer.Background.ImageTransparency"] or 95) / 100

  5897. end

  5898. end)

  5899. end

  5900. end

  5901. library.UpdateAll = windowFunctions.UpdateAll

  5902. if options.Themeable or options.DefaultTheme or options.Theme then

  5903. spawn(function()

  5904. local os_clock = os.clock

  5905. local starttime = os_clock()

  5906. while os_clock() - starttime < 12 do

  5907. if homepage then

  5908. windowFunctions.GoHome = homepage

  5909. local x, e = pcall(homepage)

  5910. if not x and e then

  5911. warn("Error going to Homepage:", e)

  5912. end

  5913. x, e = nil

  5914. break

  5915. end

  5916. task.wait()

  5917. end

  5918. local whatDoILookLike = options.Themeable or options.DefaultTheme or options.Theme

  5919. windowFunctions:CreateDesigner((type(whatDoILookLike) == "table" and whatDoILookLike) or nil)

  5920. if options.DefaultTheme or options.Theme then

  5921. spawn(function()

  5922. local content = options.DefaultTheme or options.Theme or options.JSON or options.ThemeJSON

  5923. if content and type(content) == "string" and #content > 1 then

  5924. local good, jcontent = JSONDecode(content)

  5925. if good and jcontent then

  5926. for cflag, val in next, jcontent do

  5927. local data = elements[cflag]

  5928. if data and data.Type ~= "Persistence" then

  5929. if data.Set then

  5930. data:Set(val)

  5931. elseif data.RawSet then

  5932. data:RawSet(val)

  5933. else

  5934. library.flags[cflag] = val

  5935. end

  5936. end

  5937. end

  5938. end

  5939. end

  5940. end)

  5941. end

  5942. os_clock, starttime = nil

  5943. end)

  5944. end

  5945. return windowFunctions

  5946. end

  5947. library.NewWindow = library.CreateWindow

  5948. library.AddWindow = library.CreateWindow

  5949. library.Window = library.CreateWindow

  5950. library.W = library.CreateWindow

  5951. local Wait = library.subs.Wait

  5952. local PepsiUi = library:CreateWindow({

  5953. Name = "Luxury Hub",

  5954. Theme = {

  5955. Image = "rbxassetid://7483871523",

  5956. Info = "Yo Yo",

  5957. Background = {

  5958. Asset = "rbxassetid://5553946656"

  5959. }

  5960. }

  5961. })

  5962. local Page = PepsiUi:CreateTab({

  5963. Name = "Main"

  5964. })

  5965. local PageTab = PepsiUi:CreateTab({

  5966. Name = "Teleport"

  5967. })

  5968. local TestTab = Page:CreateSection({

  5969. Name = "Main Section",

  5970. Side = "Left" -- ตำแหน่ง Left/Right

  5971. })

  5972. local PetSection = Page:CreateSection({

  5973. Name = "Pet & Egg Section",

  5974. Side = "Left" -- ตำแหน่ง Left/Right

  5975. })

  5976. local Boostd = Page:CreateSection({

  5977. Name = "Boost Section",

  5978. Side = "Right" -- ตำแหน่ง Left/Right

  5979. })

  5980. local Rocket = Page:CreateSection({

  5981. Name = "Rocket Section",

  5982. Side = "Right" -- ตำแหน่ง Left/Right

  5983. })

  5984. local Mik = Page:CreateSection({

  5985. Name = "Misc Section",

  5986. Side = "Right" -- ตำแหน่ง Left/Right

  5987. })

  5988. local Teld = PageTab:CreateSection({

  5989. Name = "World Section",

  5990. Side = "Left" -- ตำแหน่ง Left/Right

  5991. })

  5992. TestTab:AddToggle({

  5993. Name = "Auto Stars Farm",

  5994. Value = _G.Loop,

  5995. Callback = function(value)

  5996. _G.Loop = value

  5997. if _G.Loop then

  5998. local gamed = game.Players.LocalPlayer.Character.HumanoidRootPart

  5999. local starsFolder = game.Workspace.Stars:GetChildren()

  6000. while _G.Loop do

  6001. for _, model in ipairs(starsFolder) do

  6002. if model:IsA("Model") then

  6003. local part = model:FindFirstChildWhichIsA("BasePart")

  6004. if part then

  6005. gamed.CFrame = CFrame.new(part.Position)

  6006. end

  6007. end

  6008. end

  6009. wait()

  6010. end

  6011. end

  6012. end

  6013. })

  6014. TestTab:AddToggle({

  6015. Name = "Collect Stars",

  6016. Value = _G.AutoFarm,

  6017. Callback = function(value)

  6018. _G.AutoFarm = value

  6019. while _G.AutoFarm do wait()

  6020. pcall(function()

  6021. for i,v in pairs(game:GetService("Workspace").Stars:GetDescendants()) do

  6022. if v.ClassName == "Model" then

  6023. v.Root.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame

  6024. end

  6025. end

  6026. end)

  6027. end

  6028. end

  6029. })

  6030. local UserInputService = game:GetService("UserInputService")

  6031. TestTab:AddToggle({

  6032. Name = "Auto Throw",

  6033. Value = _G.Loop,

  6034. Callback = function(value)

  6035. _G.Loop = value

  6036. while _G.Loop do

  6037. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Throw"):WaitForChild("Server"):WaitForChild("Request"):FireServer()

  6038. wait(7)

  6039. end

  6040. end

  6041. })

  6042. TestTab:AddToggle({

  6043. Name = "Auto Rewards",

  6044. Value = _G.Loop,

  6045. Callback = function(value)

  6046. _G.Loop = value

  6047. while _G.Loop do

  6048. wait()

  6049. local args = {

  6050. [1] = "PlayTime",

  6051. [2] = 1

  6052. }

  6053. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Player"):WaitForChild("Server"):WaitForChild("ClaimTimedReward"):InvokeServer(unpack(args))

  6054. local args = {

  6055. [1] = "PlayTime",

  6056. [2] = 2

  6057. }

  6058. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Player"):WaitForChild("Server"):WaitForChild("ClaimTimedReward"):InvokeServer(unpack(args))

  6059. local args = {

  6060. [1] = "PlayTime",

  6061. [2] = 3

  6062. }

  6063. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Player"):WaitForChild("Server"):WaitForChild("ClaimTimedReward"):InvokeServer(unpack(args))

  6064. local args = {

  6065. [1] = "PlayTime",

  6066. [2] = 4

  6067. }

  6068. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Player"):WaitForChild("Server"):WaitForChild("ClaimTimedReward"):InvokeServer(unpack(args))

  6069. local args = {

  6070. [1] = "PlayTime",

  6071. [2] = 5

  6072. }

  6073. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Player"):WaitForChild("Server"):WaitForChild("ClaimTimedReward"):InvokeServer(unpack(args))

  6074. local args = {

  6075. [1] = "PlayTime",

  6076. [2] = 6

  6077. }

  6078. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Player"):WaitForChild("Server"):WaitForChild("ClaimTimedReward"):InvokeServer(unpack(args))

  6079. end

  6080. end

  6081. })

  6082. TestTab:AddToggle({

  6083. Name = "Auto Rebirth",

  6084. Value = _G.Loop,

  6085. Callback = function(value)

  6086. _G.Loop = value

  6087. while _G.Loop do

  6088. wait()

  6089. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Player"):WaitForChild("Server"):WaitForChild("AttemptRebirth"):InvokeServer()

  6090. end

  6091. end

  6092. })

  6093. TestTab:AddToggle({

  6094. Name = "Auto Spin Daily",

  6095. Value = _G.Loop,

  6096. Callback = function(value)

  6097. _G.Loop = value

  6098. while _G.Loop do

  6099. wait()

  6100. local args = {

  6101. [1] = "DailyWheel"

  6102. }

  6103. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Player"):WaitForChild("Server"):WaitForChild("ClaimTimedReward"):InvokeServer(unpack(args))

  6104. end

  6105. end

  6106. })

  6107. TestTab:AddButton({

  6108. Name = "Unlock All Gamepass(soon)",

  6109. Callback = function()

  6110. game.workspace.World.VIPWall:Destroy()

  6111. end

  6112. })

  6113. TestTab:AddButton({

  6114. Name = "Redeem All Code",

  6115. Callback = function()

  6116. local args = {

  6117. [1] = "iLoveYeeting"

  6118. }

  6119. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Player"):WaitForChild("Server"):WaitForChild("RedeemCode"):InvokeServer(unpack(args))

  6120. wait(0.2)

  6121. local args = {

  6122. [1] = "FreeStars"

  6123. }

  6124. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Player"):WaitForChild("Server"):WaitForChild("RedeemCode"):InvokeServer(unpack(args))

  6125. wait(0.2)

  6126. local args = {

  6127. [1] = "FreePower"

  6128. }

  6129. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Player"):WaitForChild("Server"):WaitForChild("RedeemCode"):InvokeServer(unpack(args))

  6130. wait(0.2)

  6131. end

  6132. })

  6133. TestTab:AddButton({

  6134. Name = "Twitter Verified",

  6135. Callback = function()

  6136. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Player"):WaitForChild("Server"):WaitForChild("VerifyTwitter"):InvokeServer("@cronaheartz")

  6137. end

  6138. })

  6139. local list = {"Forest","Flight","Bugs","Aqua","Bzzzz","Slime","Elemental","Green","Candy","Sweet","Wild","Feral","Viking","Mythic","Anime","Special","Captain","Pirate","Planetary","Cosmic","Hard","Insane"}

  6140. PetSection:AddDropdown({

  6141. Name = "Select Egg",

  6142. Value = "",

  6143. List = list,

  6144. Callback = function(value)

  6145. _G.Select = value

  6146. end

  6147. })

  6148. PetSection:AddToggle({

  6149. Name = "Auto Open",

  6150. Value = _G.Loop,

  6151. Callback = function(value)

  6152. _G.Loop = value

  6153. if _G.Select == "Forest" then

  6154. while _G.Loop do

  6155. wait()

  6156. local args = {

  6157. [1] = "1"

  6158. }

  6159. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6160. end

  6161. end

  6162. if _G.Select == "Flight" then

  6163. while _G.Loop do

  6164. wait()

  6165. local args = {

  6166. [1] = "2"

  6167. }

  6168. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6169. end

  6170. end

  6171. if _G.Select == "Bugs" then

  6172. while _G.Loop do

  6173. wait()

  6174. local args = {

  6175. [1] = "3"

  6176. }

  6177. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6178. end

  6179. end

  6180. if _G.Select == "Aqua" then

  6181. while _G.Loop do

  6182. wait()

  6183. local args = {

  6184. [1] = "4"

  6185. }

  6186. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6187. end

  6188. end

  6189. if _G.Select == "Bzzzz" then

  6190. while _G.Loop do

  6191. wait()

  6192. local args = {

  6193. [1] = "5"

  6194. }

  6195. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6196. end

  6197. end

  6198. if _G.Select == "Slime" then

  6199. while _G.Loop do

  6200. wait()

  6201. local args = {

  6202. [1] = "6"

  6203. }

  6204. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6205. end

  6206. end

  6207. if _G.Select == "Elemental" then

  6208. while _G.Loop do

  6209. wait()

  6210. local args = {

  6211. [1] = "7"

  6212. }

  6213. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6214. end

  6215. end

  6216. if _G.Select == "Green" then

  6217. while _G.Loop do

  6218. wait()

  6219. local args = {

  6220. [1] = "8"

  6221. }

  6222. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6223. end

  6224. end

  6225. if _G.Select == "Candy" then

  6226. while _G.Loop do

  6227. wait()

  6228. local args = {

  6229. [1] = "9"

  6230. }

  6231. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6232. end

  6233. end

  6234. if _G.Select == "Sweet" then

  6235. while _G.Loop do

  6236. wait()

  6237. local args = {

  6238. [1] = "10"

  6239. }

  6240. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6241. end

  6242. end

  6243. if _G.Select == "Wild" then

  6244. while _G.Loop do

  6245. wait()

  6246. local args = {

  6247. [1] = "11"

  6248. }

  6249. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6250. end

  6251. end

  6252. if _G.Select == "Feral" then

  6253. while _G.Loop do

  6254. wait()

  6255. local args = {

  6256. [1] = "12"

  6257. }

  6258. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6259. end

  6260. end

  6261. if _G.Select == "Viking" then

  6262. while _G.Loop do

  6263. wait()

  6264. local args = {

  6265. [1] = "13"

  6266. }

  6267. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6268. end

  6269. end

  6270. if _G.Select == "Mythic" then

  6271. while _G.Loop do

  6272. wait()

  6273. local args = {

  6274. [1] = "14"

  6275. }

  6276. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6277. end

  6278. end

  6279. if _G.Select == "Anime" then

  6280. while _G.Loop do

  6281. wait()

  6282. local args = {

  6283. [1] = "15"

  6284. }

  6285. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6286. end

  6287. end

  6288. if _G.Select == "Special" then

  6289. while _G.Loop do

  6290. wait()

  6291. local args = {

  6292. [1] = "16"

  6293. }

  6294. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6295. end

  6296. end

  6297. if _G.Select == "Captain" then

  6298. while _G.Loop do

  6299. wait()

  6300. local args = {

  6301. [1] = "17"

  6302. }

  6303. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6304. end

  6305. end

  6306. if _G.Select == "Pirate" then

  6307. while _G.Loop do

  6308. wait()

  6309. local args = {

  6310. [1] = "18"

  6311. }

  6312. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6313. end

  6314. end

  6315. if _G.Select == "Planetary" then

  6316. while _G.Loop do

  6317. wait()

  6318. local args = {

  6319. [1] = "19"

  6320. }

  6321. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6322. end

  6323. end

  6324. if _G.Select == "Cosmic" then

  6325. while _G.Loop do

  6326. wait()

  6327. local args = {

  6328. [1] = "20"

  6329. }

  6330. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6331. end

  6332. end

  6333. if _G.Select == "Hard" then

  6334. while _G.Loop do

  6335. wait()

  6336. local args = {

  6337. [1] = "21"

  6338. }

  6339. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6340. end

  6341. end

  6342. if _G.Select == "Insane" then

  6343. while _G.Loop do

  6344. wait()

  6345. local args = {

  6346. [1] = "22"

  6347. }

  6348. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Egg"):WaitForChild("Server"):WaitForChild("Purchase"):InvokeServer(unpack(args))

  6349. end

  6350. end

  6351. end

  6352. })

  6353. PetSection:AddButton({

  6354. Name = "Equip Best",

  6355. Callback = function()

  6356. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Pet"):WaitForChild("Server"):WaitForChild("EquipBest"):FireServer()

  6357. end

  6358. })

  6359. PetSection:AddButton({

  6360. Name = "Craft All",

  6361. Callback = function()

  6362. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Pet"):WaitForChild("Server"):WaitForChild("CraftAll"):FireServer()

  6363. end

  6364. })

  6365. Boostd:AddToggle({

  6366. Name = "Activate Energy",

  6367. Value = _G.Loop,

  6368. Callback = function(value)

  6369. _G.Loop = value

  6370. while _G.Loop do

  6371. wait()

  6372. local args = {

  6373. [1] = "Energy"

  6374. }

  6375. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Boosts"):WaitForChild("Server"):WaitForChild("Activate"):FireServer(unpack(args))

  6376. end

  6377. end

  6378. })

  6379. Boostd:AddToggle({

  6380. Name = "Activate Power",

  6381. Value = _G.Loop,

  6382. Callback = function(value)

  6383. _G.Loop = value

  6384. while _G.Loop do

  6385. wait()

  6386. local args = {

  6387. [1] = "Power"

  6388. }

  6389. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Boosts"):WaitForChild("Server"):WaitForChild("Activate"):FireServer(unpack(args))

  6390. end

  6391. end

  6392. })

  6393. Boostd:AddToggle({

  6394. Name = "Activate Luck",

  6395. Value = _G.Loop,

  6396. Callback = function(value)

  6397. _G.Loop = value

  6398. while _G.Loop do

  6399. wait()

  6400. local args = {

  6401. [1] = "Luck"

  6402. }

  6403. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Boosts"):WaitForChild("Server"):WaitForChild("Activate"):FireServer(unpack(args))

  6404. end

  6405. end

  6406. })

  6407. Boostd:AddToggle({

  6408. Name = "Activate All",

  6409. Value = _G.Loop,

  6410. Callback = function(value)

  6411. _G.Loop = value

  6412. spawn(function()

  6413. while _G.Loop do

  6414. local args = {

  6415. [1] = "Luck"

  6416. }

  6417. game:GetService("ReplicatedStorage").Remote.Boosts.Server.Activate:FireServer(unpack(args))

  6418. args[1] = "Power"

  6419. game:GetService("ReplicatedStorage").Remote.Boosts.Server.Activate:FireServer(unpack(args))

  6420. args[1] = "Energy"

  6421. game:GetService("ReplicatedStorage").Remote.Boosts.Server.Activate:FireServer(unpack(args))

  6422. wait()

  6423. end

  6424. end)

  6425. end

  6426. })

  6427. Rocket:AddToggle({

  6428. Name = "Auto Upgrade Rocket",

  6429. Value = _G.Loop,

  6430. Callback = function(value)

  6431. _G.Loop = value

  6432. while _G.Loop do

  6433. wait()

  6434. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Rocket"):WaitForChild("Server"):WaitForChild("PurchaseNextRocketUpgrade"):InvokeServer()

  6435. end

  6436. end

  6437. })

  6438. Teld:AddToggle({

  6439. Name = "World 1",

  6440. Value = _G.Loop,

  6441. Callback = function(value)

  6442. _G.Loop = value

  6443. while _G.Loop do

  6444. wait()

  6445. local args = {

  6446. [1] = "1"

  6447. }

  6448. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Teleport"):WaitForChild("Server"):WaitForChild("RequestTeleport"):FireServer(unpack(args))

  6449. end

  6450. end

  6451. })

  6452. Teld:AddToggle({

  6453. Name = "World 2",

  6454. Value = _G.Loop,

  6455. Callback = function(value)

  6456. _G.Loop = value

  6457. while _G.Loop do

  6458. wait()

  6459. local args = {

  6460. [1] = "2"

  6461. }

  6462. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Teleport"):WaitForChild("Server"):WaitForChild("RequestTeleport"):FireServer(unpack(args))

  6463. end

  6464. end

  6465. })

  6466. Teld:AddToggle({

  6467. Name = "World 3",

  6468. Value = _G.Loop,

  6469. Callback = function(value)

  6470. _G.Loop = value

  6471. while _G.Loop do

  6472. wait()

  6473. local args = {

  6474. [1] = "3"

  6475. }

  6476. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Teleport"):WaitForChild("Server"):WaitForChild("RequestTeleport"):FireServer(unpack(args))

  6477. end

  6478. end

  6479. })

  6480. Teld:AddToggle({

  6481. Name = "World 4",

  6482. Value = _G.Loop,

  6483. Callback = function(value)

  6484. _G.Loop = value

  6485. while _G.Loop do

  6486. wait()

  6487. local args = {

  6488. [1] = "4"

  6489. }

  6490. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Teleport"):WaitForChild("Server"):WaitForChild("RequestTeleport"):FireServer(unpack(args))

  6491. end

  6492. end

  6493. })

  6494. Teld:AddToggle({

  6495. Name = "World 5",

  6496. Value = _G.Loop,

  6497. Callback = function(value)

  6498. _G.Loop = value

  6499. while _G.Loop do

  6500. wait()

  6501. local args = {

  6502. [1] = "5"

  6503. }

  6504. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Teleport"):WaitForChild("Server"):WaitForChild("RequestTeleport"):FireServer(unpack(args))

  6505. end

  6506. end

  6507. })

  6508. Teld:AddToggle({

  6509. Name = "World 6",

  6510. Value = _G.Loop,

  6511. Callback = function(value)

  6512. _G.Loop = value

  6513. while _G.Loop do

  6514. wait()

  6515. local args = {

  6516. [1] = "6"

  6517. }

  6518. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Teleport"):WaitForChild("Server"):WaitForChild("RequestTeleport"):FireServer(unpack(args))

  6519. end

  6520. end

  6521. })

  6522. Teld:AddToggle({

  6523. Name = "World 7",

  6524. Value = _G.Loop,

  6525. Callback = function(value)

  6526. _G.Loop = value

  6527. while _G.Loop do

  6528. wait()

  6529. local args = {

  6530. [1] = "7"

  6531. }

  6532. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Teleport"):WaitForChild("Server"):WaitForChild("RequestTeleport"):FireServer(unpack(args))

  6533. end

  6534. end

  6535. })

  6536. Teld:AddToggle({

  6537. Name = "World 8",

  6538. Value = _G.Loop,

  6539. Callback = function(value)

  6540. _G.Loop = value

  6541. while _G.Loop do

  6542. wait()

  6543. local args = {

  6544. [1] = "8"

  6545. }

  6546. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Teleport"):WaitForChild("Server"):WaitForChild("RequestTeleport"):FireServer(unpack(args))

  6547. end

  6548. end

  6549. })

  6550. Teld:AddToggle({

  6551. Name = "World 9",

  6552. Value = _G.Loop,

  6553. Callback = function(value)

  6554. _G.Loop = value

  6555. while _G.Loop do

  6556. wait()

  6557. local args = {

  6558. [1] = "9"

  6559. }

  6560. game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Teleport"):WaitForChild("Server"):WaitForChild("RequestTeleport"):FireServer(unpack(args))

  6561. end

  6562. end

  6563. })

  6564. Mik:AddTextBox({

  6565. Name = "Insert Time To Rejoin",

  6566. Flag = "",

  6567. Callback = function(t)

  6568. _G.Timed = t

  6569. end

  6570. })

  6571. Mik:AddToggle({

  6572. Name = "Auto Rejoin",

  6573. value = _G.Afk,

  6574. Callback = function(t)

  6575. _G.Afk = t

  6576. local RejoinDelay = _G.Timed

  6577. local TeleportService = game:GetService("TeleportService")

  6578. local Players = game:GetService("Players")

  6579. local Player = Players.LocalPlayer

  6580. local function RejoinGame()

  6581. local placeId = game.PlaceId

  6582. local jobId = game.JobId

  6583. print("Rejoining game...")

  6584. TeleportService:TeleportToPlaceInstance(placeId, jobId, Player)

  6585. end

  6586. while _G.Afk do wait()

  6587. wait(RejoinDelay)

  6588. RejoinGame()

  6589. end

  6590. end

  6591. })

  6592. Mik:AddButton({

  6593. Name = "Anti Afk",

  6594. Callback = function()

  6595. while true do

  6596. local VirtualUser = game:GetService("VirtualUser")

  6597. VirtualUser:CaptureController()

  6598. VirtualUser:ClickButton1(Vector2.new())

  6599. wait(300)

  6600. end

  6601. end

  6602. })

  6603. Mik:AddButton({

  6604. Name = "FPS Boost",

  6605. Callback = function()

  6606. local decalsyeeted = false

  6607. local g = game

  6608. local w = g.Workspace

  6609. local l = g.Lighting

  6610. local t = w.Terrain

  6611. t.WaterWaveSize = 0

  6612. t.WaterWaveSpeed = 0

  6613. t.WaterReflectance = 0

  6614. t.WaterTransparency = 0

  6615. l.GlobalShadows = false

  6616. l.FogEnd = 9e9

  6617. l.Brightness = 0

  6618. settings().Rendering.QualityLevel = "Level01"

  6619. for i, v in pairs(g:GetDescendants()) do

  6620. if v:IsA("Part") or v:IsA("Union") or v:IsA("CornerWedgePart") or v:IsA("TrussPart") then

  6621. v.Material = "Plastic"

  6622. v.Reflectance = 0

  6623. elseif v:IsA("Decal") or v:IsA("Texture") and decalsyeeted then

  6624. v.Transparency = 1

  6625. elseif v:IsA("ParticleEmitter") or v:IsA("Trail") then

  6626. v.Lifetime = NumberRange.new(0)

  6627. elseif v:IsA("Explosion") then

  6628. v.BlastPressure = 1

  6629. v.BlastRadius = 1

  6630. elseif v:IsA("Fire") or v:IsA("SpotLight") or v:IsA("Smoke") then

  6631. v.Enabled = false

  6632. elseif v:IsA("MeshPart") then

  6633. v.Material = "Plastic"

  6634. v.Reflectance = 0

  6635. v.TextureID = 10385902758728957

  6636. end

  6637. end

  6638. for i, e in pairs(l:GetChildren()) do

  6639. if e:IsA("BlurEffect") or e:IsA("SunRaysEffect") or e:IsA("ColorCorrectionEffect") or e:IsA("BloomEffect") or e:IsA("DepthOfFieldEffect") then

  6640. e.Enabled = false

  6641. end

  6642. end

  6643. end

  6644. })

  6645. Mik:AddButton({

  6646. Name = "Rejoin",

  6647. Callback = function()

  6648. local PlaceID = 11708967881

  6649. local ServerID = game.JobId

  6650. local TPS = game:GetService("TeleportService")

  6651. TPS:TeleportToPlaceInstance(PlaceID, ServerID, plr)

  6652. end

  6653. })

  6654. local Maths = Page:AddSection({

  6655. Name = "learning Maths",

  6656. Side = "Right"

  6657. })

  6658. local Numbers = Maths:AddLabel({

  6659. Name = "1 min = 60second"

  6660. })

  6661. local Numbers = Maths:AddLabel({

  6662. Name = "so 60 x 30"

  6663. })

  6664. local Numbers = Maths:AddLabel({

  6665. Name = "= 1,800"

  6666. })

  6667. local Numbers = Maths:AddLabel({

  6668. Name = "we sound to x second to min like"

  6669. })

  6670. local Numbers = Maths:AddLabel({

  6671. Name = "60 x 10 = 600"

  6672. })

  6673. return library, library_flags, library.subs

Yeet A Friend Script PinkScripts - Pastebin.com (2025)
Top Articles
Latest Posts
Recommended Articles
Article information

Author: Melvina Ondricka

Last Updated:

Views: 5466

Rating: 4.8 / 5 (48 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Melvina Ondricka

Birthday: 2000-12-23

Address: Suite 382 139 Shaniqua Locks, Paulaborough, UT 90498

Phone: +636383657021

Job: Dynamic Government Specialist

Hobby: Kite flying, Watching movies, Knitting, Model building, Reading, Wood carving, Paintball

Introduction: My name is Melvina Ondricka, I am a helpful, fancy, friendly, innocent, outstanding, courageous, thoughtful person who loves writing and wants to share my knowledge and understanding with you.