Advertisement
HEHEJ

Untitled

Mar 20th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.11 KB | None | 0 0
  1. function randomName()
  2. local data = ""
  3. for i=0,20,1 do
  4. data = data .. tostring(string.char(math.ceil(math.random() * 254)))
  5. end
  6. return data
  7. end
  8.  
  9.  
  10. local uilib = Instance.new("ScreenGui")
  11. uilib.Name = randomName()
  12. uilib.Parent = game:GetService("CoreGui")
  13. uilib.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  14.  
  15.  
  16. local library = {}
  17.  
  18. local TweenService = game:GetService("TweenService")
  19. local uis = game:GetService("UserInputService")
  20. local tabcount = 0
  21. local rainbow = 0
  22. _G.breatherate = 0.005
  23. local color
  24. local rainbows = {}
  25. local buttoncount = {}
  26.  
  27.  
  28. function library:CreateTab(name, rainbow123, color123)
  29.  
  30. tabcount = tabcount+1
  31. buttoncount[tabcount] = 0
  32.  
  33.  
  34.  
  35. local topbar = Instance.new("Frame")
  36. local container = Instance.new("Frame")
  37. local UIListLayout = Instance.new("UIListLayout")
  38.  
  39. local bar1 = Instance.new("Frame")
  40. local title = Instance.new("TextLabel")
  41. local minimize = Instance.new("TextButton")
  42.  
  43.  
  44. topbar.Name = "topbar"
  45. topbar.Parent = uilib
  46. topbar.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  47. topbar.BorderSizePixel = 0
  48. topbar.Position = UDim2.new(0, (tabcount)*13+(tabcount-1)*200, 0.0128041022, 0)
  49. topbar.Size = UDim2.new(0, 200, 0, 30)
  50. topbar.Active = true
  51. topbar.Selectable = true
  52. topbar.Draggable = true
  53.  
  54. container.Name = "container"
  55. container.Parent = topbar
  56. container.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  57. container.BackgroundTransparency = 1.000
  58. container.BorderSizePixel = 0
  59. container.Position = UDim2.new(0, 2, 1, 0)
  60. container.Size = UDim2.new(1, -4, 0, 300)
  61. container.Visible = false
  62.  
  63. UIListLayout.Parent = container
  64. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  65.  
  66.  
  67.  
  68. bar1.Name = "bar1"
  69. bar1.Parent = topbar
  70. bar1.BorderSizePixel = 0
  71. bar1.Position = UDim2.new(0, 0, 1, -3)
  72. bar1.Size = UDim2.new(1, 0, 0, 3)
  73.  
  74. title.Name = "title"
  75. title.Parent = topbar
  76. title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  77. title.BackgroundTransparency = 1.000
  78. title.BorderSizePixel = 0
  79. title.Position = UDim2.new(0, 13, 0, 0)
  80. title.Size = UDim2.new(1.04999995, -40, 1, 0)
  81. title.Font = Enum.Font.SourceSans
  82. title.Text = name
  83. title.TextColor3 = Color3.fromRGB(255, 255, 255)
  84. title.TextSize = 16.000
  85. title.TextXAlignment = Enum.TextXAlignment.Left
  86.  
  87. minimize.Name = "minimize"
  88. minimize.Parent = topbar
  89. minimize.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  90. minimize.BackgroundTransparency = 1.000
  91. minimize.BorderColor3 = Color3.fromRGB(0, 0, 0)
  92. minimize.BorderSizePixel = 0
  93. minimize.Position = UDim2.new(0.857449114, 0, -0.00679995213, 0)
  94. minimize.Size = UDim2.new(0.140000001, 0, 0, 25)
  95. minimize.Font = Enum.Font.SourceSans
  96. minimize.Text = "+"
  97. minimize.TextColor3 = Color3.fromRGB(255, 255, 255)
  98. minimize.TextSize = 16.000
  99. minimize.MouseButton1Click:Connect(function()
  100. if container.Visible == true then
  101. container.Visible = false
  102. minimize.Text = "+"
  103.  
  104. elseif container.Visible == false then
  105. container.Visible = true
  106. minimize.Text = "-"
  107. end
  108. end)
  109.  
  110. game:GetService("RunService").RenderStepped:Connect(function()
  111. if rainbow123 == true then
  112. local r = (math.sin(workspace.DistributedGameTime/2)/2)+0.5
  113. local g = (math.sin(workspace.DistributedGameTime)/2)+0.5
  114. local b = (math.sin(workspace.DistributedGameTime*1.5)/2)+0.5
  115. local color = Color3.new(r, g, b)
  116. bar1.BackgroundColor3 = color
  117.  
  118.  
  119.  
  120. elseif rainbow123 == false then
  121. bar1.BackgroundColor3 = color123
  122. end
  123. end)
  124.  
  125.  
  126.  
  127. local GamerLibrary = {}
  128.  
  129. function GamerLibrary:CreateLabel(name)
  130. local label = Instance.new("TextLabel")
  131. label.Name = "label"
  132. label.Parent = container
  133. label.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  134. label.BorderSizePixel = 0
  135. label.Position = UDim2.new(0.413265318, 0, 0.0166666675, 0)
  136. label.Size = UDim2.new(1, 0, 0, 25)
  137. label.Font = Enum.Font.SourceSans
  138. label.TextColor3 = Color3.fromRGB(255, 255, 255)
  139. label.TextSize = 16.000
  140. label.Text = name
  141. end
  142.  
  143. function GamerLibrary:CreateButton(name,func)
  144. local button = Instance.new("TextButton")
  145. button.Name = "button"
  146. button.Parent = container
  147. button.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  148. button.BorderColor3 = Color3.fromRGB(0, 0, 0)
  149. button.BorderSizePixel = 0
  150. button.Position = UDim2.new(0, 0, 0.446533352, 0)
  151. button.Size = UDim2.new(1, 0, 0, 25)
  152. button.Font = Enum.Font.SourceSans
  153. button.TextColor3 = Color3.fromRGB(255, 255, 255)
  154. button.TextSize = 16.000
  155. button.Text = name
  156. button.MouseButton1Click:Connect(func);
  157.  
  158. end
  159.  
  160. function GamerLibrary:CreateDivider(name)
  161. local divider = Instance.new("TextLabel")
  162. divider.Name = "divider"
  163. divider.Parent = container
  164. divider.BackgroundColor3 = Color3.fromRGB(21, 21, 21)
  165. divider.BorderColor3 = Color3.fromRGB(255, 255, 255)
  166. divider.BorderSizePixel = 0
  167. divider.Position = UDim2.new(0, 0, 0.356666654, 0)
  168. divider.Size = UDim2.new(1, 0, -0.0201333109, 25)
  169. divider.Font = Enum.Font.SourceSans
  170. divider.Text = name
  171. divider.TextColor3 = Color3.fromRGB(255, 255, 255)
  172. divider.TextSize = 16.000
  173. end
  174.  
  175. function GamerLibrary:CreateToggle(name,callback)
  176.  
  177. local toggletext = Instance.new("TextLabel")
  178. local togglebutton = Instance.new("TextButton")
  179.  
  180. toggletext.Name = "toggletext"
  181. toggletext.Parent = container
  182. toggletext.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  183. toggletext.BorderSizePixel = 0
  184. toggletext.Size = UDim2.new(1, 0, 0, 25)
  185. toggletext.Font = Enum.Font.SourceSans
  186. toggletext.Text = " " .. name
  187. toggletext.TextColor3 = Color3.fromRGB(255, 255, 255)
  188. toggletext.TextSize = 16.000
  189. toggletext.TextXAlignment = Enum.TextXAlignment.Left
  190.  
  191. togglebutton.Name = "togglebutton"
  192. togglebutton.Parent = toggletext
  193. togglebutton.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
  194. togglebutton.BorderColor3 = Color3.fromRGB(71, 71, 71)
  195. togglebutton.Position = UDim2.new(0.820691466, 0, 0.100000001, 0)
  196. togglebutton.Size = UDim2.new(0.102777764, 0, -0.219999999, 22)
  197. togglebutton.Font = Enum.Font.SourceSans
  198. togglebutton.Text = "X"
  199. togglebutton.TextColor3 = Color3.fromRGB(255, 255, 255)
  200. togglebutton.TextSize = 16.000
  201.  
  202. togglebutton.MouseButton1Click:Connect(function()
  203. if togglebutton.Text == "X" then
  204. callback(true)
  205. togglebutton.Text = "✓"
  206.  
  207. elseif togglebutton.Text == "✓" then
  208.  
  209. togglebutton.Text = "X"
  210. callback(false)
  211. end
  212.  
  213. end)
  214.  
  215. end
  216.  
  217. function GamerLibrary:CreateSlider(name,min,max,func)
  218. local slidertext = Instance.new("TextLabel")
  219. local slidervalue = Instance.new("TextLabel")
  220. local Slider = Instance.new("Frame")
  221. local Bar = Instance.new("Frame")
  222. local Knob = Instance.new("TextButton")
  223.  
  224. slidertext.Name = "slidertext"
  225. slidertext.Parent = container
  226. slidertext.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  227. slidertext.BorderSizePixel = 0
  228. slidertext.Position = UDim2.new(0, 0, 0.503199995, 0)
  229. slidertext.Size = UDim2.new(1, 0, 0, 25)
  230. slidertext.Font = Enum.Font.SourceSans
  231. slidertext.Text = " " .. name
  232. slidertext.TextColor3 = Color3.fromRGB(255, 255, 255)
  233. slidertext.TextSize = 16.000
  234. slidertext.TextXAlignment = Enum.TextXAlignment.Left
  235.  
  236. slidervalue.Name = "slidervalue"
  237. slidervalue.Parent = slidertext
  238. slidervalue.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  239. slidervalue.BackgroundTransparency = 1.000
  240. slidervalue.Position = UDim2.new(0.12513417, 0, -0.0362510309, 0)
  241. slidervalue.Size = UDim2.new(0.349056602, 0, 0, 25)
  242. slidervalue.Font = Enum.Font.SourceSans
  243. slidervalue.Text = min
  244. slidervalue.TextColor3 = Color3.fromRGB(255, 255, 255)
  245. slidervalue.TextSize = 16.000
  246. slidervalue.TextXAlignment = Enum.TextXAlignment.Right
  247.  
  248. Slider.Name = "Slider"
  249. Slider.Parent = slidertext
  250. Slider.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  251. Slider.BackgroundTransparency = 1.000
  252. Slider.BorderSizePixel = 0
  253. Slider.Size = UDim2.new(0, 281, 0, 13)
  254.  
  255. Bar.Name = "Bar"
  256. Bar.Parent = Slider
  257. Bar.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  258. Bar.Position = UDim2.new(0.370106757, 0, 0.846153855, 0)
  259. Bar.Size = UDim2.new(0, 85, 0, 3)
  260.  
  261. Knob.Name = "Knob"
  262. Knob.Parent = Bar
  263. Knob.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  264. Knob.Position = UDim2.new(-0.00357127469, 0, -2.66666675, 0)
  265. Knob.Size = UDim2.new(0, 6, 0, 18)
  266. Knob.Font = Enum.Font.SourceSans
  267. Knob.Text = ""
  268. Knob.TextColor3 = Color3.fromRGB(0, 0, 0)
  269. Knob.TextSize = 14.000
  270. Knob.BorderSizePixel = 0
  271.  
  272. local bar = Bar;
  273. local knob = Knob;
  274. local valueChangedEvent = Instance.new("BindableEvent")
  275. local startXScale = -.05;
  276. local endXScale = .95;
  277. local MinValue = min
  278. local MaxValue = max
  279. local Valueasd;
  280. local mouse = game:GetService("Players").LocalPlayer:GetMouse()
  281.  
  282. valueChangedEvent.Name = "ValueChanged"
  283. valueChangedEvent.Archivable = true
  284.  
  285. -- Updates the position of the knob as well as the value
  286. local prevValue = nil;
  287. local function Update()
  288. local absPosition = Bar.AbsolutePosition.X;
  289. local absSize = Bar.AbsoluteSize.X;
  290. local mouseDelta = math.min(math.max(0, mouse.X - absPosition), absSize);
  291. local value = MinValue + ((mouseDelta / absSize) * (MaxValue - MinValue));
  292. Valueasd = math.floor(value)
  293. slidervalue.Text = math.floor(value)
  294. knob.Position = UDim2.new((mouseDelta / absSize) - .05, knob.Position.X.Offset, knob.Position.Y.Scale, knob.Position.Y.Offset);
  295. if (prevValue ~= nil and math.floor(prevValue) ~= math.floor(value)) then
  296. valueChangedEvent:Fire(prevValue, math.floor(value));
  297. prevValue = math.floor(value);
  298. else
  299. prevValue = math.floor(value);
  300. end
  301. end
  302.  
  303. -- Coroutine to keep updating
  304. local keepUpdating = false;
  305. local function Updater()
  306. while (true) do
  307. if (keepUpdating) then
  308. Update()
  309. func(Valueasd)
  310. end
  311. wait(.05)
  312. end
  313. end
  314. local taskCoro = coroutine.create(Updater)
  315. coroutine.resume(taskCoro);
  316.  
  317. -- Event Connecting
  318. knob.MouseButton1Down:Connect(function()
  319. keepUpdating = true;
  320.  
  321. end)
  322. local UserInputService = game:GetService("UserInputService")
  323. UserInputService.InputEnded:Connect(function(inputObject)
  324. if inputObject.UserInputType == Enum.UserInputType.MouseButton1 then
  325. keepUpdating = false;
  326.  
  327. end
  328. end)
  329.  
  330. end
  331.  
  332. function GamerLibrary:CreateTextbox(name,placeholder,func)
  333. local textboxtext = Instance.new("TextLabel")
  334. local textbox = Instance.new("TextBox")
  335. textboxtext.Name = "textboxtext"
  336. textboxtext.Parent = container
  337. textboxtext.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  338. textboxtext.BorderColor3 = Color3.fromRGB(54, 54, 54)
  339. textboxtext.BorderSizePixel = 0
  340. textboxtext.Position = UDim2.new(0.0102040814, 0, 0.0733333379, 0)
  341. textboxtext.Size = UDim2.new(1, 0, 0.0599999987, 25)
  342. textboxtext.Font = Enum.Font.SourceSans
  343. textboxtext.Text = name
  344. textboxtext.TextColor3 = Color3.fromRGB(255, 255, 255)
  345. textboxtext.TextSize = 16.000
  346. textboxtext.TextYAlignment = Enum.TextYAlignment.Top
  347.  
  348. textbox.Name = "textbox"
  349. textbox.Parent = textboxtext
  350. textbox.BackgroundColor3 = Color3.fromRGB(66, 66, 66)
  351. textbox.BorderColor3 = Color3.fromRGB(67, 67, 67)
  352. textbox.BorderSizePixel = 2
  353. textbox.Position = UDim2.new(0.214285716, 0, 0.438935041, 0)
  354. textbox.Size = UDim2.new(0, 112, 0, 18)
  355. textbox.Font = Enum.Font.SourceSans
  356. textbox.PlaceholderText = placeholder
  357. textbox.Text = ""
  358. textbox.TextColor3 = Color3.fromRGB(255, 255, 255)
  359. textbox.TextSize = 16.000
  360. textbox.TextWrapped = true
  361.  
  362. textbox.FocusLost:Connect(function()
  363. func(textbox.Text)
  364.  
  365. end)
  366. end
  367.  
  368.  
  369. return GamerLibrary;
  370.  
  371. end
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378. return library;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement