lolgame854

Library New UI

Aug 2nd, 2020
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.47 KB | None | 0 0
  1. local KeylimeLibrary = {}
  2. local xThing = 0
  3. local yThing = 0.044822257
  4.  
  5. local TweenService = game:GetService("TweenService")
  6. local RunService = game:GetService("RunService")
  7. local UserInputService = game:GetService("UserInputService")
  8. local Players = game:GetService("Players")
  9. local LocalPlayer = Players.LocalPlayer
  10. local Mouse = LocalPlayer:GetMouse()
  11.  
  12. local function CreateBaseObject(Class)
  13. if Class == "Button" then
  14. local Button = Instance.new("TextButton")
  15. local Roundify = Instance.new("ImageLabel")
  16.  
  17. Button.Name = Class
  18. Button.BackgroundColor3 = Color3.fromRGB(74, 74, 74)
  19. Button.BackgroundTransparency = 1.000
  20. Button.BorderSizePixel = 0
  21. Button.Position = UDim2.new(0, 0, 0.129380047, 0)
  22. Button.Size = UDim2.new(1, 0, 0, 30)
  23. Button.ZIndex = 2
  24. Button.Font = Enum.Font.GothamSemibold
  25. Button.TextColor3 = Color3.fromRGB(255, 255, 255)
  26. Button.TextSize = 14.000
  27.  
  28. Roundify.Name = "Roundify"
  29. Roundify.Parent = Button
  30. Roundify.Active = true
  31. Roundify.AnchorPoint = Vector2.new(0.5, 0.5)
  32. Roundify.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  33. Roundify.BackgroundTransparency = 1.000
  34. Roundify.Position = UDim2.new(0.5, 0, 0.5, 0)
  35. Roundify.Selectable = true
  36. Roundify.Size = UDim2.new(1, 0, 1, 0)
  37. Roundify.Image = "rbxassetid://3570695787"
  38. Roundify.ImageColor3 = Color3.fromRGB(74, 74, 74)
  39. Roundify.ScaleType = Enum.ScaleType.Slice
  40. Roundify.SliceCenter = Rect.new(100, 100, 100, 100)
  41. Roundify.SliceScale = 0.060
  42.  
  43. return Button
  44. elseif Class == "TextBox" then
  45. local TextBox = Instance.new("TextBox")
  46. local Roundify = Instance.new("ImageLabel")
  47.  
  48. TextBox.BackgroundColor3 = Color3.fromRGB(74, 74, 74)
  49. TextBox.BackgroundTransparency = 1.000
  50. TextBox.BorderSizePixel = 0
  51. TextBox.Size = UDim2.new(1, 0, 0, 30)
  52. TextBox.ZIndex = 2
  53. TextBox.Font = Enum.Font.GothamSemibold
  54. TextBox.PlaceholderText = "Text"
  55. TextBox.Text = ""
  56. TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  57. TextBox.TextSize = 14.000
  58.  
  59. Roundify.Name = "Roundify"
  60. Roundify.Parent = TextBox
  61. Roundify.Active = true
  62. Roundify.AnchorPoint = Vector2.new(0.5, 0.5)
  63. Roundify.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  64. Roundify.BackgroundTransparency = 1.000
  65. Roundify.Position = UDim2.new(0.5, 0, 0.5, 0)
  66. Roundify.Selectable = true
  67. Roundify.Size = UDim2.new(1, 0, 1, 0)
  68. Roundify.Image = "rbxassetid://3570695787"
  69. Roundify.ImageColor3 = Color3.fromRGB(74, 74, 74)
  70. Roundify.ScaleType = Enum.ScaleType.Slice
  71. Roundify.SliceCenter = Rect.new(100, 100, 100, 100)
  72. Roundify.SliceScale = 0.060
  73.  
  74. return TextBox
  75. elseif Class == "Toggle" then
  76. local Toggle = Instance.new("TextButton")
  77. local Title = Instance.new("TextLabel")
  78. local Frame = Instance.new("ImageLabel")
  79. local Checkmark = Instance.new("TextLabel")
  80.  
  81. Toggle.Name = "Toggle"
  82. Toggle.BackgroundColor3 = Color3.fromRGB(74, 74, 74)
  83. Toggle.BackgroundTransparency = 1.000
  84. Toggle.BorderSizePixel = 0
  85. Toggle.Position = UDim2.new(0, 0, 0.129380047, 0)
  86. Toggle.Size = UDim2.new(1, 0, 0, 30)
  87. Toggle.ZIndex = 2
  88. Toggle.Font = Enum.Font.GothamSemibold
  89. Toggle.Text = ""
  90. Toggle.TextColor3 = Color3.fromRGB(255, 255, 255)
  91. Toggle.TextSize = 14.000
  92.  
  93. Title.Name = "Title"
  94. Title.Parent = Toggle
  95. Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  96. Title.BackgroundTransparency = 1.000
  97. Title.Position = UDim2.new(0, 8, 0, 0)
  98. Title.Size = UDim2.new(1, -38, 1, 0)
  99. Title.Font = Enum.Font.GothamSemibold
  100. Title.Text = "Toggle"
  101. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  102. Title.TextSize = 14.000
  103. Title.TextXAlignment = Enum.TextXAlignment.Left
  104.  
  105. Frame.Name = "Frame"
  106. Frame.Parent = Toggle
  107. Frame.AnchorPoint = Vector2.new(1, 0)
  108. Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  109. Frame.BackgroundTransparency = 1.000
  110. Frame.Position = UDim2.new(1, 0, 0, 0)
  111. Frame.Size = UDim2.new(0, 30, 0, 30)
  112. Frame.Image = "rbxassetid://3570695787"
  113. Frame.ImageColor3 = Color3.fromRGB(74, 74, 74)
  114. Frame.ScaleType = Enum.ScaleType.Slice
  115. Frame.SliceCenter = Rect.new(100, 100, 100, 100)
  116. Frame.SliceScale = 0.060
  117.  
  118. Checkmark.Name = "Checkmark"
  119. Checkmark.Parent = Frame
  120. Checkmark.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  121. Checkmark.BackgroundTransparency = 1.000
  122. Checkmark.Size = UDim2.new(1, 0, 1, 0)
  123. Checkmark.Visible = true
  124. Checkmark.Font = Enum.Font.GothamSemibold
  125. Checkmark.Text = "รขล“โ€œ"
  126. Checkmark.TextColor3 = Color3.fromRGB(33, 181, 33)
  127. Checkmark.TextSize = 18.000
  128. Checkmark.ZIndex = 2
  129.  
  130. return Toggle
  131. elseif Class == "Slider" then
  132. local Slider = Instance.new("TextButton")
  133. local Title = Instance.new("TextLabel")
  134. local SliderHolder = Instance.new("ImageLabel")
  135. local Value = Instance.new("TextLabel")
  136. local SliderBar = Instance.new("ImageLabel")
  137.  
  138. Slider.Name = "Slider"
  139. Slider.BackgroundColor3 = Color3.fromRGB(74, 74, 74)
  140. Slider.BackgroundTransparency = 1.000
  141. Slider.BorderSizePixel = 0
  142. Slider.Position = UDim2.new(0, 0, 0.129380047, 0)
  143. Slider.Size = UDim2.new(1, 0, 0, 30)
  144. Slider.ZIndex = 2
  145. Slider.Font = Enum.Font.GothamSemibold
  146. Slider.Text = ""
  147. Slider.TextColor3 = Color3.fromRGB(255, 255, 255)
  148. Slider.TextSize = 14.000
  149.  
  150. Title.Name = "Title"
  151. Title.Parent = Slider
  152. Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  153. Title.BackgroundTransparency = 1.000
  154. Title.Position = UDim2.new(0, 8, 0, 0)
  155. Title.Size = UDim2.new(0.5, -8, 1, 0)
  156. Title.Font = Enum.Font.GothamSemibold
  157. Title.Text = "Slider"
  158. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  159. Title.TextSize = 14.000
  160. Title.TextXAlignment = Enum.TextXAlignment.Left
  161.  
  162. SliderHolder.Name = "SliderHolder"
  163. SliderHolder.Parent = Slider
  164. SliderHolder.AnchorPoint = Vector2.new(1, 0)
  165. SliderHolder.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  166. SliderHolder.BackgroundTransparency = 1.000
  167. SliderHolder.Position = UDim2.new(1, 0, 0, 0)
  168. SliderHolder.Size = UDim2.new(0.5, 0, 0, 30)
  169. SliderHolder.Image = "rbxassetid://3570695787"
  170. SliderHolder.ImageColor3 = Color3.fromRGB(74, 74, 74)
  171. SliderHolder.ScaleType = Enum.ScaleType.Slice
  172. SliderHolder.SliceCenter = Rect.new(100, 100, 100, 100)
  173. SliderHolder.SliceScale = 0.060
  174.  
  175. Value.Name = "Value"
  176. Value.Parent = SliderHolder
  177. Value.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  178. Value.BackgroundTransparency = 1.000
  179. Value.Size = UDim2.new(1, 0, 1, 0)
  180. Value.ZIndex = 3
  181. Value.Font = Enum.Font.Gotham
  182. Value.Text = "50"
  183. Value.TextColor3 = Color3.fromRGB(255, 255, 255)
  184. Value.TextSize = 14.000
  185.  
  186. SliderBar.Name = "SliderBar"
  187. SliderBar.Parent = SliderHolder
  188. SliderBar.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  189. SliderBar.BackgroundTransparency = 1.000
  190. SliderBar.Size = UDim2.new(0.5, 0, 1, 0)
  191. SliderBar.Image = "rbxassetid://3570695787"
  192. SliderBar.ImageColor3 = Color3.fromRGB(74, 74, 74)
  193. SliderBar.ScaleType = Enum.ScaleType.Slice
  194. SliderBar.SliceCenter = Rect.new(100, 100, 100, 100)
  195. SliderBar.SliceScale = 0.060
  196.  
  197. return Slider
  198. elseif Class == "Dropdown" then
  199. local Dropdown = Instance.new("TextButton")
  200. local Title = Instance.new("TextLabel")
  201. local DropdownHolder = Instance.new("ImageLabel")
  202. local Value = Instance.new("TextLabel")
  203. local Minimize = Instance.new("ImageButton")
  204. local DropdownOptions = Instance.new("ImageLabel")
  205. local Content = Instance.new("ScrollingFrame")
  206. local UIListLayout = Instance.new("UIListLayout")
  207. local Button = Instance.new("TextButton")
  208.  
  209. Dropdown.Name = "Dropdown"
  210. Dropdown.BackgroundColor3 = Color3.fromRGB(74, 74, 74)
  211. Dropdown.BackgroundTransparency = 1.000
  212. Dropdown.BorderSizePixel = 0
  213. Dropdown.Position = UDim2.new(0, 0, 0.129380047, 0)
  214. Dropdown.Size = UDim2.new(1, 0, 0, 30)
  215. Dropdown.ZIndex = 5
  216. Dropdown.Font = Enum.Font.GothamSemibold
  217. Dropdown.Text = ""
  218. Dropdown.TextColor3 = Color3.fromRGB(255, 255, 255)
  219. Dropdown.TextSize = 14.000
  220.  
  221. Title.Name = "Title"
  222. Title.Parent = Dropdown
  223. Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  224. Title.BackgroundTransparency = 1.000
  225. Title.Position = UDim2.new(0, 8, 0, 0)
  226. Title.Size = UDim2.new(0.5, -8, 1, 0)
  227. Title.Font = Enum.Font.GothamSemibold
  228. Title.Text = "Dropdown"
  229. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  230. Title.TextSize = 14.000
  231. Title.TextXAlignment = Enum.TextXAlignment.Left
  232. Title.ZIndex = 4
  233.  
  234. DropdownHolder.Name = "DropdownHolder"
  235. DropdownHolder.Parent = Dropdown
  236. DropdownHolder.AnchorPoint = Vector2.new(1, 0)
  237. DropdownHolder.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  238. DropdownHolder.BackgroundTransparency = 1.000
  239. DropdownHolder.Position = UDim2.new(1, 0, 0, 0)
  240. DropdownHolder.Size = UDim2.new(0.5, 0, 0, 30)
  241. DropdownHolder.Image = "rbxassetid://3570695787"
  242. DropdownHolder.ImageColor3 = Color3.fromRGB(74, 74, 74)
  243. DropdownHolder.ScaleType = Enum.ScaleType.Slice
  244. DropdownHolder.SliceCenter = Rect.new(100, 100, 100, 100)
  245. DropdownHolder.SliceScale = 0.060
  246. DropdownHolder.ZIndex = 4
  247.  
  248. Value.Name = "Value"
  249. Value.Parent = DropdownHolder
  250. Value.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  251. Value.BackgroundTransparency = 1.000
  252. Value.Position = UDim2.new(0, 3, 0, 0)
  253. Value.Size = UDim2.new(1, -30, 1, 0)
  254. Value.Font = Enum.Font.Gotham
  255. Value.Text = "Button"
  256. Value.TextColor3 = Color3.fromRGB(255, 255, 255)
  257. Value.TextSize = 14.000
  258. Value.ZIndex = 6
  259.  
  260. Minimize.Name = "Minimize"
  261. Minimize.Parent = DropdownHolder
  262. Minimize.AnchorPoint = Vector2.new(1, 0)
  263. Minimize.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  264. Minimize.BackgroundTransparency = 1.000
  265. Minimize.Position = UDim2.new(1, -3, 0, 3)
  266. Minimize.Size = UDim2.new(0, 24, 0, 24)
  267. Minimize.Image = "rbxassetid://4954699658"
  268. Minimize.ZIndex = 6
  269.  
  270. DropdownOptions.Name = "DropdownOptions"
  271. DropdownOptions.Parent = DropdownHolder
  272. DropdownOptions.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  273. DropdownOptions.BackgroundTransparency = 1.000
  274. DropdownOptions.Size = UDim2.new(1, 0, 0, 30)
  275. DropdownOptions.Image = "rbxassetid://3570695787"
  276. DropdownOptions.ImageColor3 = Color3.fromRGB(74, 74, 74)
  277. DropdownOptions.ScaleType = Enum.ScaleType.Slice
  278. DropdownOptions.SliceCenter = Rect.new(100, 100, 100, 100)
  279. DropdownOptions.SliceScale = 0.060
  280. DropdownOptions.ClipsDescendants = true
  281. DropdownOptions.ZIndex = 4
  282.  
  283. Content.Name = "Content"
  284. Content.Parent = DropdownOptions
  285. Content.Active = true
  286. Content.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  287. Content.BackgroundTransparency = 1.000
  288. Content.BorderSizePixel = 0
  289. Content.Position = UDim2.new(0, 0, 0, 30)
  290. Content.Size = UDim2.new(1, 0, 1, -30)
  291. Content.BottomImage = "rbxassetid://6347925"
  292. Content.CanvasSize = UDim2.new(0, 0, 0, 0)
  293. Content.MidImage = "rbxassetid://6347925"
  294. Content.ScrollBarThickness = 3
  295. Content.TopImage = "rbxassetid://6347925"
  296. Content.ZIndex = 4
  297.  
  298. UIListLayout.Parent = Content
  299. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  300.  
  301. return Dropdown
  302. elseif Class == "DropdownOption" then
  303. local Button = Instance.new("TextButton")
  304.  
  305. Button.Name = "Button"
  306. Button.BackgroundColor3 = Color3.fromRGB(74, 74, 74)
  307. Button.BackgroundTransparency = 1.000
  308. Button.BorderSizePixel = 0
  309. Button.Position = UDim2.new(0, 0, 0.129380047, 0)
  310. Button.Size = UDim2.new(1, 0, 0, 20)
  311. Button.ZIndex = 5
  312. Button.Font = Enum.Font.Gotham
  313. Button.TextColor3 = Color3.fromRGB(215, 215, 215)
  314. Button.TextSize = 14.000
  315.  
  316. return Button
  317. elseif Class == "Window" then
  318. xThing = xThing + 0.125
  319. if xThing > 0.625 then
  320. xThing = 0.125
  321. yThing = yThing + 0.35
  322. end
  323. local Keylime = Instance.new("ScreenGui")
  324. local MainFrame = Instance.new("ImageLabel")
  325. local Decor = Instance.new("Folder")
  326. local Line = Instance.new("ImageLabel")
  327. local Logo = Instance.new("TextLabel")
  328. local Minimize = Instance.new("ImageButton")
  329. local Content = Instance.new("ScrollingFrame")
  330. local UIListLayout = Instance.new("UIListLayout")
  331. local UIPadding = Instance.new("UIPadding")
  332.  
  333. Keylime.Name = "Keylime"
  334. Keylime.ResetOnSpawn = false
  335.  
  336. if RunService:IsStudio() then
  337. Keylime.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")
  338. else
  339. Keylime.Parent = game:GetService("CoreGui")
  340. end
  341.  
  342. MainFrame.Name = "MainFrame"
  343. MainFrame.Parent = Keylime
  344. MainFrame.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
  345. MainFrame.BackgroundTransparency = 1.000
  346. MainFrame.BorderColor3 = Color3.fromRGB(27, 42, 53)
  347. MainFrame.Position = UDim2.new(xThing, 0, yThing, 0)
  348. MainFrame.Size = UDim2.new(0, 200, 0, 375)
  349. MainFrame.Image = "rbxassetid://3570695787"
  350. MainFrame.ImageColor3 = Color3.fromRGB(35, 35, 35)
  351. MainFrame.ScaleType = Enum.ScaleType.Slice
  352. MainFrame.SliceCenter = Rect.new(100, 100, 100, 100)
  353. MainFrame.SliceScale = 0.120
  354.  
  355. UserInputService.InputBegan:connect(function(inputObject, gameProcessedEvent)
  356. if inputObject.KeyCode == Enum.KeyCode.LeftControl then
  357. if MainFrame.Visible == true then
  358. MainFrame.Visible = false
  359. elseif MainFrame.Visible == false then
  360. MainFrame.Visible = true
  361. end
  362. end
  363. end)
  364.  
  365. Decor.Name = "Decor"
  366. Decor.Parent = MainFrame
  367.  
  368. Line.Name = "Line"
  369. Line.Parent = Decor
  370. Line.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  371. Line.BorderSizePixel = 0
  372. Line.Position = UDim2.new(0, 0, 0, 30)
  373. Line.Size = UDim2.new(1, 0, 0, 7)
  374. Line.Image = "rbxassetid://2790390993"
  375. Line.ImageColor3 = Color3.fromRGB(33, 181, 33)
  376.  
  377. Logo.Name = "Title"
  378. Logo.Parent = Decor
  379. Logo.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  380. Logo.BackgroundTransparency = 1.000
  381. Logo.BorderSizePixel = 0
  382. Logo.Size = UDim2.new(1, 0, 0, 30)
  383. Logo.Font = Enum.Font.GothamSemibold
  384. Logo.Text = "Keylime Hub"
  385. Logo.TextColor3 = Color3.fromRGB(226, 226, 226)
  386. Logo.TextSize = 14.000
  387.  
  388. Minimize.Name = "Minimize"
  389. Minimize.Parent = MainFrame
  390. Minimize.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  391. Minimize.BackgroundTransparency = 1.000
  392. Minimize.Position = UDim2.new(0, 3, 0, 3)
  393. Minimize.Size = UDim2.new(0, 24, 0, 24)
  394. Minimize.Image = "rbxassetid://4954699658"
  395.  
  396. Content.Name = "Content"
  397. Content.Parent = MainFrame
  398. Content.Active = true
  399. Content.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  400. Content.BackgroundTransparency = 1.000
  401. Content.BorderSizePixel = 0
  402. Content.Position = UDim2.new(0, 0, 0, 37)
  403. Content.Size = UDim2.new(1, 0, 1, -37)
  404. Content.BottomImage = "rbxassetid://6347925"
  405. Content.CanvasSize = UDim2.new(0, 0, 0, 0)
  406. Content.MidImage = "rbxassetid://6347925"
  407. Content.ScrollBarThickness = 3
  408. Content.TopImage = "rbxassetid://6347925"
  409. Content.VerticalScrollBarInset = Enum.ScrollBarInset.None
  410.  
  411. UIListLayout.Parent = Content
  412. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  413. UIListLayout.Padding = UDim.new(0, 4)
  414.  
  415. UIPadding.Parent = Content
  416. UIPadding.PaddingLeft = UDim.new(0, 4)
  417. UIPadding.PaddingRight = UDim.new(0, 4)
  418. UIPadding.PaddingTop = UDim.new(0, 4)
  419.  
  420. return Keylime
  421. end
  422. end
  423.  
  424. local function AnimateButton(Object, LinkedObject)
  425. local BaseColor
  426. local Image = false
  427.  
  428. if not LinkedObject then
  429. if Object:IsA("ImageButton") then
  430. BaseColor = Object.ImageColor3
  431. Image = true
  432. else
  433. BaseColor = Object.BackgroundColor3
  434. end
  435.  
  436. Object.MouseEnter:Connect(function()
  437. if Image then
  438. TweenService:Create(Object, TweenInfo.new(0.2), {
  439. ImageColor3 = Color3.new(BaseColor.R * 1.1, BaseColor.G * 1.1, BaseColor.B * 1.1)
  440. }):Play()
  441. else
  442. TweenService:Create(Object, TweenInfo.new(0.2), {
  443. BackgroundColor3 = Color3.new(BaseColor.R * 1.1, BaseColor.G * 1.1, BaseColor.B * 1.1)
  444. }):Play()
  445. end
  446. end)
  447.  
  448. Object.MouseLeave:Connect(function()
  449. if Image then
  450. TweenService:Create(Object, TweenInfo.new(0.2), {
  451. ImageColor3 = BaseColor
  452. }):Play()
  453. else
  454. TweenService:Create(Object, TweenInfo.new(0.2), {
  455. BackgroundColor3 = BaseColor
  456. }):Play()
  457. end
  458. end)
  459.  
  460. Object.MouseButton1Down:Connect(function()
  461. if Image then
  462. TweenService:Create(Object, TweenInfo.new(0.2), {
  463. ImageColor3 = Color3.new(BaseColor.R * 0.8, BaseColor.G * 0.8, BaseColor.B * 0.8)
  464. }):Play()
  465. else
  466. TweenService:Create(Object, TweenInfo.new(0.2), {
  467. BackgroundColor3 = Color3.new(BaseColor.R * 0.8, BaseColor.G * 0.8, BaseColor.B * 0.8)
  468. }):Play()
  469. end
  470. end)
  471.  
  472. Object.MouseButton1Up:Connect(function()
  473. if Image then
  474. TweenService:Create(Object, TweenInfo.new(0.2), {
  475. ImageColor3 = BaseColor
  476. }):Play()
  477. else
  478. TweenService:Create(Object, TweenInfo.new(0.2), {
  479. BackgroundColor3 = BaseColor
  480. }):Play()
  481. end
  482. end)
  483. elseif Object:IsA("TextBox") then
  484. if LinkedObject:IsA("ImageButton") or LinkedObject:IsA("ImageLabel") then
  485. BaseColor = LinkedObject.ImageColor3
  486. Image = true
  487. else
  488. BaseColor = LinkedObject.BackgroundColor3
  489. end
  490.  
  491. local Focused = false
  492.  
  493. Object.MouseEnter:Connect(function()
  494. if not Focused then
  495. if Image then
  496. TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
  497. ImageColor3 = Color3.new(BaseColor.R * 1.1, BaseColor.G * 1.1, BaseColor.B * 1.1)
  498. }):Play()
  499. else
  500. TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
  501. BackgroundColor3 = Color3.new(BaseColor.R * 1.1, BaseColor.G * 1.1, BaseColor.B * 1.1)
  502. }):Play()
  503. end
  504. end
  505. end)
  506.  
  507. Object.MouseLeave:Connect(function()
  508. if Focused then
  509. if Image then
  510. TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
  511. ImageColor3 = BaseColor
  512. }):Play()
  513. else
  514. TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
  515. BackgroundColor3 = BaseColor
  516. }):Play()
  517. end
  518. end
  519. end)
  520.  
  521. Object.Focused:Connect(function()
  522. Focused = true
  523.  
  524. if Image then
  525. TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
  526. ImageColor3 = Color3.new(BaseColor.R * 0.8, BaseColor.G * 0.8, BaseColor.B * 0.8)
  527. }):Play()
  528. else
  529. TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
  530. BackgroundColor3 = Color3.new(BaseColor.R * 0.8, BaseColor.G * 0.8, BaseColor.B * 0.8)
  531. }):Play()
  532. end
  533. end)
  534.  
  535. Object.FocusLost:Connect(function()
  536. Focused = false
  537.  
  538. if Image then
  539. TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
  540. ImageColor3 = BaseColor
  541. }):Play()
  542. else
  543. TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
  544. BackgroundColor3 = BaseColor
  545. }):Play()
  546. end
  547. end)
  548. else
  549. if LinkedObject:IsA("ImageButton") or LinkedObject:IsA("ImageLabel") then
  550. BaseColor = LinkedObject.ImageColor3
  551. Image = true
  552. else
  553. BaseColor = LinkedObject.BackgroundColor3
  554. end
  555.  
  556. Object.MouseEnter:Connect(function()
  557. if Image then
  558. TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
  559. ImageColor3 = Color3.new(BaseColor.R * 1.1, BaseColor.G * 1.1, BaseColor.B * 1.1)
  560. }):Play()
  561. else
  562. TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
  563. BackgroundColor3 = Color3.new(BaseColor.R * 1.1, BaseColor.G * 1.1, BaseColor.B * 1.1)
  564. }):Play()
  565. end
  566. end)
  567.  
  568. Object.MouseLeave:Connect(function()
  569. if Image then
  570. TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
  571. ImageColor3 = BaseColor
  572. }):Play()
  573. else
  574. TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
  575. BackgroundColor3 = BaseColor
  576. }):Play()
  577. end
  578. end)
  579.  
  580. Object.MouseButton1Down:Connect(function()
  581. if Image then
  582. TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
  583. ImageColor3 = Color3.new(BaseColor.R * 0.8, BaseColor.G * 0.8, BaseColor.B * 0.8)
  584. }):Play()
  585. else
  586. TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
  587. BackgroundColor3 = Color3.new(BaseColor.R * 0.8, BaseColor.G * 0.8, BaseColor.B * 0.8)
  588. }):Play()
  589. end
  590. end)
  591.  
  592. Object.MouseButton1Up:Connect(function()
  593. if Image then
  594. TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
  595. ImageColor3 = BaseColor
  596. }):Play()
  597. else
  598. TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
  599. BackgroundColor3 = BaseColor
  600. }):Play()
  601. end
  602. end)
  603. end
  604. end
  605.  
  606. function KeylimeLibrary.new(Title)
  607. if not Title then Title = "Keylime Hub" end
  608.  
  609. local Keylime = {}
  610.  
  611. Keylime.Frame = CreateBaseObject("Window")
  612. Keylime.Opened = true
  613.  
  614. local KeylimeMainFrame = Keylime.Frame.MainFrame
  615. local CanDrag = false
  616. local Dragging = false
  617. local MouseOffset
  618.  
  619. AnimateButton(KeylimeMainFrame.Minimize)
  620. KeylimeMainFrame.Decor.Title.Text = Title
  621. KeylimeMainFrame.ClipsDescendants = true
  622.  
  623. KeylimeMainFrame.Minimize.MouseButton1Down:Connect(function()
  624. Keylime.Opened = not Keylime.Opened
  625.  
  626. if Keylime.Opened then
  627. KeylimeMainFrame:TweenSize(UDim2.new(0, 200, 0, math.clamp(KeylimeMainFrame.Content.UIListLayout.AbsoluteContentSize.Y + 45, 0, 350)), "Out", "Sine", 0.3, true)
  628. TweenService:Create(KeylimeMainFrame.Minimize, TweenInfo.new(0.3), {Rotation = 0}):Play()
  629. else
  630. KeylimeMainFrame:TweenSize(UDim2.new(0, 200, 0, 37), "Out", "Sine", 0.3, true)
  631. TweenService:Create(KeylimeMainFrame.Minimize, TweenInfo.new(0.3), {Rotation = 180}):Play()
  632. end
  633. end)
  634.  
  635. KeylimeMainFrame.Decor.Title.MouseEnter:Connect(function()
  636. CanDrag = true
  637. end)
  638.  
  639. KeylimeMainFrame.Decor.Title.MouseLeave:Connect(function()
  640. CanDrag = false
  641. end)
  642.  
  643. local function DragLoop()
  644. while MouseOffset and Dragging do
  645. wait()
  646. KeylimeMainFrame:TweenPosition(UDim2.new(0, Mouse.X - MouseOffset.X, 0, Mouse.Y - MouseOffset.Y), "Out", "Sine", 0.1, true)
  647. end
  648.  
  649. KeylimeMainFrame:TweenPosition(UDim2.new(0, Mouse.X - MouseOffset.X, 0, Mouse.Y - MouseOffset.Y), "Out", "Sine", 0.1, true)
  650. MouseOffset = nil
  651. end
  652.  
  653. UserInputService.InputBegan:Connect(function(Input)
  654. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  655. if CanDrag then
  656. MouseOffset = {X = Mouse.X - KeylimeMainFrame.AbsolutePosition.X, Y = Mouse.Y - KeylimeMainFrame.AbsolutePosition.Y}
  657. Dragging = true
  658. DragLoop()
  659. end
  660. end
  661. end)
  662.  
  663. UserInputService.InputEnded:Connect(function(Input)
  664. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  665. if Dragging then
  666. Dragging = false
  667. end
  668. end
  669. end)
  670.  
  671. KeylimeMainFrame.Content.UIListLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  672. KeylimeMainFrame.Size = UDim2.new(0, 200, 0, math.clamp(KeylimeMainFrame.Content.UIListLayout.AbsoluteContentSize.Y + 45, 0, 350))
  673. KeylimeMainFrame.Content.CanvasSize = UDim2.new(0, 0, 0, KeylimeMainFrame.Content.UIListLayout.AbsoluteContentSize.Y + 4)
  674. end)
  675.  
  676. function Keylime:Create(Class, Title, Callback, Metadata)
  677. if string.lower(Class) == "button" then
  678. local Button = CreateBaseObject("Button")
  679.  
  680. AnimateButton(Button, Button.Roundify)
  681. Button.Text = Title or "Button"
  682. Button.Parent = KeylimeMainFrame.Content
  683.  
  684. if Callback then
  685. Button.MouseButton1Click:Connect(function()
  686. pcall(Callback)
  687. end)
  688. end
  689. elseif string.lower(Class) == "toggle" then
  690. local Data = {}
  691.  
  692. Data.Value = false
  693.  
  694. if Metadata and Metadata.Default then
  695. Data.Value = Metadata.Default
  696. end
  697.  
  698. local Toggle = CreateBaseObject("Toggle")
  699.  
  700. AnimateButton(Toggle, Toggle.Frame)
  701. Toggle.Frame.Checkmark.TextTransparency = Data.Value and 0 or 1
  702. Toggle.Title.Text = Title or "Toggle"
  703. Toggle.Parent = KeylimeMainFrame.Content
  704.  
  705. Toggle.MouseButton1Click:Connect(function()
  706. Data.Value = not Data.Value
  707. TweenService:Create(Toggle.Frame.Checkmark, TweenInfo.new(0.2), {TextTransparency = Data.Value and 0 or 1}):Play()
  708.  
  709. if Callback then
  710. pcall(Callback, Data.Value)
  711. end
  712. end)
  713. elseif string.lower(Class) == "slider" then
  714. local Data = {}
  715.  
  716. Data.Value = 0
  717. Data.MinValue = 0
  718. Data.MaxValue = 1
  719.  
  720. if Metadata then
  721. if Metadata.Default then
  722. Data.Value = Metadata.Default
  723. end
  724.  
  725. if Metadata.MinValue then
  726. Data.MinValue = Metadata.MinValue
  727. end
  728.  
  729. if Metadata.MaxValue then
  730. Data.MaxValue = Metadata.MaxValue
  731. end
  732. end
  733.  
  734. local Slider = CreateBaseObject("Slider")
  735.  
  736. AnimateButton(Slider, Slider.SliderHolder)
  737. Slider.Title.Text = Title or "Slider"
  738. Slider.SliderHolder.Value.Text = math.clamp(Data.Value, Data.MinValue, Data.MaxValue)
  739. Slider.SliderHolder.SliderBar.Size = UDim2.new(math.clamp(Data.Value / Data.MaxValue, 0, 1), 0, 1, 0)
  740. Slider.Parent = KeylimeMainFrame.Content
  741.  
  742. local CurrentAnchor
  743. local Break = false
  744.  
  745. local function MouseLoop()
  746. local Difference = 0
  747.  
  748. while CurrentAnchor do
  749. wait()
  750. if Break == true then Break = false break end
  751. Difference = (Mouse.X - CurrentAnchor) / Slider.SliderHolder.AbsoluteSize.X
  752. Slider.SliderHolder.Value.Text = math.floor(math.clamp(Data.Value + (Difference * Slider.SliderHolder.AbsoluteSize.X), Data.MinValue, Data.MaxValue))
  753. Slider.SliderHolder.SliderBar.Size = UDim2.new((math.clamp((Data.Value + (Difference * Slider.SliderHolder.AbsoluteSize.X)) / Data.MaxValue, 0, 1)), 0, 1, 0)
  754. end
  755.  
  756. Data.Value = math.clamp(Data.Value + (Difference * Slider.SliderHolder.AbsoluteSize.X), Data.MinValue, Data.MaxValue)
  757. end
  758.  
  759. Slider.MouseButton1Down:Connect(function()
  760. Break = false
  761. CurrentAnchor = Mouse.X
  762. MouseLoop()
  763. end)
  764.  
  765. UserInputService.InputEnded:Connect(function(Input)
  766. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  767. if not Break and CurrentAnchor then
  768. CurrentAnchor = nil
  769. Break = true
  770.  
  771. if Callback then
  772. wait() wait()
  773. pcall(Callback, Data.Value)
  774. end
  775. end
  776. end
  777. end)
  778.  
  779. Mouse.Button1Up:Connect(function()
  780. if not Break and CurrentAnchor then
  781. CurrentAnchor = nil
  782. Break = true
  783.  
  784. if Callback then
  785. wait() wait()
  786. pcall(Callback, Data.Value)
  787. end
  788. end
  789. end)
  790. elseif string.lower(Class) == "textbox" then
  791. local Data = {}
  792.  
  793. Data.Value = ""
  794.  
  795. if Metadata then
  796. if Metadata.Default then
  797. Data.Value = Metadata.Default
  798. end
  799. end
  800.  
  801. local TextBox = CreateBaseObject("TextBox")
  802.  
  803. AnimateButton(TextBox, TextBox.Roundify)
  804. TextBox.PlaceholderText = Title
  805. TextBox.Text = Data.Value
  806. TextBox.Parent = KeylimeMainFrame.Content
  807.  
  808. TextBox.FocusLost:Connect(function()
  809. Data.Value = TextBox.Text
  810. pcall(Callback, Data.Value)
  811. end)
  812. elseif string.lower(Class) == "dropdown" then
  813. local Data = {}
  814.  
  815. Data.Value = ""
  816. Data.Options = {}
  817.  
  818. if Metadata then
  819. if Metadata.Default then
  820. Data.Value = Metadata.Default
  821. end
  822.  
  823. if Metadata.Options and type(Metadata.Options) == "table" then
  824. Data.Options = Metadata.Options
  825. end
  826. end
  827.  
  828. local Dropped = false
  829. local Dropdown = CreateBaseObject("Dropdown")
  830.  
  831. AnimateButton(Dropdown, Dropdown.DropdownHolder.DropdownOptions)
  832.  
  833. Dropdown.Title.Text = Title
  834. Dropdown.DropdownHolder.Value.Text = Data.Value
  835.  
  836. local function AnimateDropdown(Status)
  837. if Status then
  838. local DropdownOptions = Dropdown.DropdownHolder.DropdownOptions
  839.  
  840. TweenService:Create(Dropdown.DropdownHolder.Minimize, TweenInfo.new(0.3), {Rotation = 180}):Play()
  841. DropdownOptions:TweenSize(UDim2.new(1,0,0,math.clamp(DropdownOptions.Content.UIListLayout.AbsoluteContentSize.Y + 30, 0, 150)), "Out", "Sine", 0.15, true)
  842. else
  843. local DropdownOptions = Dropdown.DropdownHolder.DropdownOptions
  844.  
  845. TweenService:Create(Dropdown.DropdownHolder.Minimize, TweenInfo.new(0.3), {Rotation = 0}):Play()
  846. DropdownOptions:TweenSize(UDim2.new(1,0,0,math.clamp(30, 0, 150)), "Out", "Sine", 0.15, true)
  847. end
  848. end
  849.  
  850. for _, Option in next, Data.Options do
  851. local DropdownOption = CreateBaseObject("DropdownOption")
  852.  
  853. DropdownOption.Text = tostring(Option)
  854. DropdownOption.Parent = Dropdown.DropdownHolder.DropdownOptions.Content
  855.  
  856. local BaseColor = DropdownOption.TextColor3
  857.  
  858. DropdownOption.MouseEnter:Connect(function()
  859. TweenService:Create(DropdownOption, TweenInfo.new(0.2), {
  860. TextColor3 = Color3.new(BaseColor.R * 1.1, BaseColor.G * 1.1, BaseColor.B * 1.1)
  861. }):Play()
  862. end)
  863.  
  864. DropdownOption.MouseLeave:Connect(function()
  865. TweenService:Create(DropdownOption, TweenInfo.new(0.2), {
  866. TextColor3 = BaseColor
  867. }):Play()
  868. end)
  869.  
  870. DropdownOption.MouseButton1Down:Connect(function()
  871. TweenService:Create(DropdownOption, TweenInfo.new(0.2), {
  872. TextColor3 = Color3.new(BaseColor.R * 0.8, BaseColor.G * 0.8, BaseColor.B * 0.8)
  873. }):Play()
  874. end)
  875.  
  876. DropdownOption.MouseButton1Up:Connect(function()
  877. TweenService:Create(DropdownOption, TweenInfo.new(0.2), {
  878. TextColor3 = BaseColor
  879. }):Play()
  880. end)
  881.  
  882. DropdownOption.MouseButton1Click:Connect(function()
  883. if Dropped then
  884. Dropped = false
  885. Data.Value = Option
  886. Dropdown.DropdownHolder.Value.Text = Data.Value
  887. AnimateDropdown(false)
  888.  
  889. if Callback then
  890. pcall(Callback, Data.Value)
  891. end
  892. end
  893. end)
  894.  
  895. Dropdown.DropdownHolder.DropdownOptions.Content.CanvasSize = UDim2.new(0, 0, 0, Dropdown.DropdownHolder.DropdownOptions.Content.UIListLayout.AbsoluteContentSize.Y)
  896. end
  897.  
  898. Dropdown.MouseButton1Click:Connect(function()
  899. Dropped = not Dropped
  900. AnimateDropdown(Dropped)
  901. end)
  902. Dropdown.DropdownHolder.Minimize.MouseButton1Click:Connect(function()
  903. Dropped = not Dropped
  904. AnimateDropdown(Dropped)
  905. end)
  906.  
  907. Dropdown.Parent = KeylimeMainFrame.Content
  908. end
  909. end
  910.  
  911. return Keylime
  912. end
  913.  
  914. return KeylimeLibrary
  915.  
  916.  
  917.  
  918.  
  919.  
Add Comment
Please, Sign In to add comment