kill21_2

FLexUI

Apr 26th, 2025 (edited)
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.54 KB | None | 0 0
  1. local Kavo = {}
  2.  
  3. -- Services
  4. local tween = game:GetService("TweenService")
  5. local tweeninfo = TweenInfo.new
  6. local input = game:GetService("UserInputService")
  7. local run = game:GetService("RunService")
  8.  
  9. -- Utility
  10. local Utility = {}
  11. local Objects = {}
  12.  
  13. -- Dragging Functionality
  14. function Kavo:DraggingEnabled(frame, parent)
  15. parent = parent or frame
  16.  
  17. local dragging = false
  18. local dragInput, mousePos, framePos
  19.  
  20. frame.InputBegan:Connect(function(input)
  21. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  22. dragging = true
  23. mousePos = input.Position
  24. framePos = parent.Position
  25.  
  26. input.Changed:Connect(function()
  27. if input.UserInputState == Enum.UserInputState.End then
  28. dragging = false
  29. end
  30. end)
  31. end
  32. end)
  33.  
  34. frame.InputChanged:Connect(function(input)
  35. if input.UserInputType == Enum.UserInputType.MouseMovement then
  36. dragInput = input
  37. end
  38. end)
  39.  
  40. input.InputChanged:Connect(function(input)
  41. if input == dragInput and dragging then
  42. local delta = input.Position - mousePos
  43. parent.Position = UDim2.new(framePos.X.Scale, framePos.X.Offset + delta.X, framePos.Y.Scale, framePos.Y.Offset + delta.Y)
  44. end
  45. end)
  46. end
  47.  
  48. -- Tween Utility
  49. function Utility:TweenObject(obj, properties, duration, ...)
  50. tween:Create(obj, tweeninfo(duration, ...), properties):Play()
  51. end
  52.  
  53. -- Theme System
  54. local themes = {
  55. SchemeColor = Color3.fromRGB(100, 120, 180),
  56. Background = Color3.fromRGB(30, 32, 40),
  57. Header = Color3.fromRGB(25, 27, 35),
  58. TextColor = Color3.fromRGB(240, 240, 240),
  59. ElementColor = Color3.fromRGB(40, 42, 50),
  60. AccentColor = Color3.fromRGB(80, 150, 220)
  61. }
  62.  
  63. local themeStyles = {
  64. DarkTheme = {
  65. SchemeColor = Color3.fromRGB(70, 70, 70),
  66. Background = Color3.fromRGB(20, 20, 20),
  67. Header = Color3.fromRGB(15, 15, 15),
  68. TextColor = Color3.fromRGB(240, 240, 240),
  69. ElementColor = Color3.fromRGB(30, 30, 30),
  70. AccentColor = Color3.fromRGB(100, 100, 100)
  71. },
  72. LightTheme = {
  73. SchemeColor = Color3.fromRGB(180, 180, 180),
  74. Background = Color3.fromRGB(240, 240, 240),
  75. Header = Color3.fromRGB(220, 220, 220),
  76. TextColor = Color3.fromRGB(30, 30, 30),
  77. ElementColor = Color3.fromRGB(230, 230, 230),
  78. AccentColor = Color3.fromRGB(150, 150, 150)
  79. },
  80. Ocean = {
  81. SchemeColor = Color3.fromRGB(86, 180, 233),
  82. Background = Color3.fromRGB(20, 40, 60),
  83. Header = Color3.fromRGB(15, 35, 55),
  84. TextColor = Color3.fromRGB(220, 240, 255),
  85. ElementColor = Color3.fromRGB(30, 60, 90),
  86. AccentColor = Color3.fromRGB(100, 200, 255)
  87. },
  88. Midnight = {
  89. SchemeColor = Color3.fromRGB(26, 189, 158),
  90. Background = Color3.fromRGB(30, 50, 70),
  91. Header = Color3.fromRGB(20, 40, 60),
  92. TextColor = Color3.fromRGB(220, 240, 250),
  93. ElementColor = Color3.fromRGB(40, 60, 80),
  94. AccentColor = Color3.fromRGB(100, 220, 180)
  95. },
  96. Synthwave = {
  97. SchemeColor = Color3.fromRGB(255, 100, 200),
  98. Background = Color3.fromRGB(20, 10, 40),
  99. Header = Color3.fromRGB(30, 15, 50),
  100. TextColor = Color3.fromRGB(240, 220, 255),
  101. ElementColor = Color3.fromRGB(40, 20, 60),
  102. AccentColor = Color3.fromRGB(255, 150, 220)
  103. }
  104. }
  105.  
  106. local oldTheme = ""
  107.  
  108. -- Settings
  109. local SettingsT = {}
  110. local Name = "KavoConfig.JSON"
  111.  
  112. pcall(function()
  113. if not pcall(function() readfile(Name) end) then
  114. writefile(Name, game:service'HttpService':JSONEncode(SettingsT))
  115. end
  116. Settings = game:service'HttpService':JSONEncode(readfile(Name))
  117. end)
  118.  
  119. -- UI Creation
  120. local LibName = tostring(math.random(1, 100))..tostring(math.random(1,50))..tostring(math.random(1, 100))
  121.  
  122. function Kavo:ToggleUI()
  123. if game.CoreGui[LibName].Enabled then
  124. game.CoreGui[LibName].Enabled = false
  125. else
  126. game.CoreGui[LibName].Enabled = true
  127. end
  128. end
  129.  
  130. function Kavo.CreateLib(kavName, themeList)
  131. -- Theme setup
  132. if not themeList then themeList = themes end
  133. if type(themeList) == "string" then
  134. themeList = themeStyles[themeList] or themes
  135. else
  136. -- Ensure all required colors are set
  137. themeList.SchemeColor = themeList.SchemeColor or themes.SchemeColor
  138. themeList.Background = themeList.Background or themes.Background
  139. themeList.Header = themeList.Header or themes.Header
  140. themeList.TextColor = themeList.TextColor or themes.TextColor
  141. themeList.ElementColor = themeList.ElementColor or themes.ElementColor
  142. themeList.AccentColor = themeList.AccentColor or themes.AccentColor
  143. end
  144.  
  145. -- Create main UI
  146. kavName = kavName or "Kavo UI"
  147. table.insert(Kavo, kavName)
  148.  
  149. -- Clean up existing UI
  150. for i,v in pairs(game.CoreGui:GetChildren()) do
  151. if v:IsA("ScreenGui") and v.Name == kavName then
  152. v:Destroy()
  153. end
  154. end
  155.  
  156. -- Main container
  157. local ScreenGui = Instance.new("ScreenGui")
  158. ScreenGui.Name = LibName
  159. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  160. ScreenGui.ResetOnSpawn = false
  161.  
  162. -- Main frame with smooth shadow effect
  163. local Main = Instance.new("Frame")
  164. Main.Name = "Main"
  165. Main.Parent = ScreenGui
  166. Main.BackgroundColor3 = themeList.Background
  167. Main.ClipsDescendants = true
  168. Main.Position = UDim2.new(0.35, 0, 0.25, 0)
  169. Main.Size = UDim2.new(0, 550, 0, 350)
  170. Main.ZIndex = 2
  171.  
  172. -- Shadow effect
  173. local Shadow = Instance.new("ImageLabel")
  174. Shadow.Name = "Shadow"
  175. Shadow.Parent = Main
  176. Shadow.BackgroundTransparency = 1
  177. Shadow.Position = UDim2.new(0, -15, 0, -15)
  178. Shadow.Size = UDim2.new(1, 30, 1, 30)
  179. Shadow.Image = "rbxassetid://1316045217"
  180. Shadow.ImageColor3 = Color3.new(0, 0, 0)
  181. Shadow.ImageTransparency = 0.8
  182. Shadow.ScaleType = Enum.ScaleType.Slice
  183. Shadow.SliceCenter = Rect.new(10, 10, 118, 118)
  184. Shadow.ZIndex = 1
  185.  
  186. -- Rounded corners
  187. local MainCorner = Instance.new("UICorner")
  188. MainCorner.CornerRadius = UDim.new(0, 8)
  189. MainCorner.Name = "MainCorner"
  190. MainCorner.Parent = Main
  191.  
  192. -- Header
  193. local MainHeader = Instance.new("Frame")
  194. MainHeader.Name = "MainHeader"
  195. MainHeader.Parent = Main
  196. MainHeader.BackgroundColor3 = themeList.Header
  197. MainHeader.Size = UDim2.new(0, 550, 0, 35)
  198. Objects[MainHeader] = "BackgroundColor3"
  199.  
  200. local headerCover = Instance.new("UICorner")
  201. headerCover.CornerRadius = UDim.new(0, 8)
  202. headerCover.Name = "headerCover"
  203. headerCover.Parent = MainHeader
  204.  
  205. local title = Instance.new("TextLabel")
  206. title.Name = "title"
  207. title.Parent = MainHeader
  208. title.BackgroundTransparency = 1
  209. title.Position = UDim2.new(0.03, 0, 0, 0)
  210. title.Size = UDim2.new(0.5, 0, 1, 0)
  211. title.Font = Enum.Font.GothamSemibold
  212. title.Text = kavName
  213. title.TextColor3 = themeList.TextColor
  214. title.TextSize = 16
  215. title.TextXAlignment = Enum.TextXAlignment.Left
  216.  
  217. -- Close button with hover effect
  218. local close = Instance.new("ImageButton")
  219. close.Name = "close"
  220. close.Parent = MainHeader
  221. close.BackgroundTransparency = 1
  222. close.Position = UDim2.new(0.94, 0, 0.15, 0)
  223. close.Size = UDim2.new(0, 25, 0, 25)
  224. close.ZIndex = 2
  225. close.Image = "rbxassetid://3926305904"
  226. close.ImageRectOffset = Vector2.new(284, 4)
  227. close.ImageRectSize = Vector2.new(24, 24)
  228. close.ImageColor3 = themeList.TextColor
  229.  
  230. close.MouseEnter:Connect(function()
  231. game.TweenService:Create(close, TweenInfo.new(0.1), {
  232. ImageColor3 = Color3.fromRGB(255, 80, 80)
  233. }):Play()
  234. end)
  235.  
  236. close.MouseLeave:Connect(function()
  237. game.TweenService:Create(close, TweenInfo.new(0.1), {
  238. ImageColor3 = themeList.TextColor
  239. }):Play()
  240. end)
  241.  
  242. close.MouseButton1Click:Connect(function()
  243. game.TweenService:Create(close, TweenInfo.new(0.1), {
  244. ImageTransparency = 1
  245. }):Play()
  246. wait()
  247. game.TweenService:Create(Main, TweenInfo.new(0.2), {
  248. Size = UDim2.new(0,0,0,0),
  249. Position = UDim2.new(0, Main.AbsolutePosition.X + (Main.AbsoluteSize.X / 2), 0, Main.AbsolutePosition.Y + (Main.AbsoluteSize.Y / 2))
  250. }):Play()
  251. wait(0.5)
  252. ScreenGui:Destroy()
  253. end)
  254.  
  255. -- Sidebar
  256. local MainSide = Instance.new("Frame")
  257. MainSide.Name = "MainSide"
  258. MainSide.Parent = Main
  259. MainSide.BackgroundColor3 = themeList.Header
  260. Objects[MainSide] = "Header"
  261. MainSide.Position = UDim2.new(0, 0, 0.1, 0)
  262. MainSide.Size = UDim2.new(0, 160, 0, 315)
  263.  
  264. local sideCorner = Instance.new("UICorner")
  265. sideCorner.CornerRadius = UDim.new(0, 8)
  266. sideCorner.Name = "sideCorner"
  267. sideCorner.Parent = MainSide
  268.  
  269. -- Tab container
  270. local tabFrames = Instance.new("Frame")
  271. tabFrames.Name = "tabFrames"
  272. tabFrames.Parent = MainSide
  273. tabFrames.BackgroundTransparency = 1
  274. tabFrames.Position = UDim2.new(0.05, 0, 0.02, 0)
  275. tabFrames.Size = UDim2.new(0.9, 0, 0.96, 0)
  276.  
  277. local tabListing = Instance.new("UIListLayout")
  278. tabListing.Name = "tabListing"
  279. tabListing.Parent = tabFrames
  280. tabListing.SortOrder = Enum.SortOrder.LayoutOrder
  281. tabListing.Padding = UDim.new(0, 8)
  282.  
  283. -- Content area
  284. local pages = Instance.new("Frame")
  285. pages.Name = "pages"
  286. pages.Parent = Main
  287. pages.BackgroundTransparency = 1
  288. pages.Position = UDim2.new(0.3, 0, 0.1, 0)
  289. pages.Size = UDim2.new(0.68, 0, 0.88, 0)
  290.  
  291. local Pages = Instance.new("Folder")
  292. Pages.Name = "Pages"
  293. Pages.Parent = pages
  294.  
  295. -- Info container for tooltips
  296. local infoContainer = Instance.new("Frame")
  297. infoContainer.Name = "infoContainer"
  298. infoContainer.Parent = Main
  299. infoContainer.BackgroundTransparency = 1
  300. infoContainer.Position = UDim2.new(0.3, 0, 0.9, 0)
  301. infoContainer.Size = UDim2.new(0.68, 0, 0.08, 0)
  302.  
  303. -- Blur effect frame
  304. local blurFrame = Instance.new("Frame")
  305. blurFrame.Name = "blurFrame"
  306. blurFrame.Parent = pages
  307. blurFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  308. blurFrame.BackgroundTransparency = 1
  309. blurFrame.Size = UDim2.new(1, 0, 1, 0)
  310. blurFrame.ZIndex = 999
  311.  
  312. -- Enable dragging
  313. Kavo:DraggingEnabled(MainHeader, Main)
  314.  
  315. -- Theme updating
  316. coroutine.wrap(function()
  317. while wait() do
  318. Main.BackgroundColor3 = themeList.Background
  319. MainHeader.BackgroundColor3 = themeList.Header
  320. MainSide.BackgroundColor3 = themeList.Header
  321. title.TextColor3 = themeList.TextColor
  322. close.ImageColor3 = themeList.TextColor
  323. end
  324. end)()
  325.  
  326. -- Color changing function
  327. function Kavo:ChangeColor(property, color)
  328. if themeList[property] then
  329. themeList[property] = color
  330. end
  331. end
  332.  
  333. -- Tab system
  334. local Tabs = {}
  335. local first = true
  336.  
  337. function Tabs:NewTab(tabName)
  338. tabName = tabName or "Tab"
  339.  
  340. -- Tab button
  341. local tabButton = Instance.new("TextButton")
  342. tabButton.Name = tabName.."TabButton"
  343. tabButton.Parent = tabFrames
  344. tabButton.BackgroundColor3 = themeList.SchemeColor
  345. Objects[tabButton] = "SchemeColor"
  346. tabButton.Size = UDim2.new(1, 0, 0, 35)
  347. tabButton.AutoButtonColor = false
  348. tabButton.Font = Enum.Font.GothamSemibold
  349. tabButton.Text = tabName
  350. tabButton.TextColor3 = themeList.TextColor
  351. Objects[tabButton] = "TextColor3"
  352. tabButton.TextSize = 14
  353. tabButton.BackgroundTransparency = 1
  354.  
  355. -- Tab page
  356. local page = Instance.new("ScrollingFrame")
  357. page.Name = "Page"
  358. page.Parent = Pages
  359. page.Active = true
  360. page.BackgroundColor3 = themeList.Background
  361. page.BorderSizePixel = 0
  362. page.Size = UDim2.new(1, 0, 1, 0)
  363. page.ScrollBarThickness = 5
  364. page.Visible = false
  365. page.ScrollBarImageColor3 = themeList.SchemeColor
  366. page.ScrollBarThickness = 4
  367.  
  368. local pageListing = Instance.new("UIListLayout")
  369. pageListing.Name = "pageListing"
  370. pageListing.Parent = page
  371. pageListing.SortOrder = Enum.SortOrder.LayoutOrder
  372. pageListing.Padding = UDim.new(0, 10)
  373.  
  374. -- Rounded corners for tab button
  375. local UICorner = Instance.new("UICorner")
  376. UICorner.CornerRadius = UDim.new(0, 6)
  377. UICorner.Parent = tabButton
  378.  
  379. -- Set first tab as active
  380. if first then
  381. first = false
  382. page.Visible = true
  383. tabButton.BackgroundTransparency = 0
  384. else
  385. page.Visible = false
  386. tabButton.BackgroundTransparency = 1
  387. end
  388.  
  389. -- Tab switching
  390. tabButton.MouseButton1Click:Connect(function()
  391. for i,v in next, Pages:GetChildren() do
  392. v.Visible = false
  393. end
  394. page.Visible = true
  395.  
  396. for i,v in next, tabFrames:GetChildren() do
  397. if v:IsA("TextButton") then
  398. Utility:TweenObject(v, {BackgroundTransparency = 1}, 0.2)
  399. end
  400. end
  401.  
  402. Utility:TweenObject(tabButton, {BackgroundTransparency = 0}, 0.2)
  403. end)
  404.  
  405. -- Update size function
  406. local function UpdateSize()
  407. local cS = pageListing.AbsoluteContentSize
  408. game.TweenService:Create(page, TweenInfo.new(0.15), {
  409. CanvasSize = UDim2.new(0, cS.X, 0, cS.Y)
  410. }):Play()
  411. end
  412.  
  413. UpdateSize()
  414. page.ChildAdded:Connect(UpdateSize)
  415. page.ChildRemoved:Connect(UpdateSize)
  416.  
  417. -- Theme updating for tab
  418. coroutine.wrap(function()
  419. while wait() do
  420. page.BackgroundColor3 = themeList.Background
  421. page.ScrollBarImageColor3 = themeList.SchemeColor
  422. tabButton.TextColor3 = themeList.TextColor
  423. tabButton.BackgroundColor3 = themeList.SchemeColor
  424. end
  425. end)()
  426.  
  427. -- Section system
  428. local Sections = {}
  429. local focusing = false
  430. local viewDe = false
  431.  
  432. function Sections:NewSection(secName, hidden)
  433. secName = secName or "Section"
  434. hidden = hidden or false
  435.  
  436. local sectionFrame = Instance.new("Frame")
  437. sectionFrame.Name = "sectionFrame"
  438. sectionFrame.Parent = page
  439. sectionFrame.BackgroundColor3 = themeList.Background
  440. sectionFrame.BorderSizePixel = 0
  441.  
  442. local sectionlist = Instance.new("UIListLayout")
  443. sectionlist.Name = "sectionlist"
  444. sectionlist.Parent = sectionFrame
  445. sectionlist.SortOrder = Enum.SortOrder.LayoutOrder
  446. sectionlist.Padding = UDim.new(0, 10)
  447.  
  448. -- Section header
  449. local sectionHead = Instance.new("Frame")
  450. sectionHead.Name = "sectionHead"
  451. sectionHead.Parent = sectionFrame
  452. sectionHead.BackgroundColor3 = themeList.SchemeColor
  453. Objects[sectionHead] = "BackgroundColor3"
  454. sectionHead.Size = UDim2.new(1, 0, 0, 35)
  455. sectionHead.Visible = not hidden
  456.  
  457. local sHeadCorner = Instance.new("UICorner")
  458. sHeadCorner.CornerRadius = UDim.new(0, 6)
  459. sHeadCorner.Parent = sectionHead
  460.  
  461. local sectionName = Instance.new("TextLabel")
  462. sectionName.Name = "sectionName"
  463. sectionName.Parent = sectionHead
  464. sectionName.BackgroundTransparency = 1
  465. sectionName.Size = UDim2.new(1, -20, 1, 0)
  466. sectionName.Position = UDim2.new(0, 10, 0, 0)
  467. sectionName.Font = Enum.Font.GothamSemibold
  468. sectionName.Text = secName
  469. sectionName.TextColor3 = themeList.TextColor
  470. Objects[sectionName] = "TextColor3"
  471. sectionName.TextSize = 14
  472. sectionName.TextXAlignment = Enum.TextXAlignment.Left
  473.  
  474. -- Section content
  475. local sectionInners = Instance.new("Frame")
  476. sectionInners.Name = "sectionInners"
  477. sectionInners.Parent = sectionFrame
  478. sectionInners.BackgroundTransparency = 1
  479. sectionInners.Position = UDim2.new(0, 0, 0, hidden and 0 or 40)
  480. sectionInners.Size = UDim2.new(1, 0, 0, 0)
  481.  
  482. local sectionElListing = Instance.new("UIListLayout")
  483. sectionElListing.Name = "sectionElListing"
  484. sectionElListing.Parent = sectionInners
  485. sectionElListing.SortOrder = Enum.SortOrder.LayoutOrder
  486. sectionElListing.Padding = UDim.new(0, 8)
  487.  
  488. -- Update sizes
  489. local function updateSectionFrame()
  490. local innerSc = sectionElListing.AbsoluteContentSize
  491. sectionInners.Size = UDim2.new(1, 0, 0, innerSc.Y)
  492. local frameSc = sectionlist.AbsoluteContentSize
  493. sectionFrame.Size = UDim2.new(1, 0, 0, frameSc.Y)
  494. UpdateSize()
  495. end
  496.  
  497. updateSectionFrame()
  498. UpdateSize()
  499.  
  500. -- Theme updating for section
  501. coroutine.wrap(function()
  502. while wait() do
  503. sectionFrame.BackgroundColor3 = themeList.Background
  504. sectionHead.BackgroundColor3 = themeList.SchemeColor
  505. sectionName.TextColor3 = themeList.TextColor
  506. end
  507. end)()
  508.  
  509. -- Elements
  510. local Elements = {}
  511.  
  512. -- Button element
  513. function Elements:NewButton(bname, tipInf, callback)
  514. bname = bname or "Button"
  515. tipInf = tipInf or "Click this button"
  516. callback = callback or function() end
  517.  
  518. local buttonElement = Instance.new("TextButton")
  519. buttonElement.Name = bname
  520. buttonElement.Parent = sectionInners
  521. buttonElement.BackgroundColor3 = themeList.ElementColor
  522. buttonElement.ClipsDescendants = true
  523. buttonElement.Size = UDim2.new(1, 0, 0, 35)
  524. buttonElement.AutoButtonColor = false
  525. buttonElement.Font = Enum.Font.SourceSans
  526. buttonElement.Text = ""
  527. buttonElement.TextColor3 = Color3.fromRGB(0, 0, 0)
  528. buttonElement.TextSize = 14
  529. Objects[buttonElement] = "BackgroundColor3"
  530.  
  531. local UICorner = Instance.new("UICorner")
  532. UICorner.CornerRadius = UDim.new(0, 6)
  533. UICorner.Parent = buttonElement
  534.  
  535. -- Button icon
  536. local touch = Instance.new("ImageLabel")
  537. touch.Name = "touch"
  538. touch.Parent = buttonElement
  539. touch.BackgroundTransparency = 1
  540. touch.Position = UDim2.new(0.02, 0, 0.18, 0)
  541. touch.Size = UDim2.new(0, 22, 0, 22)
  542. touch.Image = "rbxassetid://3926305904"
  543. touch.ImageColor3 = themeList.SchemeColor
  544. Objects[touch] = "ImageColor3"
  545. touch.ImageRectOffset = Vector2.new(84, 204)
  546. touch.ImageRectSize = Vector2.new(36, 36)
  547.  
  548. -- Button text
  549. local btnInfo = Instance.new("TextLabel")
  550. btnInfo.Name = "btnInfo"
  551. btnInfo.Parent = buttonElement
  552. btnInfo.BackgroundTransparency = 1
  553. btnInfo.Position = UDim2.new(0.1, 0, 0.2, 0)
  554. btnInfo.Size = UDim2.new(0.8, 0, 0.6, 0)
  555. btnInfo.Font = Enum.Font.GothamSemibold
  556. btnInfo.Text = bname
  557. btnInfo.TextColor3 = themeList.TextColor
  558. Objects[btnInfo] = "TextColor3"
  559. btnInfo.TextSize = 14
  560. btnInfo.TextXAlignment = Enum.TextXAlignment.Left
  561.  
  562. -- Info button
  563. local viewInfo = Instance.new("ImageButton")
  564. viewInfo.Name = "viewInfo"
  565. viewInfo.Parent = buttonElement
  566. viewInfo.BackgroundTransparency = 1
  567. viewInfo.Position = UDim2.new(0.93, 0, 0.15, 0)
  568. viewInfo.Size = UDim2.new(0, 24, 0, 24)
  569. viewInfo.ZIndex = 2
  570. viewInfo.Image = "rbxassetid://3926305904"
  571. viewInfo.ImageColor3 = themeList.SchemeColor
  572. Objects[viewInfo] = "ImageColor3"
  573. viewInfo.ImageRectOffset = Vector2.new(764, 764)
  574. viewInfo.ImageRectSize = Vector2.new(36, 36)
  575.  
  576. -- Ripple effect
  577. local Sample = Instance.new("ImageLabel")
  578. Sample.Name = "Sample"
  579. Sample.Parent = buttonElement
  580. Sample.BackgroundTransparency = 1
  581. Sample.Image = "http://www.roblox.com/asset/?id=4560909609"
  582. Sample.ImageColor3 = themeList.SchemeColor
  583. Objects[Sample] = "ImageColor3"
  584. Sample.ImageTransparency = 0.6
  585.  
  586. -- Tooltip
  587. local moreInfo = Instance.new("TextLabel")
  588. moreInfo.Name = "TipMore"
  589. moreInfo.Parent = infoContainer
  590. moreInfo.BackgroundColor3 = Color3.fromRGB(
  591. themeList.SchemeColor.r * 255 - 14,
  592. themeList.SchemeColor.g * 255 - 17,
  593. themeList.SchemeColor.b * 255 - 13
  594. )
  595. moreInfo.Position = UDim2.new(0, 0, 2, 0)
  596. moreInfo.Size = UDim2.new(1, 0, 1, 0)
  597. moreInfo.ZIndex = 9
  598. moreInfo.Font = Enum.Font.GothamSemibold
  599. moreInfo.Text = " "..tipInf
  600. moreInfo.TextColor3 = themeList.TextColor
  601. Objects[moreInfo] = "TextColor3"
  602. moreInfo.TextSize = 14
  603. moreInfo.TextXAlignment = Enum.TextXAlignment.Left
  604. Objects[moreInfo] = "BackgroundColor3"
  605.  
  606. local UICorner = Instance.new("UICorner")
  607. UICorner.CornerRadius = UDim.new(0, 6)
  608. UICorner.Parent = moreInfo
  609.  
  610. -- Adjust text color for light themes
  611. if themeList.SchemeColor == Color3.fromRGB(255,255,255) then
  612. Utility:TweenObject(moreInfo, {TextColor3 = Color3.fromRGB(0,0,0)}, 0.2)
  613. end
  614. if themeList.SchemeColor == Color3.fromRGB(0,0,0) then
  615. Utility:TweenObject(moreInfo, {TextColor3 = Color3.fromRGB(255,255,255)}, 0.2)
  616. end
  617.  
  618. updateSectionFrame()
  619. UpdateSize()
  620.  
  621. -- Button functionality
  622. local ms = game.Players.LocalPlayer:GetMouse()
  623. local btn = buttonElement
  624. local sample = Sample
  625.  
  626. btn.MouseButton1Click:Connect(function()
  627. if not focusing then
  628. callback()
  629.  
  630. -- Ripple effect
  631. local c = sample:Clone()
  632. c.Parent = btn
  633. local x, y = (ms.X - c.AbsolutePosition.X), (ms.Y - c.AbsolutePosition.Y)
  634. c.Position = UDim2.new(0, x, 0, y)
  635.  
  636. local len, size = 0.35, nil
  637. if btn.AbsoluteSize.X >= btn.AbsoluteSize.Y then
  638. size = (btn.AbsoluteSize.X * 1.5)
  639. else
  640. size = (btn.AbsoluteSize.Y * 1.5)
  641. end
  642.  
  643. c:TweenSizeAndPosition(
  644. UDim2.new(0, size, 0, size),
  645. UDim2.new(0.5, (-size / 2), 0.5, (-size / 2)),
  646. 'Out', 'Quad', len, true, nil
  647. )
  648.  
  649. for i = 1, 10 do
  650. c.ImageTransparency = c.ImageTransparency + 0.05
  651. wait(len / 12)
  652. end
  653. c:Destroy()
  654. else
  655. for i,v in next, infoContainer:GetChildren() do
  656. Utility:TweenObject(v, {Position = UDim2.new(0,0,2,0)}, 0.2)
  657. focusing = false
  658. end
  659. Utility:TweenObject(blurFrame, {BackgroundTransparency = 1}, 0.2)
  660. end
  661. end)
  662.  
  663. -- Hover effects
  664. local hovering = false
  665. btn.MouseEnter:Connect(function()
  666. if not focusing then
  667. game.TweenService:Create(btn, TweenInfo.new(0.1), {
  668. BackgroundColor3 = Color3.fromRGB(
  669. themeList.ElementColor.r * 255 + 8,
  670. themeList.ElementColor.g * 255 + 9,
  671. themeList.ElementColor.b * 255 + 10
  672. )
  673. }):Play()
  674. hovering = true
  675. end
  676. end)
  677.  
  678. btn.MouseLeave:Connect(function()
  679. if not focusing then
  680. game.TweenService:Create(btn, TweenInfo.new(0.1), {
  681. BackgroundColor3 = themeList.ElementColor
  682. }):Play()
  683. hovering = false
  684. end
  685. end)
  686.  
  687. -- Tooltip functionality
  688. viewInfo.MouseButton1Click:Connect(function()
  689. if not viewDe then
  690. viewDe = true
  691. focusing = true
  692.  
  693. for i,v in next, infoContainer:GetChildren() do
  694. if v ~= moreInfo then
  695. Utility:TweenObject(v, {Position = UDim2.new(0,0,2,0)}, 0.2)
  696. end
  697. end
  698.  
  699. Utility:TweenObject(moreInfo, {Position = UDim2.new(0,0,0,0)}, 0.2)
  700. Utility:TweenObject(blurFrame, {BackgroundTransparency = 0.5}, 0.2)
  701. Utility:TweenObject(btn, {BackgroundColor3 = themeList.ElementColor}, 0.2)
  702.  
  703. wait(1.5)
  704.  
  705. focusing = false
  706. Utility:TweenObject(moreInfo, {Position = UDim2.new(0,0,2,0)}, 0.2)
  707. Utility:TweenObject(blurFrame, {BackgroundTransparency = 1}, 0.2)
  708.  
  709. wait(0)
  710. viewDe = false
  711. end
  712. end)
  713.  
  714. -- Theme updating for button
  715. coroutine.wrap(function()
  716. while wait() do
  717. if not hovering then
  718. buttonElement.BackgroundColor3 = themeList.ElementColor
  719. end
  720. viewInfo.ImageColor3 = themeList.SchemeColor
  721. Sample.ImageColor3 = themeList.SchemeColor
  722. moreInfo.BackgroundColor3 = Color3.fromRGB(
  723. themeList.SchemeColor.r * 255 - 14,
  724. themeList.SchemeColor.g * 255 - 17,
  725. themeList.SchemeColor.b * 255 - 13
  726. )
  727. moreInfo.TextColor3 = themeList.TextColor
  728. touch.ImageColor3 = themeList.SchemeColor
  729. btnInfo.TextColor3 = themeList.TextColor
  730. end
  731. end)()
  732.  
  733. -- Button update function
  734. local ButtonFunction = {}
  735. function ButtonFunction:UpdateButton(newTitle)
  736. btnInfo.Text = newTitle
  737. end
  738.  
  739. return ButtonFunction
  740. end
  741.  
  742. -- Other element functions (Toggle, Slider, Dropdown, etc.) would follow the same pattern
  743. -- with improved visual design and consistent theming
  744.  
  745. return Elements
  746. end
  747.  
  748. return Sections
  749. end
  750.  
  751. return Tabs
  752. end
  753.  
  754. return Kavo
Add Comment
Please, Sign In to add comment