Advertisement
BINCOOD

Untitled

Feb 5th, 2023
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.98 KB | None | 0 0
  1. local library = {}
  2. local libalive = true
  3. local holdingmouse = false
  4.  
  5. -- 17,856 pastebin views
  6. -- as of 1/29/2023 @ 6:30 CST
  7.  
  8. local plr = game:GetService("Players").LocalPlayer
  9. local mouse = plr:GetMouse()
  10. local runs = game:GetService("RunService")
  11. local us = game:GetService("UserInputService")
  12. local screengui = Instance.new("ScreenGui",game.CoreGui)
  13. local Open = Instance.new("TextButton")
  14. local Close = Instance.new("TextButton")
  15. local S = Instance.new("ScreenGui")
  16. local Zed = Instance.new("ScreenGui")
  17. local windowsopened = 0
  18.  
  19. S.Name = "S"
  20. S.Parent = game.CoreGui
  21. S.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  22.  
  23. Zed.Name = "Zed"
  24. Zed.Parent = game.CoreGui
  25. Zed.ZIndexBehavior = Enum.ZIndexBehavior.Zedibling
  26.  
  27. local elementsize = 24
  28.  
  29. local font = Font.new(
  30. "rbxassetid://11702779517",
  31. Enum.FontWeight.Regular,
  32. Enum.FontStyle.Normal
  33. )
  34.  
  35. local titlefont = Font.new(
  36. "rbxassetid://11702779517",
  37. Enum.FontWeight.Bold,
  38. Enum.FontStyle.Normal
  39. )
  40.  
  41. local medfont = Font.new(
  42. "rbxassetid://11702779517",
  43. Enum.FontWeight.Medium,
  44. Enum.FontStyle.Normal
  45. )
  46.  
  47. us.InputBegan:Connect(function(key,pro)
  48. if key.UserInputType == Enum.UserInputType.MouseButton1 then
  49. holdingmouse = true
  50. end
  51. end)
  52.  
  53. us.InputEnded:Connect(function(key,pro)
  54. if key.UserInputType == Enum.UserInputType.MouseButton1 then
  55. holdingmouse = false
  56. end
  57. end)
  58.  
  59. function draggable(obj) -- https://devforum.roblox.com/t/draggable-property-is-hidden-on-gui-objects/107689/4
  60. local UserInputService = game:GetService("UserInputService")
  61. local gui = obj
  62.  
  63. local dragging
  64. local dragInput
  65. local dragStart
  66. local startPos
  67.  
  68. local function update(input)
  69. local delta = input.Position - dragStart
  70. gui.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  71. end
  72.  
  73. gui.InputBegan:Connect(function(input)
  74. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  75. dragging = true
  76. dragStart = input.Position
  77. startPos = gui.Position
  78.  
  79. input.Changed:Connect(function()
  80. if input.UserInputState == Enum.UserInputState.End then
  81. dragging = false
  82. end
  83. end)
  84. end
  85. end)
  86.  
  87. gui.InputChanged:Connect(function(input)
  88. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  89. dragInput = input
  90. end
  91. end)
  92.  
  93. UserInputService.InputChanged:Connect(function(input)
  94. if input == dragInput and dragging then
  95. update(input)
  96. end
  97. end)
  98. end
  99.  
  100. function hovercolor(b,idle,hover,clicked,included)
  101. local hovering = false
  102. local holding = false
  103.  
  104. b.MouseEnter:Connect(function()
  105. hovering = true
  106. end)
  107.  
  108. b.MouseLeave:Connect(function()
  109. hovering = false
  110. end)
  111.  
  112. b.MouseButton1Down:Connect(function()
  113. holding = true
  114. end)
  115.  
  116. b.MouseButton1Up:Connect(function()
  117. holding = false
  118. end)
  119.  
  120. if included and typeof(included) == "table" and #included > 0 then
  121. for i,v in pairs(included) do
  122. b.Changed:Connect(function()
  123. v.BackgroundColor3 = b.BackgroundColor3
  124. end)
  125. end
  126. end
  127.  
  128. runs.RenderStepped:Connect(function()
  129. if hovering then
  130. if holding then
  131. b.BackgroundColor3 = clicked
  132. else
  133. b.BackgroundColor3 = hover
  134. end
  135. else
  136. b.BackgroundColor3 = idle
  137. end
  138. end)
  139. end
  140.  
  141. library.window = function(text)
  142. local windowalive = true
  143. local frame = Instance.new("Frame",screengui)
  144. frame.Position = UDim2.new(0.016+windowsopened/12,0,0.009,0)
  145. frame.BackgroundColor3 = Color3.fromRGB(15,15,20)
  146. --frame.AutomaticSize = Enum.AutomaticSize.Y
  147. frame.BorderSizePixel = 0
  148. --frame.Active = true
  149. --frame.Draggable = true
  150. local list = Instance.new("UIListLayout",frame)
  151. list.HorizontalAlignment = "Center"
  152. list.Padding = UDim.new(0,3)
  153. list.SortOrder = Enum.SortOrder.LayoutOrder
  154. draggable(frame)
  155.  
  156. windowsopened = windowsopened + 1
  157.  
  158. local header = Instance.new("Frame",frame)
  159. header.BackgroundColor3 = Color3.fromRGB(55,55,60)
  160. header.Size = UDim2.new(1,0,0,32)
  161. header.BorderSizePixel = 0
  162.  
  163. local separator = Instance.new("Frame",header)
  164. separator.BackgroundColor3 = Color3.fromRGB(55,55,60)
  165. separator.Size = UDim2.new(1,0,0.4,0)
  166. separator.Position = UDim2.new(0,0,0.6,0)
  167. separator.BorderSizePixel = 0
  168.  
  169. Instance.new("UICorner",frame)
  170. Instance.new("UICorner",header)
  171.  
  172. local title = Instance.new("TextLabel",header)
  173. title.TextScaled = true
  174. title.Text = tostring(text)
  175. title.TextColor3 = Color3.fromRGB(255,255,255)
  176. title.Size = UDim2.new(1,0,1,0)
  177. title.FontFace = titlefont
  178. title.BorderSizePixel = 0
  179. title.BackgroundTransparency = 1
  180.  
  181. frame.Size = UDim2.new(0.08,0,0.0335,0)
  182. local gui = {}
  183.  
  184. local elements = 0
  185. gui.label = function(text,extrasize)
  186. extrasize = extrasize or 0
  187.  
  188. local b = Instance.new("TextLabel",frame)
  189. b.LayoutOrder = 0
  190. b.TextScaled = true
  191. b.BackgroundTransparency = 1
  192. b.Text = tostring(text)
  193. b.TextColor3 = Color3.fromRGB(255,255,255)
  194. b.Size = UDim2.new(0.96,0,0,elementsize+extrasize)
  195. b.FontFace = font
  196. b.BorderSizePixel = 0
  197.  
  198. elements = elements + 1
  199. frame.Size = frame.Size + UDim2.new(0,0,0,elementsize+3+extrasize)
  200.  
  201. local subgui = {}
  202.  
  203. subgui.changetext = function(txt)
  204. b.Text = tostring(txt)
  205. end
  206.  
  207. return subgui
  208. end
  209.  
  210. gui.button = function(text,onclick)
  211. local el = Instance.new("Frame",frame)
  212. el.LayoutOrder = 0
  213. el.Size = UDim2.new(0.96,0,0,elementsize)
  214. el.BorderSizePixel = 0
  215. el.BackgroundTransparency = 1
  216.  
  217. local b = Instance.new("TextButton",el)
  218. b.LayoutOrder = 0
  219. b.TextScaled = true
  220. b.BackgroundColor3 = Color3.fromRGB(35,35,40)
  221. b.Text = tostring(text)
  222. b.TextColor3 = Color3.fromRGB(255,255,255)
  223. b.Size = UDim2.new(1,0,1,0)
  224. b.FontFace = font
  225. b.BorderSizePixel = 0
  226. b.AutoButtonColor = false
  227. b.ZIndex = 10
  228.  
  229. local top = Instance.new("Frame",el)
  230. top.Size = UDim2.new(1,0,0.4,0)
  231. top.Position = UDim2.new(0,0,0,0)
  232. top.BorderSizePixel = 0
  233.  
  234. local bot = Instance.new("Frame",el)
  235. bot.Size = UDim2.new(1,0,0.4,0)
  236. bot.Position = UDim2.new(0,0,0.6,0)
  237. bot.BorderSizePixel = 0
  238.  
  239. local thiselement = elements+1
  240. hovercolor(b,Color3.fromRGB(35,35,40),Color3.fromRGB(45,45,50),Color3.fromRGB(25,25,30),{top,bot})
  241. elements = elements + 1
  242. Instance.new("UICorner",b).CornerRadius = UDim.new(0,5)
  243.  
  244. spawn(function()
  245. while b do
  246. bot.Visible = (elements>thiselement)
  247. task.wait()
  248. end
  249. end)
  250.  
  251. frame.Size = frame.Size + UDim2.new(0,0,0,elementsize+3)
  252. b.MouseButton1Down:Connect(onclick)
  253. end
  254.  
  255. gui.toggle = function(text,default,onclick)
  256. local enabled = default or false
  257. local el = Instance.new("Frame",frame)
  258. el.LayoutOrder = 0
  259. el.Size = UDim2.new(0.96,0,0,elementsize)
  260. el.BorderSizePixel = 0
  261. el.BackgroundTransparency = 1
  262.  
  263. local b = Instance.new("TextButton",el)
  264. b.LayoutOrder = 0
  265. b.TextScaled = true
  266. b.BackgroundColor3 = Color3.fromRGB(35,35,40)
  267. b.Text = tostring(text)
  268. b.TextColor3 = enabled and Color3.new(0,1,0) or Color3.new(1,0,0)
  269. b.Size = UDim2.new(1,0,1,0)
  270. b.FontFace = font
  271. b.BorderSizePixel = 0
  272. b.AutoButtonColor = false
  273. b.ZIndex = 10
  274.  
  275. local top = Instance.new("Frame",el)
  276. top.Size = UDim2.new(1,0,0.4,0)
  277. top.Position = UDim2.new(0,0,0,0)
  278. top.BorderSizePixel = 0
  279.  
  280. local bot = Instance.new("Frame",el)
  281. bot.Size = UDim2.new(1,0,0.4,0)
  282. bot.Position = UDim2.new(0,0,0.6,0)
  283. bot.BorderSizePixel = 0
  284.  
  285. local thiselement = elements+1
  286. hovercolor(b,Color3.fromRGB(35,35,40),Color3.fromRGB(45,45,50),Color3.fromRGB(25,25,30),{top,bot})
  287. elements = elements + 1
  288. Instance.new("UICorner",b).CornerRadius = UDim.new(0,5)
  289.  
  290. spawn(function()
  291. while b do
  292. bot.Visible = (elements>thiselement)
  293. task.wait()
  294. end
  295. end)
  296.  
  297. Open.Name = "Open"
  298. Open.Parent = S
  299. Open.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  300. Open.Position = UDim2.new(0.74, 0, 0.27, 0)
  301. Open.Size = UDim2.new(0, 35, 0, 30)
  302. Open.Font = Enum.Font.SourceSans
  303. Open.Text = "+"
  304. Open.TextColor3 = Color3.fromRGB(0, 153, 0)
  305. Open.TextScaled = true
  306. Open.TextSize = 16.000
  307. Open.TextWrapped = true
  308. Open.MouseButton1Down:Connect(function()
  309. screengui.Visible = true
  310. end)
  311.  
  312. Close.Name = "Close"
  313. Close.Parent = main
  314. Close.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  315. Close.Position = UDim2.new(0.74, 0, 0.27, 0)
  316. Close.Size = UDim2.new(0, 30, 0, 30)
  317. Close.Font = Enum.Font.SourceSans
  318. Close.Text = "X"
  319. Close.TextColor3 = Color3.fromRGB(255, 0, 0)
  320. Close.TextScaled = true
  321. Close.TextSize = 14.000
  322. Close.TextWrapped = true
  323. Close.MouseButton1Click:Connect(function()
  324. screengui.Visible = false
  325. end)
  326.  
  327. frame.Size = frame.Size + UDim2.new(0,0,0,elementsize+3)
  328. b.MouseButton1Down:Connect(function()
  329. enabled = not enabled
  330. b.TextColor3 = enabled and Color3.new(0,1,0) or Color3.new(1,0,0)
  331. onclick(enabled)
  332. end)
  333.  
  334. local subgui = {}
  335.  
  336. subgui.set = function(bool)
  337. enabled = bool
  338. b.TextColor3 = enabled and Color3.new(0,1,0) or Color3.new(1,0,0)
  339. onclick(enabled)
  340. end
  341.  
  342. return subgui
  343. end
  344.  
  345. gui.textbox = function(text,unfocused)
  346. local el = Instance.new("Frame",frame)
  347. el.LayoutOrder = 0
  348. el.Size = UDim2.new(0.96,0,0,elementsize)
  349. el.BorderSizePixel = 0
  350. el.BackgroundTransparency = 1
  351.  
  352. local b = Instance.new("TextBox",el)
  353. b.LayoutOrder = 0
  354. b.TextScaled = true
  355. b.BackgroundColor3 = Color3.fromRGB(35,35,40)
  356. b.PlaceholderText = tostring(text)
  357. b.PlaceholderColor3 = Color3.fromRGB(80,80,80)
  358. b.Text = ""
  359. b.TextColor3 = Color3.fromRGB(125,200,255)
  360. b.Size = UDim2.new(1,0,1,0)
  361. b.FontFace = font
  362. b.BorderSizePixel = 0
  363. b.ZIndex = 10
  364.  
  365. local top = Instance.new("Frame",el)
  366. top.Size = UDim2.new(1,0,0.4,0)
  367. top.Position = UDim2.new(0,0,0,0)
  368. top.BorderSizePixel = 0
  369. top.BackgroundColor3 = b.BackgroundColor3
  370.  
  371. local bot = Instance.new("Frame",el)
  372. bot.Size = UDim2.new(1,0,0.4,0)
  373. bot.Position = UDim2.new(0,0,0.6,0)
  374. bot.BorderSizePixel = 0
  375. bot.BackgroundColor3 = b.BackgroundColor3
  376.  
  377. local thiselement = elements+1
  378. elements = elements + 1
  379. Instance.new("UICorner",b).CornerRadius = UDim.new(0,5)
  380.  
  381. task.spawn(function()
  382. while b do
  383. bot.Visible = (elements>thiselement)
  384. task.wait()
  385. end
  386. end)
  387.  
  388. frame.Size = frame.Size + UDim2.new(0,0,0,elementsize+3)
  389. b.FocusLost:Connect(function()
  390. unfocused(b.Text)
  391. end)
  392.  
  393. local subgui = {}
  394.  
  395. subgui.text = function()
  396. return b.Text
  397. end
  398.  
  399. subgui.changetext = function(newtext)
  400. b.Text = newtext
  401. end
  402.  
  403. return subgui
  404. end
  405.  
  406. local coldropdown = nil
  407. gui.dropdown = function(text,contents)
  408. local el = Instance.new("Frame",frame)
  409. el.LayoutOrder = 0
  410. el.Size = UDim2.new(0.96,0,0,elementsize)
  411. el.BorderSizePixel = 0
  412. el.BackgroundTransparency = 1
  413. el.ZIndex = 2
  414.  
  415. local b = Instance.new("TextButton",el)
  416. b.LayoutOrder = 0
  417. b.TextScaled = true
  418. b.BackgroundColor3 = Color3.fromRGB(35,35,40)
  419. b.Text = tostring(text) .." >"
  420. b.TextColor3 = Color3.fromRGB(255,255,255)
  421. b.Size = UDim2.new(1,0,1,0)
  422. b.FontFace = font
  423. b.BorderSizePixel = 0
  424. b.AutoButtonColor = false
  425. b.ZIndex = 2
  426. local d = Instance.new("Frame",b)
  427. d.AnchorPoint = Vector2.new(0.5,0)
  428. d.Position = UDim2.new(0.5,0,0.72,0)
  429. d.Size = UDim2.new(1.04,0,0,9)
  430. d.BackgroundColor3 = Color3.fromRGB(15,15,20)
  431. d.AutomaticSize = Enum.AutomaticSize.Y
  432. d.BorderSizePixel = 0
  433. d.Visible = false
  434. d.ZIndex = 2
  435. local dlist = Instance.new("UIListLayout",d)
  436. dlist.HorizontalAlignment = "Center"
  437. dlist.Padding = UDim.new(0,3)
  438. dlist.SortOrder = Enum.SortOrder.LayoutOrder
  439.  
  440. local separator = Instance.new("Frame",d)
  441. separator.BackgroundTransparency = 1
  442. separator.Size = UDim2.new(1,0,0,6)
  443.  
  444. local top = Instance.new("Frame",el)
  445. top.Size = UDim2.new(1,0,0.4,0)
  446. top.Position = UDim2.new(0,0,0,0)
  447. top.BorderSizePixel = 0
  448.  
  449. local bot = Instance.new("Frame",el)
  450. bot.Size = UDim2.new(1,0,0.4,0)
  451. bot.Position = UDim2.new(0,0,0.6,0)
  452. bot.BorderSizePixel = 0
  453.  
  454. local thiselement = elements+1
  455. hovercolor(b,Color3.fromRGB(35,35,40),Color3.fromRGB(45,45,50),Color3.fromRGB(25,25,30),{top,bot})
  456. elements = elements + 1
  457. Instance.new("UICorner",b).CornerRadius = UDim.new(0,5)
  458. Instance.new("UICorner",d)
  459.  
  460. spawn(function()
  461. while b do
  462. bot.Visible = (elements>thiselement)
  463. task.wait()
  464. end
  465. end)
  466.  
  467. frame.Size = frame.Size + UDim2.new(0,0,0,elementsize+3)
  468.  
  469. local search = ""
  470. local selected = nil
  471. local function addcontent(name)
  472. if typeof(name) == "Instance" then
  473. name = name.Name
  474. end
  475.  
  476. local e = Instance.new("TextButton",d)
  477. e.LayoutOrder = 0
  478. e.TextScaled = true
  479. e.BackgroundColor3 = Color3.fromRGB(75,75,80)
  480. e.Text = tostring(name)
  481. e.TextColor3 = Color3.fromRGB(255,255,255)
  482. e.Size = UDim2.new(0.96,0,0,elementsize)
  483. e.FontFace = font
  484. e.BorderSizePixel = 0
  485. e.Name = name
  486. e.ZIndex = 35-elements
  487.  
  488. Instance.new("UICorner",e)
  489. d.Size = d.Size + UDim2.new(0,0,0,25)
  490.  
  491. e.MouseButton1Down:Connect(function()
  492. d.Visible = false
  493. b.ZIndex = 2
  494. b.Text = tostring(name).." >"
  495. b.TextColor3 = Color3.fromRGB(200,255,200)
  496. selected = name
  497. end)
  498.  
  499. spawn(function()
  500. while task.wait() do
  501. local s = search:lower()
  502.  
  503. if s ~= "" then
  504. if tostring(name):lower():find(s) then
  505. e.Visible = true
  506. else
  507. e.Visible = false
  508. end
  509. else
  510. e.Visible = true
  511. end
  512. end
  513. end)
  514. end
  515.  
  516. for i,v in pairs(contents) do
  517. addcontent(v)
  518. end
  519.  
  520. b.MouseButton1Down:Connect(function()
  521. d.Visible = not d.Visible
  522. el.ZIndex = d.Visible and 10 or 12
  523. b.ZIndex = d.Visible and 22 or 10
  524. coldropdown = d.Visible and el or nil
  525.  
  526. if not selected then
  527. b.Text = d.Visible and tostring(text).." <" or tostring(text).." >"
  528. else
  529. b.Text = d.Visible and tostring(selected).." <" or tostring(selected).." >"
  530. end
  531.  
  532. repeat task.wait() until coldropdown ~= el
  533.  
  534. d.Visible = false
  535. el.ZIndex = d.Visible and 10 or 12
  536. b.ZIndex = d.Visible and 22 or 10
  537. end)
  538.  
  539. local subgui = {}
  540.  
  541. subgui.get = function()
  542. return selected
  543. end
  544.  
  545. subgui.add = function(txt)
  546. addcontent(txt)
  547. end
  548.  
  549. subgui.search = function(txt)
  550. search = tostring(txt)
  551.  
  552. d.Size = UDim2.new(1.04,0,0,0)
  553. task.wait()
  554. local items = 0
  555. for i,v in pairs(d:GetChildren()) do
  556. if v:IsA("TextButton") and v.Visible then
  557. i = i + 1
  558. d.Size = d.Size + UDim2.new(0,0,0,25)
  559. end
  560. end
  561. end
  562.  
  563. subgui.delete = function(txt)
  564. if d:FindFirstChild(txt) then
  565. d:FindFirstChild(txt):Destroy()
  566. d.Size = d.Size - UDim2.new(0,0,0,25)
  567.  
  568. if selected == txt then
  569. b.TextColor3 = Color3.fromRGB(255,255,255)
  570. b.Text = tostring(text).." >"
  571. selected = nil
  572. end
  573. end
  574. end
  575.  
  576. subgui.clear = function()
  577. for i,v in pairs(d:GetChildren()) do
  578. if v:IsA("TextButton") then
  579. v:Destroy()
  580. d.Size = d.Size - UDim2.new(0,0,0,25)
  581. end
  582. end
  583. b.TextColor3 = Color3.fromRGB(255,255,255)
  584. b.Text = tostring(text).." >"
  585. selected = nil
  586. end
  587.  
  588. return subgui
  589. end
  590.  
  591. gui.slider = function(text,min,max,roundto,default,onchange)
  592. local el = Instance.new("Frame",frame)
  593. el.LayoutOrder = 0
  594. el.Size = UDim2.new(0.96,0,0,elementsize+5)
  595. el.BorderSizePixel = 0
  596. el.BackgroundTransparency = 1
  597.  
  598. local b = Instance.new("Frame",el)
  599. b.LayoutOrder = 0
  600. b.BackgroundColor3 = Color3.fromRGB(35,35,40)
  601. b.Size = UDim2.new(1,0,1,0)
  602. b.BorderSizePixel = 0
  603. b.ZIndex = 10
  604.  
  605. local txtholder = Instance.new("TextLabel",b)
  606. txtholder.TextScaled = true
  607. txtholder.BackgroundColor3 = Color3.fromRGB(35,35,40)
  608. txtholder.Text = tostring(text).." [".. tostring(default).."]"
  609. txtholder.TextColor3 = Color3.fromRGB(255,255,255)
  610. txtholder.Size = UDim2.new(1,0,0.7,0)
  611. txtholder.FontFace = medfont
  612. txtholder.BorderSizePixel = 0
  613. txtholder.ZIndex = 10
  614.  
  615. local slidepart = Instance.new("Frame",b)
  616. slidepart.BackgroundColor3 = Color3.fromRGB(255,255,255)
  617. slidepart.Size = UDim2.new(0.9,0,0.05,0)
  618. slidepart.Position = UDim2.new(0.05,0,0.8,0)
  619. slidepart.BorderSizePixel = 0
  620. slidepart.ZIndex = 10
  621.  
  622. local slideball = Instance.new("ImageLabel",slidepart)
  623. slideball.AnchorPoint = Vector2.new(0.5,0.5)
  624. slideball.BackgroundTransparency = 1
  625. slideball.Size = UDim2.new(0.055,0,5,0)
  626. slideball.Position = UDim2.new(0,0,0.5,0)
  627. slideball.Image = "rbxassetid://6755657357"
  628. slideball.BorderSizePixel = 0
  629. slideball.ZIndex = 12
  630.  
  631. local button = Instance.new("TextButton",b)
  632. button.BackgroundTransparency = 1
  633. button.Text = ""
  634. button.Size = UDim2.new(1,0,1,0)
  635. button.ZIndex = 35
  636.  
  637. local top = Instance.new("Frame",el)
  638. top.Size = UDim2.new(1,0,0.4,0)
  639. top.Position = UDim2.new(0,0,0,0)
  640. top.BorderSizePixel = 0
  641. top.BackgroundColor3 = b.BackgroundColor3
  642.  
  643. local bot = Instance.new("Frame",el)
  644. bot.Size = UDim2.new(1,0,0.4,0)
  645. bot.Position = UDim2.new(0,0,0.6,0)
  646. bot.BorderSizePixel = 0
  647. bot.BackgroundColor3 = b.BackgroundColor3
  648.  
  649. local thiselement = elements+1
  650. elements = elements + 1
  651. Instance.new("UICorner",b).CornerRadius = UDim.new(0,5)
  652.  
  653. task.spawn(function()
  654. while b do
  655. bot.Visible = (elements>thiselement)
  656. task.wait()
  657. end
  658. end)
  659.  
  660. local slidervalue
  661. local function setslider(value)
  662. local trueval = math.floor(value/roundto)*roundto
  663. local norm = (trueval-min)/(max-min)
  664. slideball.Position = UDim2.new(norm,0,0.5,0)
  665. txtholder.Text = tostring(text).." [".. tostring(math.floor(trueval*100)/100).."]"
  666.  
  667. slidervalue = trueval
  668. onchange(trueval)
  669. end
  670.  
  671. local holding = false
  672. button.MouseButton1Down:Connect(function()
  673. holdingmouse = true
  674.  
  675. task.spawn(function()
  676. while holdingmouse and windowalive and libalive do
  677. local abpos = slidepart.AbsolutePosition
  678. local absize = slidepart.AbsoluteSize
  679. local x = mouse.X
  680.  
  681. local p = math.clamp((x-abpos.X)/(absize.X),0,1)
  682. local value = p*max+(1-p)*min
  683.  
  684. setslider(value)
  685. task.wait()
  686. end
  687. end)
  688. end)
  689.  
  690. button.MouseButton1Up:Connect(function()
  691. holding = false
  692. end)
  693.  
  694. frame.Size = frame.Size + UDim2.new(0,0,0,elementsize+3+5)
  695. setslider(default)
  696.  
  697. local subgui = {}
  698.  
  699. subgui.get = function(val)
  700. return slidervalue
  701. end
  702.  
  703. subgui.setvalue = function(val)
  704. setslider(val)
  705. end
  706.  
  707. subgui.setmin = function(val)
  708. min = val
  709. setslider(slidervalue)
  710. end
  711.  
  712. subgui.setmax = function(val)
  713. max = val
  714. setslider(slidervalue)
  715. end
  716.  
  717. return subgui
  718. end
  719.  
  720. gui.hide = function()
  721. frame.Visible = false
  722. end
  723.  
  724. gui.show = function()
  725. frame.Visible = true
  726. end
  727.  
  728. gui.delete = function()
  729. windowalive = false
  730. gui:Destroy()
  731. end
  732.  
  733. return gui
  734. end
  735.  
  736. library.delete = function()
  737. libalive = false
  738. screengui:Destroy()
  739. end
  740.  
  741. return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement