moneyinvester

Untitled

Nov 19th, 2025
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 14.17 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local UserInputService = game:GetService("UserInputService")
  3. local RunService = game:GetService("RunService")
  4. local TweenService = game:GetService("TweenService")
  5. local Core = game:GetService("CoreGui")
  6. local Camera = workspace.CurrentCamera
  7. local Player = Players.LocalPlayer
  8. local Mouse = Player:GetMouse()
  9.  
  10. local v2, v3 = Vector2.new, Vector3.new
  11. local udim2, udim = UDim2.new, UDim.new
  12. local rgb = Color3.fromRGB
  13.  
  14. local Colors = {
  15.     Primary = rgb(0, 153, 255),       -- Framer blue
  16.     PrimaryHover = rgb(0, 102, 204),  -- darker blue for hover
  17.     Background = rgb(26, 26, 26),     -- dark background
  18.     Surface = rgb(40, 40, 40),        -- panels / cards
  19.     Border = rgb(70, 70, 70),         -- subtle borders
  20.     TextPrimary = rgb(230, 230, 230), -- main text
  21.     TextSecondary = rgb(160, 160, 160), -- secondary text
  22.     TextTertiary = rgb(120, 120, 120),  -- tertiary / muted text
  23.     Divider = rgb(60, 60, 60),        -- divider lines
  24.     Hover = rgb(50, 50, 50)           -- hover background for panels/buttons
  25. }
  26.  
  27.  
  28. local Modern = {}
  29. Modern.__index = Modern
  30.  
  31. local function create(class, props)
  32.     local obj = Instance.new(class)
  33.     if props then
  34.         for k,v in pairs(props) do
  35.             obj[k] = v
  36.         end
  37.     end
  38.     return obj
  39. end
  40.  
  41. local function tween(obj, props, time, style, dir)
  42.     local t = TweenService:Create(obj, TweenInfo.new(time or 0.2, style or Enum.EasingStyle.Quad, dir or Enum.EasingDirection.Out), props)
  43.     t:Play()
  44.     return t
  45. end
  46.  
  47. local function roundCorners(parent, radius)
  48.     local uc = create("UICorner", {Parent = parent, CornerRadius = UDim.new(0, radius or 8)})
  49.     return uc
  50. end
  51.  
  52. local function subtleStroke(parent, color, thickness)
  53.     local s = create("UIStroke", {
  54.         Parent = parent,
  55.         Color = color or Colors.Border,
  56.         Thickness = thickness or 1,
  57.         Transparency = 0.6
  58.     })
  59.     return s
  60. end
  61.  
  62. local Library = {
  63.     Flags = {},
  64.     Conns = {},
  65.     ScreenGui = nil,
  66.     TweenSpeed = 0.2
  67. }
  68. Library.__index = Library
  69.  
  70. function Library:Connect(signal, fn)
  71.     local c = signal:Connect(fn)
  72.     table.insert(self.Conns, c)
  73.     return c
  74. end
  75.  
  76. function Library:Unload()
  77.     for _,c in ipairs(self.Conns) do pcall(function() c:Disconnect() end) end
  78.     if self.ScreenGui then pcall(function() self.ScreenGui:Destroy() end) end
  79. end
  80.  
  81. function Library:Window(opts)
  82.     opts = opts or {}
  83.     local win = {}
  84.     win.Name = opts.Name or "Liza"
  85.     win.Size = opts.Size or udim2(0, 800, 0, 560)
  86.     win.Tabs = {}
  87.     win.CurrentTab = nil
  88.  
  89.     if self.ScreenGui then self.ScreenGui:Destroy() end
  90.     self.ScreenGui = create("ScreenGui", {
  91.         Parent = Core,
  92.         ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
  93.         IgnoreGuiInset = true
  94.     })
  95.  
  96.     -- Main container with subtle shadow effect
  97.     local container = create("Frame", {
  98.         Parent = self.ScreenGui,
  99.         Size = win.Size,
  100.         Position = udim2(0.5, -win.Size.X.Offset/2, 0.5, -win.Size.Y.Offset/2),
  101.         BackgroundColor3 = Colors.Surface,
  102.         BorderSizePixel = 0,
  103.         ClipsDescendants = true
  104.     })
  105.     roundCorners(container, 12)
  106.     subtleStroke(container, Colors.Border)
  107.  
  108.     -- Header
  109.     local header = create("Frame", {
  110.         Parent = container,
  111.         Size = udim2(1, 0, 0, 56),
  112.         Position = udim2(0, 0, 0, 0),
  113.         BackgroundColor3 = Colors.Surface,
  114.         BorderSizePixel = 0
  115.     })
  116.    
  117.     local divider = create("Frame", {
  118.         Parent = header,
  119.         Size = udim2(1, 0, 0, 1),
  120.         Position = udim2(0, 0, 1, -1),
  121.         BackgroundColor3 = Colors.Divider,
  122.         BorderSizePixel = 0
  123.     })
  124.  
  125.     local title = create("TextLabel", {
  126.         Parent = header,
  127.         Position = udim2(0, 24, 0.5, 0),
  128.         AnchorPoint = v2(0, 0.5),
  129.         BackgroundTransparency = 1,
  130.         Text = win.Name,
  131.         Font = Enum.Font.SourceSansBold,
  132.         TextSize = 20,
  133.         TextColor3 = Colors.TextPrimary
  134.     })
  135.  
  136.     -- Sidebar
  137.     local sidebar = create("Frame", {
  138.         Parent = container,
  139.         Size = udim2(0, 200, 1, -56),
  140.         Position = udim2(0, 0, 0, 56),
  141.         BackgroundColor3 = Colors.Background,
  142.         BorderSizePixel = 0
  143.     })
  144.  
  145.     local sidebarDivider = create("Frame", {
  146.         Parent = sidebar,
  147.         Size = udim2(0, 1, 1, 0),
  148.         Position = udim2(1, -1, 0, 0),
  149.         BackgroundColor3 = Colors.Divider,
  150.         BorderSizePixel = 0
  151.     })
  152.  
  153.     local tabHolder = create("Frame", {
  154.         Parent = sidebar,
  155.         Size = udim2(1, -16, 1, -24),
  156.         Position = udim2(0, 16, 0, 16),
  157.         BackgroundTransparency = 1,
  158.     })
  159.  
  160.     local list = create("UIListLayout", {
  161.         Parent = tabHolder,
  162.         Padding = UDim.new(0, 4),
  163.         HorizontalAlignment = Enum.HorizontalAlignment.Left
  164.     })
  165.  
  166.     -- Content area
  167.     local contentArea = create("ScrollingFrame", {
  168.         Parent = container,
  169.         Size = udim2(1, -216, 1, -72),
  170.         Position = udim2(0, 200, 0, 56),
  171.         BackgroundTransparency = 1,
  172.         ScrollBarThickness = 3,
  173.         ScrollBarImageColor3 = Colors.Border,
  174.         BorderSizePixel = 0,
  175.         CanvasSize = UDim2.new(0, 0, 0, 0)
  176.     })
  177.  
  178.     local contentLayout = create("UIListLayout", {
  179.         Parent = contentArea,
  180.         Padding = UDim.new(0, 16),
  181.         SortOrder = Enum.SortOrder.LayoutOrder
  182.     })
  183.  
  184.     contentLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  185.         contentArea.CanvasSize = UDim2.new(0, 0, 0, contentLayout.AbsoluteContentSize.Y + 20)
  186.     end)
  187.  
  188.     win.Root = container
  189.     win.Header = header
  190.     win.Title = title
  191.     win.Sidebar = sidebar
  192.     win.TabHolder = tabHolder
  193.     win.Content = contentArea
  194.  
  195.     -- Dragging functionality
  196.     do
  197.         local dragging, start, startPos
  198.         header.InputBegan:Connect(function(input)
  199.             if input.UserInputType == Enum.UserInputType.MouseButton1 then
  200.                 dragging = true
  201.                 start = input.Position
  202.                 startPos = container.Position
  203.             end
  204.         end)
  205.        
  206.         header.InputEnded:Connect(function(input)
  207.             if input.UserInputType == Enum.UserInputType.MouseButton1 then
  208.                 dragging = false
  209.             end
  210.         end)
  211.        
  212.         self:Connect(UserInputService.InputChanged, function(input)
  213.             if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  214.                 local delta = input.Position - start
  215.                 container.Position = UDim2.new(
  216.                     startPos.X.Scale, startPos.X.Offset + delta.X,
  217.                     startPos.Y.Scale, startPos.Y.Offset + delta.Y
  218.                 )
  219.             end
  220.         end)
  221.     end
  222.  
  223.     return setmetatable(win, Library)
  224. end
  225.  
  226. -- Tab methods
  227. function Library:Tab(opts)
  228.     opts = opts or {}
  229.     local tab = {}
  230.     tab.Name = opts.Name or "Tab"
  231.     tab.Icon = opts.Icon or ""
  232.  
  233.     -- Create tab button
  234.     local tabBtn = create("TextButton", {
  235.         Parent = self.TabHolder,
  236.         Size = udim2(1, 0, 0, 40),
  237.         BackgroundColor3 = Colors.Background,
  238.         AutoButtonColor = false,
  239.         Text = "",
  240.         BorderSizePixel = 0,
  241.         LayoutOrder = #self.Tabs
  242.     })
  243.     roundCorners(tabBtn, 6)
  244.  
  245.     local btnContent = create("Frame", {
  246.         Parent = tabBtn,
  247.         Size = udim2(1, -16, 1, -8),
  248.         Position = udim2(0, 8, 0, 4),
  249.         BackgroundTransparency = 1
  250.     })
  251.  
  252.     local btnTitle = create("TextLabel", {
  253.         Parent = btnContent,
  254.         Size = udim2(1, 0, 1, 0),
  255.         BackgroundTransparency = 1,
  256.         Text = tab.Name,
  257.         Font = Enum.Font.SourceSans,
  258.         TextSize = 14,
  259.         TextColor3 = Colors.TextSecondary,
  260.         TextXAlignment = Enum.TextXAlignment.Left
  261.     })
  262.  
  263.     -- Create tab content frame
  264.     local content = create("Frame", {
  265.         Parent = self.Content,
  266.         Size = udim2(1, 0, 0, 0),
  267.         BackgroundTransparency = 1,
  268.         Visible = false
  269.     })
  270.  
  271.     local contentList = create("UIListLayout", {
  272.         Parent = content,
  273.         Padding = UDim.new(0, 16),
  274.         SortOrder = Enum.SortOrder.LayoutOrder
  275.     })
  276.  
  277.     tab.Btn = tabBtn
  278.     tab.Content = content
  279.     tab.Elements = {}
  280.  
  281.     -- Hover effects
  282.     self:Connect(tabBtn.MouseEnter, function()
  283.         if self.CurrentTab ~= tab then
  284.             tween(tabBtn, {BackgroundColor3 = Colors.Hover})
  285.             tween(btnTitle, {TextColor3 = Colors.TextPrimary})
  286.         end
  287.     end)
  288.  
  289.     self:Connect(tabBtn.MouseLeave, function()
  290.         if self.CurrentTab ~= tab then
  291.             tween(tabBtn, {BackgroundColor3 = Colors.Background})
  292.             tween(btnTitle, {TextColor3 = Colors.TextSecondary})
  293.         end
  294.     end)
  295.  
  296.     -- Tab switch logic
  297.     self:Connect(tabBtn.MouseButton1Click, function()
  298.         self:SwitchTab(tab)
  299.     end)
  300.  
  301.     table.insert(self.Tabs, tab)
  302.  
  303.     -- Set first tab as active
  304.     if #self.Tabs == 1 then
  305.         self:SwitchTab(tab)
  306.     end
  307.  
  308.     return setmetatable(tab, {__index = Library.TabMethods})
  309. end
  310.  
  311. -- Tab methods table
  312. Library.TabMethods = {}
  313.  
  314. function Library.TabMethods:Section(opts)
  315.     opts = opts or {}
  316.    
  317.     local section = create("Frame", {
  318.         Parent = self.Content,
  319.         Size = udim2(1, 0, 0, 32),
  320.         BackgroundTransparency = 1,
  321.         LayoutOrder = #self.Elements
  322.     })
  323.  
  324.     local sectionLabel = create("TextLabel", {
  325.         Parent = section,
  326.         Size = udim2(1, 0, 1, 0),
  327.         BackgroundTransparency = 1,
  328.         Text = string.upper(opts.Name or "SECTION"),
  329.         Font = Enum.Font.SourceSansSemibold,
  330.         TextSize = 12,
  331.         TextColor3 = Colors.TextTertiary,
  332.         TextXAlignment = Enum.TextXAlignment.Left
  333.     })
  334.  
  335.     table.insert(self.Elements, section)
  336.     return section
  337. end
  338.  
  339. function Library.TabMethods:Button(opts)
  340.     opts = opts or {}
  341.    
  342.     local button = create("TextButton", {
  343.         Parent = self.Content,
  344.         Size = udim2(1, 0, 0, 42),
  345.         BackgroundColor3 = Colors.Surface,
  346.         AutoButtonColor = false,
  347.         Text = "",
  348.         BorderSizePixel = 0,
  349.         LayoutOrder = #self.Elements
  350.     })
  351.     roundCorners(button, 8)
  352.     subtleStroke(button, Colors.Border)
  353.  
  354.     local btnContent = create("Frame", {
  355.         Parent = button,
  356.         Size = udim2(1, -24, 1, -16),
  357.         Position = udim2(0, 12, 0, 8),
  358.         BackgroundTransparency = 1
  359.     })
  360.  
  361.     local btnTitle = create("TextLabel", {
  362.         Parent = btnContent,
  363.         Size = udim2(1, 0, 1, 0),
  364.         BackgroundTransparency = 1,
  365.         Text = opts.Name or "Button",
  366.         Font = Enum.Font.SourceSans,
  367.         TextSize = 14,
  368.         TextColor3 = Colors.TextPrimary,
  369.         TextXAlignment = Enum.TextXAlignment.Left
  370.     })
  371.  
  372.     -- Hover effects
  373.     self:Connect(button.MouseEnter, function()
  374.         tween(button, {BackgroundColor3 = Colors.Hover})
  375.     end)
  376.  
  377.     self:Connect(button.MouseLeave, function()
  378.         tween(button, {BackgroundColor3 = Colors.Surface})
  379.     end)
  380.  
  381.     self:Connect(button.MouseButton1Click, function()
  382.         -- Click animation
  383.         tween(button, {BackgroundColor3 = Colors.Primary, TextColor3 = Colors.Surface}, 0.1)
  384.         wait(0.1)
  385.         tween(button, {BackgroundColor3 = Colors.Hover}, 0.1)
  386.        
  387.         if opts.Callback then
  388.             opts.Callback()
  389.         end
  390.     end)
  391.  
  392.     table.insert(self.Elements, button)
  393.     return button
  394. end
  395.  
  396. function Library.TabMethods:Toggle(opts)
  397.     opts = opts or {}
  398.    
  399.     local toggle = create("Frame", {
  400.         Parent = self.Content,
  401.         Size = udim2(1, 0, 0, 42),
  402.         BackgroundTransparency = 1,
  403.         LayoutOrder = #self.Elements
  404.     })
  405.  
  406.     local label = create("TextLabel", {
  407.         Parent = toggle,
  408.         Size = udim2(0.7, 0, 1, 0),
  409.         BackgroundTransparency = 1,
  410.         Text = opts.Name or "Toggle",
  411.         Font = Enum.Font.SourceSans,
  412.         TextSize = 14,
  413.         TextColor3 = Colors.TextPrimary,
  414.         TextXAlignment = Enum.TextXAlignment.Left
  415.     })
  416.  
  417.     local toggleContainer = create("TextButton", {
  418.         Parent = toggle,
  419.         Size = udim2(0, 36, 0, 20),
  420.         Position = udim2(1, -36, 0.5, -10),
  421.         AnchorPoint = Vector2.new(1, 0.5),
  422.         BackgroundColor3 = Colors.Border,
  423.         AutoButtonColor = false,
  424.         Text = "",
  425.         BorderSizePixel = 0
  426.     })
  427.     roundCorners(toggleContainer, 10)
  428.  
  429.     local toggleCircle = create("Frame", {
  430.         Parent = toggleContainer,
  431.         Size = udim2(0, 16, 0, 16),
  432.         Position = udim2(0, 2, 0.5, -8),
  433.         AnchorPoint = Vector2.new(0, 0.5),
  434.         BackgroundColor3 = Colors.Surface,
  435.         BorderSizePixel = 0
  436.     })
  437.     roundCorners(toggleCircle, 8)
  438.  
  439.     local state = opts.Default or false
  440.  
  441.     local function updateToggle()
  442.         if state then
  443.             tween(toggleContainer, {BackgroundColor3 = Colors.Primary})
  444.             tween(toggleCircle, {Position = UDim2.new(1, -18, 0.5, -8), BackgroundColor3 = Colors.Surface})
  445.         else
  446.             tween(toggleContainer, {BackgroundColor3 = Colors.Border})
  447.             tween(toggleCircle, {Position = UDim2.new(0, 2, 0.5, -8), BackgroundColor3 = Colors.Surface})
  448.         end
  449.     end
  450.  
  451.     updateToggle()
  452.  
  453.     self:Connect(toggleContainer.MouseButton1Click, function()
  454.         state = not state
  455.         updateToggle()
  456.         if opts.Callback then
  457.             opts.Callback(state)
  458.         end
  459.     end)
  460.  
  461.     table.insert(self.Elements, toggle)
  462.     return toggle
  463. end
  464.  
  465. function Library:SwitchTab(tab)
  466.     if self.CurrentTab then
  467.         self.CurrentTab.Content.Visible = false
  468.         tween(self.CurrentTab.Btn, {BackgroundColor3 = Colors.Background})
  469.         tween(self.CurrentTab.Btn:FindFirstChildOfClass("TextLabel"), {TextColor3 = Colors.TextSecondary})
  470.     end
  471.  
  472.     self.CurrentTab = tab
  473.     tab.Content.Visible = true
  474.     tween(tab.Btn, {BackgroundColor3 = Colors.Primary})
  475.     tween(tab.Btn:FindFirstChildOfClass("TextLabel"), {TextColor3 = Colors.Surface})
  476. end
  477.  
  478. function Library:Toggle()
  479.     if self.Root then
  480.         self.Root.Visible = not self.Root.Visible
  481.     end
  482. end
  483.  
  484. return setmetatable({
  485.     New = function() return Library end,
  486. }, {__call = function(_, ...) return Library end})
Advertisement
Add Comment
Please, Sign In to add comment