Advertisement
LeviTheOtaku

shitty library

Nov 11th, 2019
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.71 KB | None | 0 0
  1. local hs = game:GetService("HttpService")
  2. local ts = game:GetService("TweenService")
  3. local lib = {tabs = {}, content = {}}
  4. local libholder = Instance.new("ScreenGui", game.CoreGui)
  5. libholder.Name = "LibHolder"
  6.  
  7. function lib:CreateTab(json)
  8. local tabContent = {contents = 0}
  9. local id = hs:JSONDecode(json).id
  10. local text = hs:JSONDecode(json).text
  11. local colorRGB =  hs:JSONDecode(json).colorRGB
  12. table.insert(lib.tabs, id, tabContent)
  13. local Tab = Instance.new("Frame")
  14. local TabLabel = Instance.new("TextLabel")
  15. local TabLabelShadow = Instance.new("TextLabel")
  16. local ShowButton = Instance.new("TextButton")
  17. local ShowButtonShadow = Instance.new("TextLabel")
  18.  
  19. Tab.Name = "Tab"
  20. Tab.Parent = libholder
  21. Tab.BackgroundColor3 = Color3.fromRGB(colorRGB.r, colorRGB.g, colorRGB.b)
  22. Tab.BackgroundTransparency = 0.4
  23. Tab.BorderSizePixel = 0
  24. Tab.Position = UDim2.new(0, 30 + (230*#lib.tabs), 0, 30)
  25. Tab.Size = UDim2.new(0, 200, 0, 30)
  26.  
  27. TabLabel.Name = "TabLabel"
  28. TabLabel.Parent = Tab
  29. TabLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  30. TabLabel.BackgroundTransparency = 1
  31. TabLabel.BorderSizePixel = 0
  32. TabLabel.Size = UDim2.new(1, 0, 1, 0)
  33. TabLabel.ZIndex = 3
  34. TabLabel.Font = Enum.Font.SourceSans
  35. TabLabel.FontSize = Enum.FontSize.Size24
  36. TabLabel.TextColor3 = Color3.new(1, 1, 1)
  37. TabLabel.TextSize = 20
  38. TabLabel.TextWrapped = true
  39. TabLabel.Text = text
  40.  
  41. TabLabelShadow.Name = "TabLabelShadow"
  42. TabLabelShadow.Parent = Tab
  43. TabLabelShadow.BackgroundColor3 = Color3.new(1, 1, 1)
  44. TabLabelShadow.BackgroundTransparency = 1
  45. TabLabelShadow.BorderSizePixel = 0
  46. TabLabelShadow.Position = UDim2.new(0, 1, 0, 1)
  47. TabLabelShadow.Size = UDim2.new(1, 0, 1, 0)
  48. TabLabelShadow.Font = Enum.Font.SourceSans
  49. TabLabelShadow.FontSize = Enum.FontSize.Size24
  50. TabLabelShadow.TextColor3 = Color3.new(0, 0, 0)
  51. TabLabelShadow.TextSize = 20
  52. TabLabelShadow.TextWrapped = true
  53. TabLabelShadow.Text = text
  54.  
  55. ShowButton.Name = "ShowButton"
  56. ShowButton.Parent = Tab
  57. ShowButton.BackgroundColor3 = Color3.new(1, 1, 1)
  58. ShowButton.BackgroundTransparency = 1
  59. ShowButton.BorderSizePixel = 0
  60. ShowButton.Position = UDim2.new(0.8, 0, 0, 0)
  61. ShowButton.Size = UDim2.new(0.2, 0, 1, 0)
  62. ShowButton.ZIndex = 2
  63. ShowButton.Font = Enum.Font.SourceSans
  64. ShowButton.FontSize = Enum.FontSize.Size24
  65. ShowButton.Text = "V"
  66. ShowButton.TextColor3 = Color3.new(1, 1, 1)
  67. ShowButton.TextSize = 20
  68.  
  69. ShowButtonShadow.Name = "ShowButtonShadow"
  70. ShowButtonShadow.Parent = Tab
  71. ShowButtonShadow.BackgroundColor3 = Color3.new(1, 1, 1)
  72. ShowButtonShadow.BackgroundTransparency = 1
  73. ShowButtonShadow.BorderSizePixel = 0
  74. ShowButtonShadow.Position = UDim2.new(0.8, 1, 0, 1)
  75. ShowButtonShadow.Size = UDim2.new(0.2, 0, 1, 0)
  76. ShowButtonShadow.Font = Enum.Font.SourceSans
  77. ShowButtonShadow.FontSize = Enum.FontSize.Size24
  78. ShowButtonShadow.Text = "V"
  79. ShowButtonShadow.TextColor3 = Color3.new(0, 0, 0)
  80. ShowButtonShadow.TextSize = 20
  81. ShowButtonShadow.TextWrapped = true
  82.  
  83. local content = Instance.new("Folder", Tab)
  84. content.Name = "Content"
  85.  
  86. local deb = false
  87. ShowButton.MouseButton1Down:connect(function()
  88. if deb == false then
  89. deb = true
  90.  
  91.  
  92. for i=1,10 do
  93. ShowButton.TextTransparency = i/10
  94. ShowButtonShadow.TextTransparency = i/10
  95. wait()
  96. end
  97. if ShowButton.Rotation == 180 then
  98. ShowButton.Rotation = 0
  99. ShowButtonShadow.Rotation = 0
  100. else
  101. ShowButton.Rotation = 180
  102. ShowButtonShadow.Rotation = 180
  103. end
  104.  
  105. for i=0,#content:GetChildren() do
  106. if content:GetChildren()[#content:GetChildren()-i] ~= nil then
  107. if content:GetChildren()[#content:GetChildren()-i].Size == UDim2.new(1,0,1,0) then
  108. content:GetChildren()[#content:GetChildren()-i]:TweenSize(UDim2.new(0,0,1,0),nil,nil,1)
  109. wait(0.2)
  110. else
  111. if content:GetChildren()[i+1] ~= nil then
  112. content:GetChildren()[i+1]:TweenSize(UDim2.new(1,0,1,0),nil,nil,1)
  113. wait(0.2)
  114. end
  115. end
  116. end
  117. end
  118.  
  119. for i=-10,-1 do
  120. ShowButton.TextTransparency = (i/10)*-1
  121. ShowButtonShadow.TextTransparency = (i/10)*-1
  122. wait()
  123. end
  124. wait(0.2)
  125. deb = false
  126. end
  127. end)
  128.  
  129. local mouseon = false
  130. Tab.MouseEnter:connect(function()
  131. mouseon = true
  132. end)
  133. Tab.MouseLeave:connect(function()
  134. mouseon = false
  135. end)
  136.  
  137. local mouse = game.Players.LocalPlayer:GetMouse()
  138. local mousedown = false
  139. mouse.Button1Down:connect(function()
  140. if mouseon == true then
  141. mousedown = true
  142. end
  143. end)
  144. mouse.Button1Up:connect(function()
  145. mousedown = false
  146. end)
  147.  
  148. spawn(function()
  149. while true do
  150. if mousedown == true then
  151. local mousepos = Vector2.new(mouse.X, mouse.Y)
  152. local size = Tab.AbsoluteSize / 2
  153. local goal = UDim2.new(0, mousepos.X-size.X, 0, mousepos.Y-size.Y)
  154. Tab:TweenPosition(goal,nil,Enum.EasingStyle.Quad,nil,0.05)
  155. end
  156. wait(.1)
  157. end
  158. end)
  159.  
  160.  
  161. function tabContent:CreateButton(text, func)
  162. if func == nil then
  163. func = function()
  164. print("no func added.")
  165. end
  166. end
  167. tabContent.contents = tabContent.contents+1
  168. local Button = Instance.new("Frame")
  169. local TextButton = Instance.new("TextButton")
  170. Button.Name = "Button"
  171. Button.Parent = content
  172. Button.BackgroundColor3 = Color3.new(0, 0, 0)
  173. Button.BackgroundTransparency = 0.5
  174. Button.BorderSizePixel = 0
  175. Button.Position = UDim2.new(0, 0, tabContent.contents, 0)
  176. Button.Size = UDim2.new(1, 0, 1, 0)
  177.  
  178. TextButton.Parent = Button
  179. TextButton.BackgroundColor3 = Color3.new(0, 0, 0)
  180. TextButton.BackgroundTransparency = 0.5
  181. TextButton.BorderSizePixel = 0
  182. TextButton.Position = UDim2.new(0.05, 0, 0.125, 0)
  183. TextButton.Size = UDim2.new(0.9, 0, 0.75, 0)
  184. TextButton.ZIndex = 2
  185. TextButton.Font = Enum.Font.SourceSans
  186. TextButton.FontSize = Enum.FontSize.Size24
  187. TextButton.Text = text
  188. TextButton.TextColor3 = Color3.new(1, 1, 1)
  189. TextButton.TextSize = 20
  190. TextButton.TextWrapped = true
  191.  
  192. TextButton.MouseButton1Down:connect(func)
  193. end
  194.  
  195. function tabContent:CreateTextBox(text, tbid)
  196. tabContent.contents = tabContent.contents+1
  197. local TextBox = Instance.new("Frame")
  198. local TabLabelShadow = Instance.new("TextLabel")
  199. local TabLabel = Instance.new("TextLabel")
  200. local TextBox_2 = Instance.new("TextBox")
  201.  
  202. TextBox.Name = "TextBox"
  203. TextBox.Parent = content
  204. TextBox.BackgroundColor3 = Color3.new(0, 0, 0)
  205. TextBox.BackgroundTransparency = 0.5
  206. TextBox.BorderSizePixel = 0
  207. TextBox.Position = UDim2.new(0, 0, tabContent.contents, 0)
  208. TextBox.Size = UDim2.new(1, 0, 1, 0)
  209.  
  210. TabLabelShadow.Name = "TabLabelShadow"
  211. TabLabelShadow.Parent = TextBox
  212. TabLabelShadow.BackgroundColor3 = Color3.new(1, 1, 1)
  213. TabLabelShadow.BackgroundTransparency = 1
  214. TabLabelShadow.BorderSizePixel = 0
  215. TabLabelShadow.Position = UDim2.new(0, 1, 0, 1)
  216. TabLabelShadow.Size = UDim2.new(0.6, 0, 1, 0)
  217. TabLabelShadow.Font = Enum.Font.SourceSans
  218. TabLabelShadow.FontSize = Enum.FontSize.Size24
  219. TabLabelShadow.TextColor3 = Color3.new(0, 0, 0)
  220. TabLabelShadow.TextSize = 20
  221. TabLabelShadow.TextWrapped = true
  222. TabLabelShadow.Text = text
  223.  
  224. TabLabel.Name = "TabLabel"
  225. TabLabel.Parent = TextBox
  226. TabLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  227. TabLabel.BackgroundTransparency = 1
  228. TabLabel.BorderSizePixel = 0
  229. TabLabel.Size = UDim2.new(0.6, 0, 1, 0)
  230. TabLabel.ZIndex = 2
  231. TabLabel.Font = Enum.Font.SourceSans
  232. TabLabel.FontSize = Enum.FontSize.Size24
  233. TabLabel.TextColor3 = Color3.new(1, 1, 1)
  234. TabLabel.TextSize = 20
  235. TabLabel.TextWrapped = true
  236. TabLabel.Text = text
  237.  
  238.  
  239. TextBox_2.Parent = TextBox
  240. TextBox_2.BackgroundColor3 = Color3.new(0, 0, 0)
  241. TextBox_2.BackgroundTransparency = 0.5
  242. TextBox_2.BorderSizePixel = 0
  243. TextBox_2.Position = UDim2.new(0.65, 0, 0.125, 0)
  244. TextBox_2.Size = UDim2.new(0.3, 0, 0.75, 0)
  245. TextBox_2.Font = Enum.Font.SourceSans
  246. TextBox_2.FontSize = Enum.FontSize.Size24
  247. TextBox_2.Text = "1234"
  248. TextBox_2.TextColor3 = Color3.new(1, 1, 1)
  249. TextBox_2.TextSize = 20
  250. TextBox_2.TextWrapped = true
  251.  
  252. TextBox_2.FocusLost:connect(function()
  253. if lib.content[tbid] ~= nil then
  254. table.remove(lib.content, tbid)
  255. end
  256. table.insert(lib.content, tbid, TextBox_2.Text)
  257. end)
  258. end
  259.  
  260.  
  261. function tabContent:CreateToggle(text, tbid)
  262. tabContent.contents = tabContent.contents+1
  263. local Toggle = Instance.new("Frame")
  264. local TabLabelShadow = Instance.new("TextLabel")
  265. local TabLabel = Instance.new("TextLabel")
  266. local TextButton = Instance.new("TextButton")
  267.  
  268. Toggle.Name = "Toggle"
  269. Toggle.Parent = content
  270. Toggle.BackgroundColor3 = Color3.new(0, 0, 0)
  271. Toggle.BackgroundTransparency = 0.5
  272. Toggle.BorderSizePixel = 0
  273. Toggle.Position = UDim2.new(0, 0, tabContent.contents, 0)
  274. Toggle.Size = UDim2.new(1, 0, 1, 0)
  275.  
  276. TabLabelShadow.Name = "TabLabelShadow"
  277. TabLabelShadow.Parent = Toggle
  278. TabLabelShadow.BackgroundColor3 = Color3.new(1, 1, 1)
  279. TabLabelShadow.BackgroundTransparency = 1
  280. TabLabelShadow.BorderSizePixel = 0
  281. TabLabelShadow.Position = UDim2.new(0, 1, 0, 1)
  282. TabLabelShadow.Size = UDim2.new(0.7, 0, 1, 0)
  283. TabLabelShadow.Font = Enum.Font.SourceSans
  284. TabLabelShadow.FontSize = Enum.FontSize.Size24
  285. TabLabelShadow.TextColor3 = Color3.new(0, 0, 0)
  286. TabLabelShadow.TextSize = 20
  287. TabLabelShadow.TextWrapped = true
  288.  
  289. TabLabel.Name = "TabLabel"
  290. TabLabel.Parent = Toggle
  291. TabLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  292. TabLabel.BackgroundTransparency = 1
  293. TabLabel.BorderSizePixel = 0
  294. TabLabel.Size = UDim2.new(0.7, 0, 1, 0)
  295. TabLabel.ZIndex = 2
  296. TabLabel.Font = Enum.Font.SourceSans
  297. TabLabel.FontSize = Enum.FontSize.Size24
  298. TabLabel.TextColor3 = Color3.new(1, 1, 1)
  299. TabLabel.TextSize = 20
  300. TabLabel.TextWrapped = true
  301.  
  302. TextButton.Parent = Toggle
  303. TextButton.BackgroundColor3 = Color3.new(1, 0, 0)
  304. TextButton.BackgroundTransparency = 0.5
  305. TextButton.BorderSizePixel = 0
  306. TextButton.Position = UDim2.new(0.75, 0, 0.125, 0)
  307. TextButton.Size = UDim2.new(0.2, 0, 0.75, 0)
  308. TextButton.ZIndex = 2
  309. TextButton.Font = Enum.Font.SourceSans
  310. TextButton.FontSize = Enum.FontSize.Size24
  311. TextButton.Text = "OFF"
  312. TextButton.TextColor3 = Color3.new(1, 1, 1)
  313. TextButton.TextSize = 20
  314. TextButton.TextWrapped = true
  315.  
  316. table.insert(lib.content, tbid, false)
  317. TextButton.MouseButton1Down:connect(function()
  318. if TextButton.Text == "OFF" then
  319. TextButton.Text = "ON"
  320. TextButton.BackgroundColor3 = Color3.new(0, 1, 0)
  321. if lib.content[tbid] ~= nil then
  322. table.remove(lib.content, tbid)
  323. end
  324. table.insert(lib.content, tbid, true)
  325. else
  326. TextButton.Text = "OFF"
  327. TextButton.BackgroundColor3 = Color3.new(1, 0, 0)
  328. if lib.content[tbid] ~= nil then
  329. table.remove(lib.content, tbid)
  330. end
  331. table.insert(lib.content, tbid, false)
  332. end
  333. end)
  334. end
  335. --[[
  336. function tabContent:CreateKeybind(text, func)
  337. local keybindgoal = nil
  338. local lastpressed = nil
  339. tabContent.contents = tabContent.contents+1
  340. if func == nil then
  341. func = function()
  342. print("no func added.")
  343. end
  344. end
  345. local Keybind = Instance.new("Frame")
  346. local TabLabelShadow = Instance.new("TextLabel")
  347. local TabLabel = Instance.new("TextLabel")
  348. local TextButton = Instance.new("TextButton")
  349.  
  350. Keybind.Name = "Keybind"
  351. Keybind.Parent = content
  352. Keybind.BackgroundColor3 = Color3.new(0, 0, 0)
  353. Keybind.BackgroundTransparency = 0.5
  354. Keybind.BorderSizePixel = 0
  355. Keybind.Position = UDim2.new(0, 0, tabContent.contents, 0)
  356. Keybind.Size = UDim2.new(1, 0, 1, 0)
  357.  
  358. TabLabelShadow.Name = "TabLabelShadow"
  359. TabLabelShadow.Parent = Keybind
  360. TabLabelShadow.BackgroundColor3 = Color3.new(1, 1, 1)
  361. TabLabelShadow.BackgroundTransparency = 1
  362. TabLabelShadow.BorderSizePixel = 0
  363. TabLabelShadow.Position = UDim2.new(0, 1, 0, 1)
  364. TabLabelShadow.Size = UDim2.new(0.7, 0, 1, 0)
  365. TabLabelShadow.Font = Enum.Font.SourceSans
  366. TabLabelShadow.FontSize = Enum.FontSize.Size24
  367. TabLabelShadow.TextColor3 = Color3.new(0, 0, 0)
  368. TabLabelShadow.TextSize = 20
  369. TabLabelShadow.TextWrapped = true
  370.  
  371. TabLabel.Name = "TabLabel"
  372. TabLabel.Parent = Keybind
  373. TabLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  374. TabLabel.BackgroundTransparency = 1
  375. TabLabel.BorderSizePixel = 0
  376. TabLabel.Size = UDim2.new(0.7, 0, 1, 0)
  377. TabLabel.ZIndex = 2
  378. TabLabel.Font = Enum.Font.SourceSans
  379. TabLabel.FontSize = Enum.FontSize.Size24
  380. TabLabel.TextColor3 = Color3.new(1, 1, 1)
  381. TabLabel.TextSize = 20
  382. TabLabel.TextWrapped = true
  383.  
  384. TextButton.Parent = Keybind
  385. TextButton.BackgroundColor3 = Color3.new(0, 0, 0)
  386. TextButton.BackgroundTransparency = 0.5
  387. TextButton.BorderSizePixel = 0
  388. TextButton.Position = UDim2.new(0.65, 0, 0.125, 0)
  389. TextButton.Size = UDim2.new(0.3, 0, 0.75, 0)
  390. TextButton.ZIndex = 2
  391. TextButton.Font = Enum.Font.SourceSans
  392. TextButton.FontSize = Enum.FontSize.Size24
  393. TextButton.Text = "LeftCtrl"
  394. TextButton.TextColor3 = Color3.new(1, 1, 1)
  395. TextButton.TextSize = 20
  396.  
  397. TextButton.MouseButton1Down:connect(function()
  398.  
  399. end)
  400. mouse.KeyDown:connect(function(key)
  401. lastpressed = key
  402. end)
  403. end
  404.  
  405. lib.tabs[63]:CreateKeybind("yes", function()
  406. print("testXD")
  407. end)
  408. --]]
  409. end
  410.  
  411. local test = [[
  412. {
  413.     "id": 63,
  414.     "text": "test123",
  415.     "colorRGB":
  416.         {
  417.             "r": 0,
  418.             "g": 0,
  419.             "b": 255
  420.        
  421.         }
  422. }
  423. ]]
  424.  
  425. local tab = lib:CreateTab(test)
  426.  
  427. lib.tabs[63]:CreateButton("print contents", function()
  428. print("textbox: " .. tostring(lib.content[33]))
  429. print("toggle: " .. tostring(lib.content[99]))
  430. end)
  431.  
  432. lib.tabs[63]:CreateTextBox("textbox", 33)
  433. print(lib.content[33])
  434.  
  435. lib.tabs[63]:CreateToggle("toggle", 99)
  436. print(lib.content[99])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement