Advertisement
Vexo123

NEW2 UI LIB

Apr 12th, 2020
1,275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.17 KB | None | 0 0
  1. for _,v in pairs(game:GetService('CoreGui'):GetDescendants()) do
  2. if v:IsA('IntValue') and v.Name == '0v1' then
  3. v.Parent:Destroy()
  4. end
  5. end
  6.  
  7. local Heartbeat = game:GetService("RunService").Heartbeat;
  8. local UIS = game:GetService("UserInputService");
  9. local TweenService = game:GetService("TweenService");
  10.  
  11.  
  12. if shared.Cursor then
  13. local Old_Cursor = shared.Cursor;
  14.  
  15. shared.Cursor = nil;
  16. Old_Cursor:Remove();
  17. end;
  18.  
  19. if Drawing then
  20. local Cursor = Drawing.new("Circle");
  21. Cursor.Filled = true;
  22. Cursor.Color = Color3.fromRGB(255, 255, 255);
  23. Cursor.Transparency = 1;
  24. Cursor.Visible = true;
  25. Cursor.Radius = 5;
  26. Cursor.Thickness = 1;
  27. shared.Cursor = Cursor;
  28.  
  29. local connection;
  30.  
  31. connection = Heartbeat:Connect(function()
  32. if not shared.Cursor then
  33. connection:disconnect();
  34. else
  35. shared.Cursor.Position = UIS:GetMouseLocation();
  36. end;
  37. end);
  38. end;
  39.  
  40.  
  41. local settings = {
  42. main_theme = {
  43.  
  44. },
  45. secondary_theme = {
  46.  
  47. }
  48. }
  49.  
  50. local library = {}
  51. library.WindowCount = 0
  52. local UIS = game:GetService("UserInputService");
  53. local Heartbeat = game:GetService("RunService").Heartbeat;
  54.  
  55. local dragger = {};
  56.  
  57. do
  58. local mouse = game:GetService("Players").LocalPlayer:GetMouse();
  59. local inputService = game:GetService('UserInputService');
  60. local heartbeat = game:GetService("RunService").Heartbeat;
  61.  
  62. -- // credits to Ririchi / Inori for this cute drag function :)
  63. function dragger.new(frame, secondlol)
  64. frame.Active = true;
  65. secondlol.Active = true;
  66.  
  67. secondlol.MouseLeave:connect(function()
  68. IsInFrame = false;
  69. end)
  70.  
  71. secondlol.MouseEnter:connect(function()
  72. IsInFrame = true;
  73. end)
  74.  
  75. local input = secondlol.InputBegan:connect(function(key)
  76. if key.UserInputType == Enum.UserInputType.MouseButton1 and IsInFrame then
  77. local objectPosition = Vector2.new(mouse.X - frame.AbsolutePosition.X, mouse.Y - frame.AbsolutePosition.Y);
  78. while heartbeat:wait() and inputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
  79. pcall(function()
  80. frame:TweenPosition(UDim2.new(0, mouse.X - objectPosition.X + (frame.Size.X.Offset * frame.AnchorPoint.X), 0, mouse.Y - objectPosition.Y + (frame.Size.Y.Offset * frame.AnchorPoint.Y)), 'Out', 'Linear', 0.01, true);
  81. end)
  82. end
  83. end
  84. end)
  85. end
  86. end
  87. library.gui = Instance.new("ScreenGui")
  88. library.gui.Parent = game:WaitForChild('CoreGui')
  89. library.gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  90. library.gui.Name = game:GetService("HttpService"):GenerateGUID(false):lower():sub(1, 10);
  91. library.toggled = true
  92.  
  93. game:GetService('UserInputService').InputBegan:connect(function(key, gpe)
  94. --if (not gpe) then
  95. if key.KeyCode == Enum.KeyCode.RightShift and library.gui then
  96. library.toggled = not library.toggled;
  97. library.gui.Enabled = library.toggled;
  98. shared.Cursor.Visible = library.toggled;
  99. end
  100. --end
  101. end)
  102.  
  103. function library:CreateWindow(name, size)
  104. size = size or 0
  105. library.flags = {};
  106.  
  107. local main = Instance.new("ImageLabel")
  108. local bar = Instance.new("ImageLabel")
  109. local title = Instance.new("TextLabel")
  110. local UIListLayout = Instance.new("UIListLayout")
  111.  
  112.  
  113.  
  114. main.Name = "main"
  115. main.Parent = library.gui
  116. main.BackgroundColor3 = Color3.new(1, 1, 1)
  117. main.BackgroundTransparency = 1
  118. main.BorderSizePixel = 0
  119. main.Position = UDim2.new(0, 30 + (190 * self.WindowCount), 0, (main.Size.Y.Offset / 2) + 33)
  120. main.Size = UDim2.new(0, 180, 0, 333)
  121. main.Image = "rbxassetid://4550094458"
  122. main.ImageColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  123. main.ScaleType = Enum.ScaleType.Slice
  124. main.SliceCenter = Rect.new(4, 4, 296, 296)
  125.  
  126. bar.Name = "bar"
  127. bar.Parent = main
  128. bar.BackgroundColor3 = Color3.fromRGB(231, 178, 196)
  129. bar.BackgroundTransparency = 1
  130. bar.BorderSizePixel = 0
  131. bar.Position = UDim2.new(0, 0, 0, -2)
  132. bar.Size = UDim2.new(0, 180,0, 32)
  133. bar.Image = "rbxassetid://4550094255"
  134. bar.ImageColor3 = Color3.fromRGB(231, 178, 196)
  135. bar.ScaleType = Enum.ScaleType.Slice
  136. bar.SliceCenter = Rect.new(4, 4, 296, 296)
  137.  
  138. dragger.new(main, bar)
  139.  
  140. title.Name = "title"
  141. title.Parent = bar
  142. title.BackgroundColor3 = Color3.new(1, 1, 1)
  143. title.BackgroundTransparency = 1
  144. title.BorderSizePixel = 0
  145. title.Size = UDim2.new(1, 0, 1, 0)
  146. title.Font = Enum.Font.GothamSemibold
  147. title.Text = name
  148. title.TextColor3 = Color3.new(1, 1, 1)
  149. title.TextSize = 16
  150.  
  151. UIListLayout.Parent = main
  152. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  153. UIListLayout.HorizontalAlignment = "Center";
  154. UIListLayout.Padding = UDim.new(0, 5);
  155.  
  156. local mainLib = {}
  157.  
  158. mainLib.Count = self.WindowCount
  159. mainLib.Container = main
  160.  
  161. self.WindowCount = self.WindowCount + 1
  162.  
  163. function mainLib:Resize()
  164. local count = 0
  165. for i,v in pairs(main:GetChildren()) do
  166. if not v:IsA('UIListLayout') then
  167. count = count + 1
  168. end
  169. end
  170.  
  171. local Size = UDim2.new(0, 180, 0, (count * 45 + size) - 10)
  172. main.Size = Size
  173. end
  174.  
  175. function mainLib:btnRipple(btn)
  176. spawn(function()
  177. local mouse = game:GetService("Players").LocalPlayer:GetMouse();
  178. local rippleEffect = Instance.new("ImageLabel", btn);
  179. local rippleEffectInner = Instance.new("ImageLabel", rippleEffect);
  180. rippleEffect.Name = "rippleEffect";
  181. rippleEffect.BackgroundTransparency = 1;
  182. rippleEffect.BorderSizePixel = 0;
  183. rippleEffect.Image = "rbxassetid://2708891598"
  184. rippleEffect.ImageColor3 = Color3.fromRGB(244, 244, 244);
  185. rippleEffect.ImageTransparency = 0.7;
  186. rippleEffect.ScaleType = Enum.ScaleType.Fit;
  187. rippleEffectInner.Name = "rippleEffect";
  188. rippleEffectInner.AnchorPoint = Vector2.new(0.5, 0.5);
  189. rippleEffectInner.BackgroundTransparency = 1;
  190. rippleEffectInner.BorderSizePixel = 0;
  191. rippleEffectInner.Position = UDim2.new(0.5, 0, 0.5, 0);
  192. rippleEffectInner.Size = UDim2.new(1, 0, 1, 0);
  193. rippleEffectInner.Image = "rbxassetid://2708891598"
  194. rippleEffectInner.ImageColor3 = Color3.fromRGB(45, 45, 45);
  195. rippleEffectInner.ImageTransparency = 0.7;
  196. rippleEffectInner.ScaleType = Enum.ScaleType.Fit;
  197. rippleEffect.Position = UDim2.new((mouse.X - rippleEffect.AbsolutePosition.X) / btn.AbsoluteSize.X, 0, (mouse.Y - rippleEffect.AbsolutePosition.Y) / btn.AbsoluteSize.Y, 0);
  198. local Animation = TweenService:Create(rippleEffect, TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
  199. Position = UDim2.new(-4.5, 0, -4.5, 0);
  200. Size = UDim2.new(10, 0, 10, 0);
  201. ImageTransparency = 1;
  202. })
  203. Animation:Play();
  204.  
  205. Animation.Completed:Connect(function()
  206. rippleEffect:Destroy();
  207. end);
  208. end)
  209. end
  210.  
  211. function mainLib:Toggle(name, callback)
  212. local callback = callback or function() end
  213. local checkboxsection = Instance.new("ImageLabel")
  214. local checkboxtitle = Instance.new("TextLabel")
  215. local checkbox = Instance.new("ImageButton")
  216. local fill = Instance.new("ImageLabel")
  217. local check = Instance.new("ImageLabel")
  218.  
  219. checkboxsection.Name = "checkboxsection"
  220. checkboxsection.Parent = main
  221. checkboxsection.BackgroundColor3 = Color3.new(1, 1, 1)
  222. checkboxsection.BackgroundTransparency = 1
  223. checkboxsection.BorderSizePixel = 0
  224. checkboxsection.Position = UDim2.new(0.5, -85, 0, 98)
  225. checkboxsection.Size = UDim2.new(0, 170,0, 35)
  226. checkboxsection.Image = "http://www.roblox.com/asset/?id=4550094458"
  227. checkboxsection.ImageColor3 = Color3.fromRGB(40, 40, 40)
  228. checkboxsection.ScaleType = Enum.ScaleType.Slice
  229. checkboxsection.SliceCenter = Rect.new(4, 4, 296, 296)
  230.  
  231. checkboxtitle.Name = "checkboxtitle"
  232. checkboxtitle.Parent = checkboxsection
  233. checkboxtitle.BackgroundColor3 = Color3.new(1, 1, 1)
  234. checkboxtitle.BackgroundTransparency = 1
  235. checkboxtitle.BorderSizePixel = 0
  236. checkboxtitle.Position = UDim2.new(0.0576470755, 0, 0, 0)
  237. checkboxtitle.Size = UDim2.new(0.470588237, 0, 1, 0)
  238. checkboxtitle.Font = Enum.Font.Gotham
  239. checkboxtitle.Text = name
  240. checkboxtitle.TextColor3 = Color3.new(1, 1, 1)
  241. checkboxtitle.TextSize = 14
  242. checkboxtitle.TextXAlignment = Enum.TextXAlignment.Left
  243. if string.len(checkboxtitle.Text) >= 16 then
  244. checkboxtitle.TextScaled = true
  245. end
  246.  
  247. checkbox.Name = "checkbox"
  248. checkbox.Parent = checkboxsection
  249. checkbox.BackgroundColor3 = Color3.fromRGB(231, 178, 196)
  250. checkbox.BackgroundTransparency = 1
  251. checkbox.BorderSizePixel = 0
  252. checkbox.Position = UDim2.new(0.800000012, 0, 0.5, -12)
  253. checkbox.Size = UDim2.new(0.141176477, 0, 0.685714304, 0)
  254. checkbox.AutoButtonColor = false
  255. checkbox.Image = "rbxassetid://4552505888"
  256. checkbox.ImageColor3 = Color3.fromRGB(231, 178, 196)
  257.  
  258. fill.Name = "fill"
  259. fill.Parent = checkbox
  260. fill.BackgroundColor3 = Color3.new(1, 1, 1)
  261. fill.BackgroundTransparency = 1
  262. fill.BorderSizePixel = 0
  263. fill.Size = UDim2.new(1, 0, 1, 0)
  264. fill.Image = "http://www.roblox.com/asset/?id=4555402813"
  265. fill.ImageColor3 = Color3.fromRGB(231, 178, 196)
  266. fill.ImageTransparency = 1
  267.  
  268. check.Name = "check"
  269. check.Parent = fill
  270. check.BackgroundColor3 = Color3.new(1, 1, 1)
  271. check.BackgroundTransparency = 1
  272. check.BorderSizePixel = 0
  273. check.Position = UDim2.new(0.5, -9, 0.5, -9)
  274. check.Size = UDim2.new(0.75, 0, 0.75, 0)
  275. check.Image = "http://www.roblox.com/asset/?id=4555411759"
  276. check.ImageTransparency = 1
  277.  
  278. function playtween(object,properties,speed,easing)
  279. easing = easing or {};
  280. local tween = game:GetService("TweenService"):Create(object,TweenInfo.new(speed,unpack(easing)),properties);
  281. tween:Play();
  282. return tween;
  283. end;
  284.  
  285. local toggle = false
  286.  
  287. checkbox.MouseButton1Click:connect(function()
  288. if toggle then
  289. playtween(fill,{ImageTransparency = 1},0.1,{Enum.EasingStyle.Linear,Enum.EasingDirection.In});
  290. playtween(check,{ImageTransparency = 1},0.1,{Enum.EasingStyle.Linear,Enum.EasingDirection.In});
  291. toggle = false
  292. else
  293. playtween(fill,{ImageTransparency = 0},0.1,{Enum.EasingStyle.Linear,Enum.EasingDirection.In});
  294. playtween(check,{ImageTransparency = 0},0.1,{Enum.EasingStyle.Linear,Enum.EasingDirection.In});
  295. toggle = true
  296. end
  297. callback(toggle)
  298. end)
  299. self:Resize()
  300. end
  301.  
  302. function mainLib:Button(name, callback)
  303. local callback = callback or function() end
  304. local container = Instance.new("ImageLabel")
  305. local button = Instance.new("ImageLabel")
  306. local button2 = Instance.new("TextButton")
  307.  
  308. container.Name = "buttonsection"
  309. container.Parent = main
  310. container.BackgroundColor3 = Color3.new(1, 1, 1)
  311. container.BackgroundTransparency = 1
  312. container.BorderSizePixel = 0
  313. container.Position = UDim2.new(0.5, -85, 0, 215)
  314. container.Size = UDim2.new(0, 170,0, 35)
  315. container.Image = "http://www.roblox.com/asset/?id=4550094458"
  316. container.ImageColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  317. container.ScaleType = Enum.ScaleType.Slice
  318. container.SliceCenter = Rect.new(4, 4, 296, 296)
  319.  
  320. button.Name = "button"
  321. button.Parent = container
  322. button.BackgroundColor3 = Color3.new(1, 1, 1)
  323. button.BackgroundTransparency = 1
  324. button.BorderSizePixel = 0
  325. button.Position = UDim2.new(0.5, -78, 0.5, -12)
  326. button.Size = UDim2.new(0.917647064, 0, 0.685714304, 0)
  327. button.Image = "rbxassetid://4641155515"
  328. button.ImageColor3 = Color3.fromRGB(231, 178, 196)
  329. button.ScaleType = Enum.ScaleType.Slice
  330. button.SliceCenter = Rect.new(4, 4, 296, 296)
  331.  
  332. button2.Name = "button"
  333. button2.Parent = button
  334. button2.BackgroundColor3 = Color3.new(1, 1, 1)
  335. button2.BackgroundTransparency = 1
  336. button2.BorderSizePixel = 0
  337. button2.Size = UDim2.new(1, 0, 1, 0)
  338. button2.Font = Enum.Font.Gotham
  339. button2.TextColor3 = Color3.new(1, 1, 1)
  340. button2.ClipsDescendants = true
  341. button2.TextSize = 12
  342. button2.Text = name
  343. if string.len(button2.Text) >= 25 then
  344. button2.TextScaled = true
  345. end
  346. button2.MouseButton1Click:Connect(function() mainLib:btnRipple(button2) end)
  347. button2.MouseButton1Click:Connect(callback)
  348. self:Resize()
  349. end
  350.  
  351. function mainLib:Slider(name, settings, callback)
  352. local callback = callback or function() end
  353. assert(settings.min and settings.max, "You need to put a min value and a max value and a default value!");
  354.  
  355. local slidersection = Instance.new("ImageLabel")
  356. local slidername = Instance.new("TextLabel")
  357. local slider = Instance.new("TextButton")
  358. local line = Instance.new("ImageLabel")
  359. local fill = Instance.new("ImageLabel")
  360. local Frame = Instance.new("ImageLabel")
  361. local label = Instance.new("TextLabel")
  362.  
  363. slidersection.Name = "slidersection"
  364. slidersection.Parent = main
  365. slidersection.BackgroundColor3 = Color3.new(1, 1, 1)
  366. slidersection.BackgroundTransparency = 1
  367. slidersection.BorderSizePixel = 0
  368. slidersection.Position = UDim2.new(0.5, -85, 0, 34)
  369. slidersection.Size = UDim2.new(0, 170,0, 60)
  370. slidersection.Image = "http://www.roblox.com/asset/?id=4550094458"
  371. slidersection.ImageColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  372. slidersection.ScaleType = Enum.ScaleType.Slice
  373. slidersection.SliceCenter = Rect.new(4, 4, 296, 296)
  374.  
  375. slidername.Name = "slidername"
  376. slidername.Parent = slidersection
  377. slidername.BackgroundColor3 = Color3.new(1, 1, 1)
  378. slidername.BackgroundTransparency = 1
  379. slidername.BorderSizePixel = 0
  380. slidername.Position = UDim2.new(0.311764717, -43, 0, 0)
  381. slidername.Size = UDim2.new(0.470588237, 0, 0.646666706, 0)
  382. slidername.Font = Enum.Font.Gotham
  383. slidername.Text = name
  384. slidername.TextColor3 = Color3.new(1, 1, 1)
  385. slidername.TextSize = 14
  386. slidername.TextXAlignment = Enum.TextXAlignment.Left
  387.  
  388. slider.Name = "slider"
  389. slider.Parent = slidersection
  390. slider.BackgroundColor3 = Color3.new(1, 1, 1)
  391. slider.BackgroundTransparency = 1
  392. slider.BorderSizePixel = 0
  393. slider.Size = UDim2.new(1, 0, 1, 0)
  394. slider.Font = Enum.Font.SourceSans
  395. slider.Text = ""
  396. slider.TextColor3 = Color3.new(0, 0, 0)
  397. slider.TextSize = 14
  398.  
  399. line.Name = "line"
  400. line.Parent = slider
  401. line.BackgroundColor3 = Color3.new(1, 1, 1)
  402. line.BackgroundTransparency = 1
  403. line.BorderSizePixel = 0
  404. line.Position = UDim2.new(0.5, -75, 0.680000007, -2)
  405. line.Size = UDim2.new(0.882352948, 0, 0.0500000007, 0)
  406. line.Image = "rbxassetid://4550094458"
  407. line.ImageTransparency = 0.5
  408. line.ScaleType = Enum.ScaleType.Slice
  409. line.SliceCenter = Rect.new(4, 4, 296, 296)
  410.  
  411. fill.Name = "fill"
  412. fill.Parent = line
  413. fill.BackgroundColor3 = Color3.new(1, 1, 1)
  414. fill.BackgroundTransparency = 1
  415. fill.BorderSizePixel = 0
  416. fill.Size = UDim2.new(0, 0, 1, 0)
  417. fill.Image = "rbxassetid://4550094458"
  418. fill.ImageColor3 = Color3.fromRGB(231, 178, 196)
  419. fill.ScaleType = Enum.ScaleType.Slice
  420. fill.SliceCenter = Rect.new(4, 4, 296, 296)
  421.  
  422. Frame.Name = "Frame"
  423. Frame.Parent = line
  424. Frame.BackgroundColor3 = Color3.new(1, 1, 1)
  425. Frame.BackgroundTransparency = 1
  426. Frame.BorderSizePixel = 0
  427. Frame.Position = UDim2.new(0, 0, 0.5, -7)
  428. Frame.Size = UDim2.new(0.0199999996, 0, 4.66666651, 0)
  429. Frame.Image = "rbxassetid://4550094458"
  430. Frame.ImageColor3 = Color3.fromRGB(231, 178, 196)
  431. Frame.ScaleType = Enum.ScaleType.Slice
  432. Frame.SliceCenter = Rect.new(4, 4, 296, 296)
  433.  
  434. label.Name = "label"
  435. label.Parent = slidersection
  436. label.BackgroundColor3 = Color3.new(1, 1, 1)
  437. label.BackgroundTransparency = 1
  438. label.BorderSizePixel = 0
  439. label.Position = UDim2.new(1.02941179, -43, 0, 0)
  440. label.Size = UDim2.new(0.223529384, 0, 0.646666706, 0)
  441. label.Font = Enum.Font.Gotham
  442. label.Text = '0'
  443. label.TextColor3 = Color3.new(1, 1, 1)
  444. label.TextSize = 14
  445. label.TextTransparency = 0.5
  446.  
  447. local Player = game:GetService("Players").LocalPlayer;
  448. local UIS = game:GetService("UserInputService");
  449. local RuS = game:GetService("RunService");
  450.  
  451. -- Properties
  452. local held = false;
  453. local step = 1;
  454. local percentage = 0;
  455.  
  456. UIS.InputEnded:connect(function(input, processed)
  457. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  458. held = false;
  459. end;
  460. end);
  461.  
  462. slider.MouseButton1Down:connect(function()
  463. held = true;
  464. end);
  465.  
  466. RuS.RenderStepped:connect(function(delta)
  467. if held then
  468. local MousePos = UIS:GetMouseLocation().X;
  469. local BtnPos = Frame.Position;
  470. local SliderSize = slider.AbsoluteSize.X;
  471. local SliderPos = slider.AbsolutePosition.X;
  472. local pos = (MousePos-SliderPos)/SliderSize;
  473. percentage = math.clamp(pos,0,1);
  474. Frame.Position = UDim2.new(percentage,0,BtnPos.Y.Scale, BtnPos.Y.Offset);
  475. fill.Size = UDim2.new(percentage,0,0, 3);
  476. label.Text = math.floor(percentage*settings.max);
  477. callback(tonumber(label.Text))
  478. end;
  479. end);
  480. self:Resize()
  481. end
  482.  
  483. function mainLib:TextBox(name, defaulttext, callback)
  484. local callback = callback or function() end
  485. local textboxsection = Instance.new("ImageLabel")
  486. local textboxlabel = Instance.new("TextLabel")
  487. local textboxholder = Instance.new("ImageLabel")
  488. local textbox = Instance.new("TextBox")
  489.  
  490. textboxsection.Name = "textboxsection"
  491. textboxsection.Parent = main
  492. textboxsection.BackgroundColor3 = Color3.new(1, 1, 1)
  493. textboxsection.BackgroundTransparency = 1
  494. textboxsection.BorderSizePixel = 0
  495. textboxsection.Position = UDim2.new(0.5, -85, 0, 176)
  496. textboxsection.Size = UDim2.new(0, 170,0, 35)
  497. textboxsection.Image = "http://www.roblox.com/asset/?id=4550094458"
  498. textboxsection.ImageColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  499. textboxsection.ScaleType = Enum.ScaleType.Slice
  500. textboxsection.SliceCenter = Rect.new(4, 4, 296, 296)
  501.  
  502. textboxlabel.Name = "textboxlabel"
  503. textboxlabel.Parent = textboxsection
  504. textboxlabel.BackgroundColor3 = Color3.new(1, 1, 1)
  505. textboxlabel.BackgroundTransparency = 1
  506. textboxlabel.BorderSizePixel = 0
  507. textboxlabel.Position = UDim2.new(0.0576470755, 0, 0, 0)
  508. textboxlabel.Size = UDim2.new(0.470588237, 0, 1, 0)
  509. textboxlabel.Font = Enum.Font.Gotham
  510. textboxlabel.Text = name
  511. textboxlabel.TextColor3 = Color3.new(1, 1, 1)
  512. textboxlabel.TextSize = 14
  513. textboxlabel.TextXAlignment = Enum.TextXAlignment.Left
  514. if string.len(textboxlabel.Text) >= 12 then
  515. textboxlabel.TextScaled = true
  516. end
  517.  
  518. textboxholder.Name = "textboxholder"
  519. textboxholder.Parent = textboxsection
  520. textboxholder.BackgroundColor3 = Color3.new(1, 1, 1)
  521. textboxholder.BackgroundTransparency = 1
  522. textboxholder.BorderSizePixel = 0
  523. textboxholder.Position = UDim2.new(0.529411793, 0, 0.5, -12)
  524. textboxholder.Size = UDim2.new(0.441176474, 0, 0.685714304, 0)
  525. textboxholder.Image = "rbxassetid://4550094458"
  526. textboxholder.ImageColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  527. textboxholder.ScaleType = Enum.ScaleType.Slice
  528. textboxholder.SliceCenter = Rect.new(4, 4, 296, 296)
  529.  
  530. textbox.Name = "textbox"
  531. textbox.Parent = textboxholder
  532. textbox.BackgroundColor3 = Color3.new(1, 1, 1)
  533. textbox.BackgroundTransparency = 1
  534. textbox.BorderSizePixel = 0
  535. textbox.ClipsDescendants = true
  536. textbox.Size = UDim2.new(1, 0, 1, 0)
  537. textbox.Font = Enum.Font.Gotham
  538. textbox.PlaceholderText = "Text"
  539. textbox.Text = defaulttext
  540. textbox.TextColor3 = Color3.new(1, 1, 1)
  541. textbox.TextSize = 10
  542.  
  543. textbox.FocusLost:Connect(function()
  544. callback(textbox.Text)
  545. end)
  546. self:Resize()
  547. end
  548.  
  549. function mainLib:Section(text)
  550. local section = Instance.new("ImageLabel")
  551. local sectiontext = Instance.new("TextLabel")
  552.  
  553. section.Name = "section"
  554. section.Parent = main
  555. section.BackgroundColor3 = Color3.new(1, 1, 1)
  556. section.BackgroundTransparency = 1
  557. section.BorderSizePixel = 0
  558. section.Position = UDim2.new(0.5, -85, 0, 254)
  559. section.Size = UDim2.new(0, 170,0, 35)
  560. section.Image = "http://www.roblox.com/asset/?id=4550094458"
  561. section.ImageColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  562. section.ScaleType = Enum.ScaleType.Slice
  563. section.SliceCenter = Rect.new(4, 4, 296, 296)
  564.  
  565. sectiontext.Name = "sectiontext"
  566. sectiontext.Parent = section
  567. sectiontext.BackgroundColor3 = Color3.new(1, 1, 1)
  568. sectiontext.BackgroundTransparency = 1
  569. sectiontext.BorderSizePixel = 0
  570. sectiontext.Size = UDim2.new(1, 0, 1, 0)
  571. sectiontext.Font = Enum.Font.Gotham
  572. sectiontext.Text = text
  573. sectiontext.TextColor3 = Color3.new(1, 1, 1)
  574. sectiontext.TextSize = 14
  575. if string.len(sectiontext.Text) >= 18 then
  576. sectiontext.TextScaled = true
  577. end
  578. self:Resize()
  579. end
  580.  
  581. function mainLib:Bind(name, default, callback)
  582. local callback = callback or function() end
  583. local keycodename = default
  584. local default = default
  585. local Type = tostring(default):match("UserInputType") and "UserInputType" or "KeyCode"
  586. keycodename = tostring(keycodename):gsub("Enum.UserInputType.", "")
  587. keycodename = tostring(keycodename):gsub("Enum.KeyCode.", "")
  588.  
  589. local bindsection = Instance.new("ImageLabel")
  590. local TextLabel = Instance.new("TextLabel")
  591. local keybindholder = Instance.new("ImageLabel")
  592. local keybindbutton = Instance.new("TextButton")
  593.  
  594. bindsection.Name = "bindsection"
  595. bindsection.Parent = main
  596. bindsection.BackgroundColor3 = Color3.new(1, 1, 1)
  597. bindsection.BackgroundTransparency = 1
  598. bindsection.BorderSizePixel = 0
  599. bindsection.Position = UDim2.new(0.5, -85, 0, 137)
  600. bindsection.Size = UDim2.new(0, 170,0, 35)
  601. bindsection.Image = "http://www.roblox.com/asset/?id=4550094458"
  602. bindsection.ImageColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  603. bindsection.ScaleType = Enum.ScaleType.Slice
  604. bindsection.SliceCenter = Rect.new(4, 4, 296, 296)
  605.  
  606. TextLabel.Parent = bindsection
  607. TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  608. TextLabel.BackgroundTransparency = 1
  609. TextLabel.BorderSizePixel = 0
  610. TextLabel.Position = UDim2.new(0.0576470755, 0, 0, 0)
  611. TextLabel.Size = UDim2.new(0.470588237, 0, 1, 0)
  612. TextLabel.Font = Enum.Font.Gotham
  613. TextLabel.Text = name
  614. TextLabel.TextColor3 = Color3.new(1, 1, 1)
  615. TextLabel.TextSize = 14
  616. TextLabel.TextXAlignment = Enum.TextXAlignment.Left
  617. if string.len(TextLabel.Text) >= 10 then
  618. TextLabel.TextScaled = true
  619. end
  620.  
  621. keybindholder.Name = "keybindholder"
  622. keybindholder.Parent = bindsection
  623. keybindholder.BackgroundColor3 = Color3.new(1, 1, 1)
  624. keybindholder.BackgroundTransparency = 1
  625. keybindholder.BorderSizePixel = 0
  626. keybindholder.Position = UDim2.new(0.529411793, 0, 0.5, -12)
  627. keybindholder.Size = UDim2.new(0.441176474, 0, 0.685714304, 0)
  628. keybindholder.Image = "rbxassetid://4641155515"
  629. keybindholder.ImageColor3 = Color3.fromRGB(231, 178, 196)
  630. keybindholder.ScaleType = Enum.ScaleType.Slice
  631. keybindholder.SliceCenter = Rect.new(4, 4, 296, 296)
  632.  
  633. keybindbutton.Name = "keybindbutton"
  634. keybindbutton.Parent = keybindholder
  635. keybindbutton.BackgroundColor3 = Color3.new(1, 1, 1)
  636. keybindbutton.BackgroundTransparency = 1
  637. keybindbutton.BorderSizePixel = 0
  638. keybindbutton.Size = UDim2.new(1, 0, 1, 0)
  639. keybindbutton.Font = Enum.Font.Gotham
  640. keybindbutton.Text = ". . ."
  641. keybindbutton.TextColor3 = Color3.new(1, 1, 1)
  642. keybindbutton.TextSize = 10
  643. local WhitelistedType = {
  644. [Enum.UserInputType.MouseButton1] = "Mouse1";
  645. [Enum.UserInputType.MouseButton2] = "Mouse2";
  646. [Enum.UserInputType.MouseButton3] = "Mouse3";
  647. };
  648.  
  649. keybindbutton.MouseButton1Click:Connect(function()
  650. local Connection;
  651.  
  652. keybindbutton.Text = ". . .";
  653.  
  654. Connection = UIS.InputBegan:Connect(function(i)
  655. if WhitelistedType[i.UserInputType] then
  656. keybindbutton.Text = WhitelistedType[i.UserInputType];
  657. spawn(function()
  658. wait(0.1)
  659. default = i.UserInputType;
  660. Type = "UserInputType";
  661. end);
  662. elseif i.KeyCode ~= Enum.KeyCode.Unknown then
  663. keybindbutton.Text = tostring(i.KeyCode):gsub("Enum.KeyCode.", "");
  664. spawn(function()
  665. wait(0.1)
  666. default = i.KeyCode;
  667. Type = "KeyCode";
  668. end);
  669. else
  670. warn("Exception: " .. i.UserInputType .. " " .. i.KeyCode);
  671. end;
  672.  
  673.  
  674. Connection:Disconnect();
  675. end);
  676. end);
  677.  
  678. UIS.InputBegan:Connect(function(i)
  679. if (default == i.UserInputType or default == i.KeyCode) then
  680. callback(default);
  681. end;
  682. end);
  683. self:Resize()
  684. end
  685. local Detect = Instance.new('IntValue', main)
  686. Detect.Name = '0v1'
  687. return mainLib
  688. end
  689. return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement