Advertisement
HEHEJ

Untitled

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