Advertisement
HEHEJ

Untitled

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