XZTablets

WallyHub V3 - Kinleiii

Jul 7th, 2020 (edited)
1,017
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.02 KB | None | 0 0
  1. local HttpService = game:GetService("HttpService")
  2. local RunService = game:GetService("RunService")
  3. local TweenService = game:GetService("TweenService")
  4. local InputService = game:GetService("UserInputService")
  5.  
  6. local Player = game.Players.LocalPlayer
  7. local Mouse = Player:GetMouse()
  8.  
  9. local library = {}
  10. library.Colours = {}
  11.  
  12. local libraryColours = library.Colours
  13. libraryColours.Main = Color3.fromRGB(20, 20, 20)
  14. libraryColours.Primary = Color3.fromRGB(26, 26, 26)
  15. libraryColours.Secondary = Color3.fromRGB(38, 38, 38)
  16. libraryColours.Status = Color3.fromRGB(65, 65, 65)
  17. libraryColours.Check = Color3.fromRGB(30, 30, 30)
  18. libraryColours.Text = Color3.fromRGB(170, 170, 170)
  19. libraryColours.Picker = Color3.fromRGB(50, 50, 50)
  20. libraryColours.Accents = Color3.fromRGB(0, 255, 109)
  21. libraryColours.White = Color3.fromRGB(255,255,255)
  22. libraryColours.OffWhite = Color3.fromRGB(225,225,225)
  23. libraryColours.Black = Color3.fromRGB(0,0,0)
  24.  
  25. local function RelativeXY(GuiObject)
  26. local x, y = Mouse.X - GuiObject.AbsolutePosition.X, Mouse.Y - GuiObject.AbsolutePosition.Y
  27. local xm, ym = GuiObject.AbsoluteSize.X, GuiObject.AbsoluteSize.Y
  28. x = math.clamp(x, 0, xm)
  29. y = math.clamp(y, 0, ym)
  30. return x, y, x/xm, y/ym
  31. end
  32.  
  33. local function RoundBox()
  34. local Round = Instance.new("ImageLabel")
  35. Round.BackgroundTransparency = 1
  36. Round.Image = "rbxasset://textures/ui/dialog_white@2x.png"
  37. Round.ScaleType = Enum.ScaleType.Slice
  38. Round.SliceCenter = Rect.new(10, 10, 10, 10)
  39. return Round
  40. end
  41.  
  42. local function RoundButton()
  43. local Round = Instance.new("ImageButton")
  44. Round.AutoButtonColor = false
  45. Round.BackgroundTransparency = 1
  46. Round.Image = "rbxasset://textures/ui/dialog_white@2x.png"
  47. Round.ScaleType = Enum.ScaleType.Slice
  48. Round.SliceCenter = Rect.new(10, 10, 10, 10)
  49. return Round
  50. end
  51.  
  52. local function Status()
  53. local Stat = Instance.new("ImageButton")
  54. Stat.Size = UDim2.new(0,14,0,14)
  55. Stat.AutoButtonColor = false
  56. Stat.BackgroundTransparency = 1
  57. Stat.ImageColor3 = libraryColours.Status
  58. Stat.Image = "http://www.roblox.com/asset/?id=71659683"
  59. Stat.Rotation = -90
  60. return Stat
  61. end
  62.  
  63. local function Label(text)
  64. local NewLabel = Instance.new("TextLabel")
  65. NewLabel.Text = text
  66. NewLabel.BackgroundTransparency = 1
  67. NewLabel.Position = UDim2.new(0, 0, 0, 0)
  68. return NewLabel
  69. end
  70.  
  71. local function Button(text)
  72. local NewLabel = Instance.new("TextButton")
  73. NewLabel.AutoButtonColor = false
  74. NewLabel.Text = text
  75. NewLabel.BackgroundTransparency = 1
  76. NewLabel.Position = UDim2.new(0, 0, 0, 0)
  77. return NewLabel
  78. end
  79.  
  80. local function GetUUID()
  81. local NewUUID = HttpService:GenerateGUID(false)
  82. return NewUUID
  83. end
  84.  
  85. local function Gui(bool)
  86. local NewGui = Instance.new("ScreenGui")
  87. NewGui.ResetOnSpawn = bool or false
  88. return NewGui
  89. end
  90.  
  91. local function Frame()
  92. local NewFrame = Instance.new("Frame")
  93. NewFrame.BorderSizePixel = 0
  94. return NewFrame
  95. end
  96.  
  97. local function List()
  98. local NewList = Instance.new("UIListLayout")
  99. return NewList
  100. end
  101.  
  102. local function Click()
  103. local ClickImage = Instance.new("ImageLabel")
  104. ClickImage.Size = UDim2.new(0,14,0,14)
  105. ClickImage.Image = "http://www.roblox.com/asset/?id=4941650889"
  106. ClickImage.BackgroundTransparency = 1
  107. return ClickImage
  108. end
  109.  
  110. local function CheckBox()
  111. local Checker = Instance.new("ImageLabel")
  112. Checker.Size = UDim2.new(1,-8,1,-8)
  113. Checker.Position = UDim2.new(0,4,0,4)
  114. Checker.ImageColor3 = libraryColours.Primary
  115. Checker.BackgroundTransparency = 1
  116. Checker.Image = "http://www.roblox.com/asset/?id=4941544626"
  117. return Checker
  118. end
  119.  
  120. local wrap = function(func)
  121. coroutine.wrap(func)()
  122. end
  123.  
  124. local CircleAnim = function(guiObject)
  125. local ncircle = Instance.new("ImageLabel")
  126. ncircle.BackgroundTransparency = 1
  127. ncircle.Image = "http://www.roblox.com/asset/?id=87913710"
  128. ncircle.Parent = guiObject
  129. ncircle.ImageColor3 = libraryColours.Black
  130. wrap(function()
  131. local x, y = RelativeXY(guiObject)
  132. for i = 1, 50, 1 do
  133. ncircle.Size = UDim2.new(0, i, 0, i)
  134. ncircle.Position = UDim2.new(0, x - i / 2, 0, y - i / 2)
  135. ncircle.ImageTransparency = i / 50
  136. RunService.Heartbeat:Wait()
  137. end
  138. ncircle:Destroy()
  139. end)
  140. return ncircle
  141. end
  142.  
  143. local function Circle()
  144. local CircleImg = Instance.new("ImageLabel")
  145. CircleImg.Image = "http://www.roblox.com/asset/?id=87913710"
  146. CircleImg.Size = UDim2.new(0,12,0,12)
  147. CircleImg.BackgroundTransparency = 1
  148. return CircleImg
  149. end
  150.  
  151. local SSB = Enum.Font.SourceSansBold
  152. local SS = Enum.Font.SourceSans
  153. local GB = Enum.Font.GothamBlack
  154.  
  155. local Left = Enum.TextXAlignment.Left
  156. local Center = Enum.TextXAlignment.Center
  157. local Right = Enum.TextXAlignment.Right
  158.  
  159. local ContainerPadding = 7
  160.  
  161. local OldInstance
  162.  
  163. function library:Init(parent)
  164. local parent = parent or game.Players.LocalPlayer.PlayerGui
  165.  
  166. if OldInstance then
  167. OldInstance:Destroy()
  168. end
  169.  
  170. local tabcount = 0
  171.  
  172. local newgui = Gui(false)
  173. newgui.Name = GetUUID()
  174. newgui.Parent = parent
  175.  
  176. OldInstance = newgui
  177.  
  178. print(OldInstance, newgui)
  179.  
  180. local optionLibrary = {}
  181.  
  182. function optionLibrary:AddTab(tabtitle)
  183. local toggle = true
  184.  
  185. local containerframe = Instance.new("Frame")
  186. containerframe.Name = "ContainerFrame"
  187. containerframe.Size = UDim2.new(0,170,1,0)
  188. containerframe.Position = UDim2.new(0,5 + (175 * tabcount),0,5)
  189. containerframe.BackgroundTransparency = 1
  190. containerframe.Parent = newgui
  191.  
  192. local tabtitle = tabtitle or ("Tab"..tostring(tabcount))
  193.  
  194. tabcount = tabcount + 1
  195.  
  196. local mainlabel = RoundBox()
  197. mainlabel.ImageColor3 = libraryColours.Main
  198. mainlabel.Size = UDim2.new(1,0,0,40)
  199. mainlabel.Parent = containerframe
  200.  
  201. local titlebar = Button(tabtitle)
  202. titlebar.Size = UDim2.new(1,0,0,40)
  203. titlebar.Font = Enum.Font.SourceSansBold
  204. titlebar.TextSize = 18
  205. titlebar.TextColor3 = libraryColours.White
  206. titlebar.Parent = mainlabel
  207.  
  208. local contentframe = RoundBox()
  209. contentframe.Size = UDim2.new(1,0,0,0)
  210. contentframe.Position = UDim2.new(0,0,0,40)
  211. contentframe.ImageColor3 = libraryColours.Primary
  212. contentframe.ClipsDescendants = true
  213. contentframe.Parent = containerframe
  214.  
  215. local togglebutton = Status()
  216. togglebutton.Position = UDim2.new(1,-22,0.5,-7)
  217. togglebutton.Rotation = 90
  218. togglebutton.Parent = titlebar
  219.  
  220. local contentlist = List()
  221. contentlist.Parent = contentframe
  222.  
  223. coroutine.wrap(function()
  224. local lastmx
  225. local lastmy
  226.  
  227. titlebar.MouseButton1Down:Connect(function()
  228. lastmx = Mouse.X
  229. lastmy = Mouse.Y
  230. local move
  231. local kill
  232. move = Mouse.Move:Connect(function()
  233. local dx = Mouse.X - lastmx
  234. local dy = Mouse.Y - lastmy
  235. containerframe.Position = containerframe.Position + UDim2.new(0,dx,0,dy)
  236. lastmx = Mouse.X
  237. lastmy = Mouse.Y
  238. end)
  239. kill = InputService.InputEnded:Connect(function(input)
  240. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  241. move:Disconnect()
  242. kill:Disconnect()
  243. end
  244. end)
  245. end)
  246. end)()
  247.  
  248. togglebutton.MouseButton1Click:Connect(function()
  249. toggle = not toggle
  250. if not toggle then
  251. contentframe:TweenSize(UDim2.new(1,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  252. mainlabel:TweenSize(UDim2.new(1,0,0,40), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  253. TweenService:Create(togglebutton, TweenInfo.new(0.1), {Rotation = -90}):Play()
  254. else
  255. mainlabel:TweenSize(UDim2.new(1,0,0,47+contentlist.AbsoluteContentSize.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  256. contentframe:TweenSize(UDim2.new(1,0,0,7+contentlist.AbsoluteContentSize.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  257. TweenService:Create(togglebutton, TweenInfo.new(0.1), {Rotation = 90}):Play()
  258. end
  259. end)
  260.  
  261. contentlist:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  262. if toggle then
  263. mainlabel:TweenSize(UDim2.new(1,0,0,47+contentlist.AbsoluteContentSize.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  264. contentframe:TweenSize(UDim2.new(1,0,0,7+contentlist.AbsoluteContentSize.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  265. end
  266. end)
  267.  
  268. local sectioncount = 0
  269.  
  270. local tabLibrary = {}
  271.  
  272. function tabLibrary:AddSection(title)
  273. local sectoggle = true
  274. local title = title or ("Section"..tostring(sectioncount))
  275.  
  276. sectioncount = sectioncount + 1
  277.  
  278. local sectionframe = Frame()
  279. sectionframe.BackgroundColor3 = libraryColours.Primary
  280. sectionframe.Size = UDim2.new(1,0,0,28)
  281. sectionframe.Parent = contentframe
  282.  
  283. local sectiontitle = Label(" "..title)
  284. sectiontitle.Size = UDim2.new(1,0,0,28)
  285. sectiontitle.Font = Enum.Font.GothamBlack
  286. sectiontitle.TextColor3 = libraryColours.OffWhite
  287. sectiontitle.TextSize = 14
  288. sectiontitle.TextXAlignment = Left
  289. sectiontitle.Parent = sectionframe
  290.  
  291. local sectioncontent = Frame()
  292. sectioncontent.Size = UDim2.new(1,0,0,0)
  293. sectioncontent.Position = UDim2.new(0,0,0,28)
  294. sectioncontent.BackgroundColor3 = libraryColours.Secondary
  295. sectioncontent.ClipsDescendants = true
  296. sectioncontent.Parent = sectionframe
  297.  
  298. local sectioncontentlist = List()
  299. sectioncontentlist.Parent = sectioncontent
  300.  
  301. local secstatus = Status()
  302. secstatus.Position = UDim2.new(1,-21,0,7)
  303. secstatus.Rotation = 90
  304. secstatus.Parent = sectiontitle
  305.  
  306. sectioncontentlist:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  307. if sectoggle then
  308. sectioncontent:TweenSize(UDim2.new(1,0,0,sectioncontentlist.AbsoluteContentSize.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  309. sectionframe:TweenSize(UDim2.new(1,0,0,28+sectioncontentlist.AbsoluteContentSize.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  310. end
  311. end)
  312.  
  313. secstatus.MouseButton1Click:Connect(function()
  314. sectoggle = not sectoggle
  315. if not sectoggle then
  316. sectioncontent:TweenSize(UDim2.new(1,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  317. sectionframe:TweenSize(UDim2.new(1,0,0,28), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  318. TweenService:Create(secstatus, TweenInfo.new(0.1), {Rotation = -90}):Play()
  319. else
  320. sectioncontent:TweenSize(UDim2.new(1,0,0,sectioncontentlist.AbsoluteContentSize.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  321. sectionframe:TweenSize(UDim2.new(1,0,0,28+sectioncontentlist.AbsoluteContentSize.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  322. TweenService:Create(secstatus, TweenInfo.new(0.1), {Rotation = 90}):Play()
  323. end
  324. end)
  325.  
  326. local sectionLibrary = {}
  327.  
  328. function sectionLibrary:AddButton(text, callback)
  329. local buttoncontainer = Frame()
  330. buttoncontainer.Size = UDim2.new(1,0,0,32)
  331. buttoncontainer.BackgroundColor3 = libraryColours.Secondary
  332. buttoncontainer.Parent = sectioncontent
  333.  
  334. local imagebutton = RoundButton()
  335. imagebutton.ImageColor3 = libraryColours.Accents
  336. imagebutton.Size = UDim2.new(1,-10,1,-10)
  337. imagebutton.Position = UDim2.new(0,5,0,5)
  338. imagebutton.ClipsDescendants = true
  339. imagebutton.Parent = buttoncontainer
  340.  
  341. local clickimage = Click()
  342. clickimage.Position = UDim2.new(0,4,0,4)
  343. clickimage.ImageColor3 = libraryColours.Black
  344. clickimage.Parent = imagebutton
  345.  
  346. local buttonlabel = Label(text or "Button")
  347. buttonlabel.Size = UDim2.new(1,0,1,0)
  348. buttonlabel.Font = Enum.Font.SourceSansBold
  349. buttonlabel.Text = text or "Button"
  350. buttonlabel.TextColor3 = libraryColours.Black
  351. buttonlabel.TextSize = 18
  352. buttonlabel.Parent = imagebutton
  353.  
  354. imagebutton.MouseButton1Click:Connect(function()
  355. callback()
  356. CircleAnim(imagebutton)
  357. end)
  358. end
  359.  
  360. function sectionLibrary:AddSlider(text, default, callback)
  361. local min = default.min or default.Min or 16
  362. local max = default.max or default.Max or 64
  363. local def = default.def or default.Def or math.floor((min + max) / 2)
  364. local defsca = (def - min)/(max - min)
  365.  
  366. local slidercontainer = Frame()
  367. slidercontainer.Size = UDim2.new(1,0,0,40)
  368. slidercontainer.BackgroundColor3 = libraryColours.Secondary
  369. slidercontainer.Parent = sectioncontent
  370.  
  371. local slidertitle = Label(text)
  372. slidertitle.Size = UDim2.new(1,-30,0,28)
  373. slidertitle.Font = Enum.Font.SourceSansBold
  374. slidertitle.TextColor3 = libraryColours.Text
  375. slidertitle.Text = (" ".. text)
  376. slidertitle.TextXAlignment = Left
  377. slidertitle.TextSize = 16
  378. slidertitle.Parent = slidercontainer
  379.  
  380. local valuecontainer = RoundBox()
  381. valuecontainer.Size = UDim2.new(0,32,0,16)
  382. valuecontainer.Position = UDim2.new(1,-36,0,6)
  383. valuecontainer.ImageColor3 = libraryColours.Status
  384. valuecontainer.Parent = slidercontainer
  385.  
  386. local valuelabel = Label(def)
  387. valuelabel.Size = UDim2.new(1,0,1,0)
  388. valuelabel.Font = Enum.Font.SourceSansBold
  389. valuelabel.TextSize = 13
  390. valuelabel.TextColor3 = libraryColours.Text
  391. valuelabel.Parent = valuecontainer
  392.  
  393. local sliderframe = Frame()
  394. sliderframe.BackgroundTransparency = 1
  395. sliderframe.Position = UDim2.new(0,0,1,-12)
  396. sliderframe.Size = UDim2.new(1,0,0,12)
  397. sliderframe.Parent = slidercontainer
  398.  
  399. local sliderbutton = RoundButton()
  400. sliderbutton.Position = UDim2.new(0,5,0,1)
  401. sliderbutton.Size = UDim2.new(1,-10,0,4)
  402. sliderbutton.ImageColor3 = libraryColours.Status
  403. sliderbutton.Parent = sliderframe
  404.  
  405. local sliderfill = RoundBox()
  406. sliderfill.ImageColor3 = libraryColours.Accents
  407. sliderfill.Size = UDim2.new(defsca,0,1,0)
  408. sliderfill.Parent = sliderbutton
  409.  
  410. local slidercircle = Circle()
  411. slidercircle.Position = UDim2.new(1,-10,0.5,-10)
  412. slidercircle.Size = UDim2.new(0,20,0,20)
  413. slidercircle.ImageColor3 = libraryColours.Accents
  414. slidercircle.ImageTransparency = 1
  415. slidercircle.Parent = sliderfill
  416.  
  417. local circlefill = Circle()
  418. circlefill.ImageColor3 = libraryColours.White
  419. circlefill.Size = UDim2.new(0,12,0,12)
  420. circlefill.Position = UDim2.new(0.5,-6,0.5,-6)
  421. circlefill.ImageTransparency = 1
  422. circlefill.Parent = slidercircle
  423.  
  424. sliderbutton.MouseButton1Down:Connect(function()
  425. local x,y,xscale,yscale = RelativeXY(sliderbutton)
  426. local value = math.floor(min + ((max - min) * xscale))
  427. valuelabel.Text = value
  428. sliderfill.Size = UDim2.new(xscale,0,1,0)
  429. callback(value)
  430. local move
  431. local kill
  432. TweenService:Create(slidercircle, TweenInfo.new(0.5), {ImageTransparency = 0.5}):Play()
  433. TweenService:Create(circlefill, TweenInfo.new(0.5), {ImageTransparency = 0}):Play()
  434. move = Mouse.Move:Connect(function()
  435. local x,y,xscale,yscale = RelativeXY(sliderbutton)
  436. local value = math.floor(min + ((max - min) * xscale))
  437. valuelabel.Text = value
  438. sliderfill.Size = UDim2.new(xscale,0,1,0)
  439. callback(value)
  440. end)
  441. kill = InputService.InputEnded:Connect(function(input)
  442. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  443. move:Disconnect()
  444. kill:Disconnect()
  445. TweenService:Create(slidercircle, TweenInfo.new(0.5), {ImageTransparency = 1}):Play()
  446. TweenService:Create(circlefill, TweenInfo.new(0.5), {ImageTransparency = 1}):Play()
  447. end
  448. end)
  449. end)
  450. end
  451.  
  452. function sectionLibrary:AddKeybind(text, default, callback)
  453. local def = default
  454. local changing = false
  455.  
  456. local keybindcontainer = Frame()
  457. keybindcontainer.BackgroundColor3 = libraryColours.Secondary
  458. keybindcontainer.Size = UDim2.new(1,0,0,28)
  459. keybindcontainer.Parent = sectioncontent
  460.  
  461. local keybindlabel = Button(" "..text)
  462. keybindlabel.TextColor3 = libraryColours.Text
  463. keybindlabel.TextSize = 16
  464. keybindlabel.Font = Enum.Font.SourceSansBold
  465. keybindlabel.TextXAlignment = Left
  466. keybindlabel.Size = UDim2.new(1,-30,0,28)
  467. keybindlabel.Parent = keybindcontainer
  468.  
  469. local valuecontainer = RoundBox()
  470. valuecontainer.Position = UDim2.new(1,-36,0,6)
  471. valuecontainer.Size = UDim2.new(0,32,0,16)
  472. valuecontainer.ImageColor3 = libraryColours.Status
  473. valuecontainer.Parent = keybindcontainer
  474.  
  475. local valuelabel = Label(string.char(def.Value):upper() or "None")
  476. valuelabel.Size = UDim2.new(1,0,1,0)
  477. valuelabel.Font = Enum.Font.SourceSansBold
  478. valuelabel.TextColor3 = libraryColours.Text
  479. valuelabel.TextSize = 13
  480. valuelabel.Parent = valuecontainer
  481.  
  482. InputService.InputBegan:Connect(function(input)
  483. if input.UserInputType == Enum.UserInputType.Keyboard then
  484. if input.KeyCode.Value == def.Value then
  485. if not changing then
  486. callback()
  487. end
  488. end
  489. end
  490. end)
  491.  
  492. keybindlabel.MouseButton1Down:Connect(function()
  493. valuelabel.Text = "..."
  494. local detect
  495. detect = InputService.InputBegan:Connect(function(input)
  496. if input.UserInputType == Enum.UserInputType.Keyboard then
  497. local key = input.KeyCode
  498. local keyasstring = string.char(key.Value)
  499. local control = string.find(keyasstring, "%c")
  500. if not control then
  501. valuelabel.Text = keyasstring:upper()
  502. changing = true
  503. def = key
  504. wait()
  505. changing = false
  506. else
  507. valuelabel.Text = string.char(def.Value):upper()
  508. end
  509. detect:Disconnect()
  510. end
  511. end)
  512. end)
  513. end
  514.  
  515. function sectionLibrary:AddToggle(text, default, callback)
  516. local thistoggle = default
  517.  
  518. local togglecontainer = Frame()
  519. togglecontainer.Size = UDim2.new(1,0,0,28)
  520. togglecontainer.BackgroundColor3 = libraryColours.Secondary
  521. togglecontainer.Parent = sectioncontent
  522.  
  523. local toggletracker = RoundBox()
  524. toggletracker.Size = UDim2.new(0,18,0,18)
  525. toggletracker.Position = UDim2.new(1,-23,0,5)
  526. toggletracker.ImageColor3 = libraryColours.Status
  527. toggletracker.Parent = togglecontainer
  528.  
  529. local togglecolour = RoundBox()
  530. togglecolour.ImageColor3 = thistoggle and libraryColours.Accents or libraryColours.Secondary
  531. togglecolour.Size = thistoggle and UDim2.new(1,0,1,0) or UDim2.new(0,14,0,14)
  532. togglecolour.Position = thistoggle and UDim2.new(0,0,0,0) or UDim2.new(0,2,0,2)
  533. togglecolour.Parent = toggletracker
  534.  
  535. local togglechecker = CheckBox()
  536. togglechecker.ImageTransparency = thistoggle and 0 or 1
  537. togglechecker.Parent = togglecolour
  538.  
  539. local togglebutton = Button(text or "Toggle")
  540. togglebutton.Size = UDim2.new(1,-30,1,0)
  541. togglebutton.Font = Enum.Font.SourceSansBold
  542. togglebutton.Text = (" "..text) or (" Toggle")
  543. togglebutton.TextXAlignment = Left
  544. togglebutton.TextColor3 = libraryColours.Text
  545. togglebutton.TextSize = 16
  546. togglebutton.Parent = togglecontainer
  547.  
  548. togglebutton.MouseButton1Click:Connect(function()
  549. thistoggle = not thistoggle
  550. if not thistoggle then
  551. togglecolour:TweenSizeAndPosition(UDim2.new(0,14,0,14), UDim2.new(0,2,0,2), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  552. TweenService:Create(togglecolour, TweenInfo.new(0.1), {ImageColor3 = libraryColours.Secondary}):Play()
  553. TweenService:Create(togglechecker, TweenInfo.new(0.1), {ImageTransparency = 1}):Play()
  554. else
  555. togglecolour:TweenSizeAndPosition(UDim2.new(1,0,1,0), UDim2.new(0,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  556. TweenService:Create(togglecolour, TweenInfo.new(0.1), {ImageColor3 = libraryColours.Accents}):Play()
  557. TweenService:Create(togglechecker, TweenInfo.new(0.1), {ImageTransparency = 0}):Play()
  558. end
  559. callback(thistoggle)
  560. end)
  561. end
  562.  
  563. return sectionLibrary
  564. end
  565.  
  566. return tabLibrary
  567. end
  568.  
  569. return optionLibrary
  570. end
  571.  
  572. return library
Add Comment
Please, Sign In to add comment