local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local LocalPlayer = Players.LocalPlayer local PlayerGui = LocalPlayer:WaitForChild("PlayerGui") local oldGui = PlayerGui:FindFirstChild("PlayerStatsGUI") if oldGui then oldGui:Destroy() end local selectedFolders = {} local expandedFolders = {} local expandedPlayers = {} local playerFrames = {} local minimized = false local settingsOpen = false local refreshTree local updateAllStats local function isFolder(obj) return obj:IsA("Folder") or obj:IsA("Configuration") end local function pathKey(path) return table.concat(path, "\31") end local function formatValue(value) if value.Name == "TimePlayed" and typeof(value.Value) == "number" then local seconds = value.Value local days = math.floor(seconds / 86400) local hours = math.floor((seconds % 86400) / 3600) local minutes = math.floor((seconds % 3600) / 60) return string.format("%dd %dh %dm", days, hours, minutes) end return tostring(value.Value) end local function getValueColor(value, folderPath) local name = string.lower(value.Name) if name == "killerlosses" or name == "survivallosses" then return Color3.fromRGB(255, 90, 90) end if name == "objcompleated" or name == "survivalwins" or name == "killerwins" or name == "kills" then return Color3.fromRGB(100, 255, 120) end for _, folderName in ipairs(folderPath) do if string.lower(folderName) == "currency" then return Color3.fromRGB(255, 220, 80) end end return Color3.fromRGB(235, 235, 235) end -- GUI local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "PlayerStatsGUI" ScreenGui.ResetOnSpawn = false ScreenGui.DisplayOrder = 999999 ScreenGui.Parent = PlayerGui local Main = Instance.new("Frame") Main.Name = "Main" Main.Size = UDim2.fromOffset(440, 500) Main.Position = UDim2.new(0.5, -220, 0.5, -250) Main.BackgroundColor3 = Color3.fromRGB(25, 25, 30) Main.BorderSizePixel = 0 Main.Parent = ScreenGui local MainCorner = Instance.new("UICorner") MainCorner.CornerRadius = UDim.new(0, 9) MainCorner.Parent = Main local Top = Instance.new("Frame") Top.Size = UDim2.new(1, 0, 0, 38) Top.BackgroundColor3 = Color3.fromRGB(35, 35, 43) Top.BorderSizePixel = 0 Top.Parent = Main local TopCorner = Instance.new("UICorner") TopCorner.CornerRadius = UDim.new(0, 9) TopCorner.Parent = Top local Title = Instance.new("TextLabel") Title.Size = UDim2.new(1, -130, 1, 0) Title.Position = UDim2.fromOffset(10, 0) Title.BackgroundTransparency = 1 Title.Text = "Ult Player Stats" Title.TextColor3 = Color3.new(1, 1, 1) Title.TextSize = 16 Title.Font = Enum.Font.GothamBold Title.TextXAlignment = Enum.TextXAlignment.Left Title.Parent = Top local function makeButton(parent, text, size, position) local button = Instance.new("TextButton") button.Size = size button.Position = position button.BackgroundColor3 = Color3.fromRGB(55, 55, 65) button.BorderSizePixel = 0 button.Text = text button.TextColor3 = Color3.new(1, 1, 1) button.TextSize = 13 button.Font = Enum.Font.Gotham button.Parent = parent local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 5) corner.Parent = button return button end local SettingsButton = makeButton( Top, "Settings", UDim2.fromOffset(65, 25), UDim2.new(1, -120, 0, 6) ) local MinButton = makeButton( Top, "-", UDim2.fromOffset(25, 25), UDim2.new(1, -48, 0, 6) ) local CloseButton = makeButton( Top, "X", UDim2.fromOffset(25, 25), UDim2.new(1, -25, 0, 6) ) local Content = Instance.new("Frame") Content.Position = UDim2.fromOffset(0, 42) Content.Size = UDim2.new(1, 0, 1, -42) Content.BackgroundTransparency = 1 Content.Parent = Main -- Список игроков local PlayerList = Instance.new("ScrollingFrame") PlayerList.Size = UDim2.new(1, -12, 1, -8) PlayerList.Position = UDim2.fromOffset(6, 4) PlayerList.BackgroundTransparency = 1 PlayerList.BorderSizePixel = 0 PlayerList.ScrollBarThickness = 5 PlayerList.CanvasSize = UDim2.new() PlayerList.AutomaticCanvasSize = Enum.AutomaticSize.Y PlayerList.Parent = Content local PlayerLayout = Instance.new("UIListLayout") PlayerLayout.Padding = UDim.new(0, 5) PlayerLayout.SortOrder = Enum.SortOrder.LayoutOrder PlayerLayout.Parent = PlayerList -- Настройки local SettingsFrame = Instance.new("Frame") SettingsFrame.Size = UDim2.new(1, -12, 1, -8) SettingsFrame.Position = UDim2.fromOffset(6, 4) SettingsFrame.BackgroundTransparency = 1 SettingsFrame.Visible = false SettingsFrame.Parent = Content local BackButton = makeButton( SettingsFrame, "Back", UDim2.fromOffset(65, 27), UDim2.fromOffset(0, 0) ) local RefreshButton = makeButton( SettingsFrame, "Refresh", UDim2.fromOffset(75, 27), UDim2.fromOffset(72, 0) ) local SettingsHint = Instance.new("TextLabel") SettingsHint.Size = UDim2.new(1, -155, 0, 27) SettingsHint.Position = UDim2.fromOffset(153, 0) SettingsHint.BackgroundTransparency = 1 SettingsHint.Text = "Выбери папки для отображения" SettingsHint.TextColor3 = Color3.fromRGB(190, 190, 190) SettingsHint.TextSize = 11 SettingsHint.Font = Enum.Font.Gotham SettingsHint.TextXAlignment = Enum.TextXAlignment.Left SettingsHint.Parent = SettingsFrame local TreeScroll = Instance.new("ScrollingFrame") TreeScroll.Size = UDim2.new(1, 0, 1, -35) TreeScroll.Position = UDim2.fromOffset(0, 35) TreeScroll.BackgroundColor3 = Color3.fromRGB(30, 30, 36) TreeScroll.BorderSizePixel = 0 TreeScroll.ScrollBarThickness = 5 TreeScroll.AutomaticCanvasSize = Enum.AutomaticSize.Y TreeScroll.CanvasSize = UDim2.new() TreeScroll.Parent = SettingsFrame local TreeCorner = Instance.new("UICorner") TreeCorner.CornerRadius = UDim.new(0, 6) TreeCorner.Parent = TreeScroll local TreeContainer = Instance.new("Frame") TreeContainer.Size = UDim2.new(1, -5, 0, 0) TreeContainer.BackgroundTransparency = 1 TreeContainer.AutomaticSize = Enum.AutomaticSize.Y TreeContainer.Parent = TreeScroll local TreeContainerLayout = Instance.new("UIListLayout") TreeContainerLayout.Padding = UDim.new(0, 2) TreeContainerLayout.SortOrder = Enum.SortOrder.LayoutOrder TreeContainerLayout.Parent = TreeContainer -- Перетаскивание окна local dragging = false local dragStart local startPosition Top.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPosition = Main.Position end end) UserInputService.InputChanged:Connect(function(input) if dragging and ( input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch ) then local delta = input.Position - dragStart Main.Position = UDim2.new( startPosition.X.Scale, startPosition.X.Offset + delta.X, startPosition.Y.Scale, startPosition.Y.Offset + delta.Y ) end end) UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false end end) -- Включение и выключение папки вместе со всеми потомками local function setFolderSelection(folder, path, state) local key = pathKey(path) selectedFolders[key] = state for _, child in ipairs(folder:GetChildren()) do if isFolder(child) then local childPath = table.clone(path) table.insert(childPath, child.Name) setFolderSelection(child, childPath, state) end end end -- Построение дерева папок local function createFolderRow(folder, depth, path) local key = pathKey(path) local row = Instance.new("Frame") row.Size = UDim2.new(1, -5, 0, 25) row.BackgroundTransparency = 1 row.Parent = TreeContainer local indent = depth * 15 local hasFolders = false for _, child in ipairs(folder:GetChildren()) do if isFolder(child) then hasFolders = true break end end local arrow = Instance.new("TextButton") arrow.Size = UDim2.fromOffset(20, 23) arrow.Position = UDim2.fromOffset(indent, 0) arrow.BackgroundTransparency = 1 arrow.Text = hasFolders and (expandedFolders[key] and "▼" or "▶") or " " arrow.TextColor3 = Color3.fromRGB(200, 200, 200) arrow.TextSize = 11 arrow.Parent = row local check = Instance.new("TextButton") check.Size = UDim2.fromOffset(22, 23) check.Position = UDim2.fromOffset(indent + 20, 0) check.BackgroundTransparency = 1 check.Text = selectedFolders[key] and "☑" or "☐" check.TextColor3 = selectedFolders[key] and Color3.fromRGB(100, 230, 130) or Color3.fromRGB(180, 180, 180) check.TextSize = 16 check.Parent = row local label = Instance.new("TextLabel") label.Size = UDim2.new(1, -indent - 50, 1, 0) label.Position = UDim2.fromOffset(indent + 45, 0) label.BackgroundTransparency = 1 label.Text = folder.Name label.TextColor3 = Color3.fromRGB(230, 230, 240) label.TextSize = 12 label.Font = Enum.Font.Gotham label.TextXAlignment = Enum.TextXAlignment.Left label.Parent = row -- При нажатии меняем состояние всей ветки check.MouseButton1Click:Connect(function() local newState = not selectedFolders[key] setFolderSelection(folder, path, newState) refreshTree() updateAllStats() end) arrow.MouseButton1Click:Connect(function() if not hasFolders then return end expandedFolders[key] = not expandedFolders[key] refreshTree() end) -- Показываем содержимое раскрытой папки if expandedFolders[key] then local children = folder:GetChildren() table.sort(children, function(a, b) return a.Name:lower() < b.Name:lower() end) for _, child in ipairs(children) do if isFolder(child) then local childPath = table.clone(path) table.insert(childPath, child.Name) local childKey = pathKey(childPath) -- Новые папки наследуют состояние родителя if selectedFolders[childKey] == nil then selectedFolders[childKey] = selectedFolders[key] end createFolderRow(child, depth + 1, childPath) elseif child:IsA("ValueBase") then local valueRow = Instance.new("Frame") valueRow.Size = UDim2.new(1, -5, 0, 21) valueRow.BackgroundTransparency = 1 valueRow.Parent = TreeContainer local valueLabel = Instance.new("TextLabel") valueLabel.Size = UDim2.new(1, -indent - 50, 1, 0) valueLabel.Position = UDim2.fromOffset(indent + 48, 0) valueLabel.BackgroundTransparency = 1 valueLabel.Text = "• " .. child.Name valueLabel.TextColor3 = Color3.fromRGB(145, 165, 185) valueLabel.TextSize = 11 valueLabel.Font = Enum.Font.Gotham valueLabel.TextXAlignment = Enum.TextXAlignment.Left valueLabel.Parent = valueRow end end end end refreshTree = function() for _, child in ipairs(TreeContainer:GetChildren()) do if child:IsA("GuiObject") then child:Destroy() end end local children = LocalPlayer:GetChildren() table.sort(children, function(a, b) return a.Name:lower() < b.Name:lower() end) for _, child in ipairs(children) do if isFolder(child) then local path = {child.Name} local key = pathKey(path) if selectedFolders[key] == nil then selectedFolders[key] = true end createFolderRow(child, 0, path) end end end -- Сбор статистики из выбранных папок local function collectSelectedValues(folder, path, lines) for _, child in ipairs(folder:GetChildren()) do if isFolder(child) then local childPath = table.clone(path) table.insert(childPath, child.Name) local key = pathKey(childPath) -- Если родитель выключен, его содержимое не показываем if selectedFolders[key] then table.insert(lines, { text = " [" .. child.Name .. "]", color = Color3.fromRGB(100, 170, 255) }) for _, value in ipairs(child:GetChildren()) do if value:IsA("ValueBase") then table.insert(lines, { text = " " .. value.Name .. ": " .. formatValue(value), color = getValueColor(value, childPath) }) end end -- Проверяем вложенные папки collectSelectedValues(child, childPath, lines) end end end end local function getStatsText(player) local lines = {} collectSelectedValues(player, {}, lines) if #lines == 0 then table.insert(lines, { text = "Нет выбранных данных", color = Color3.fromRGB(180, 180, 180) }) end return lines end -- Обновление статистики игроков updateAllStats = function() for player, data in pairs(playerFrames) do if expandedPlayers[player] and player.Parent == Players then for _, child in ipairs(data.stats:GetChildren()) do if child:IsA("TextLabel") then child:Destroy() end end local lines = getStatsText(player) for index, line in ipairs(lines) do local label = Instance.new("TextLabel") label.Size = UDim2.new(1, -5, 0, 19) label.BackgroundTransparency = 1 label.Text = line.text label.TextColor3 = line.color label.TextSize = 12 label.Font = Enum.Font.Gotham label.TextXAlignment = Enum.TextXAlignment.Left label.LayoutOrder = index label.Parent = data.stats end -- Высота задаётся заново, а не прибавляется к старой data.card.Size = UDim2.new( 1, -5, 0, 42 + (#lines * 21) ) else if data.card then data.card.Size = UDim2.new(1, -5, 0, 38) end end end end -- Создание карточки игрока local function createPlayerCard(player) if playerFrames[player] then return end local card = Instance.new("Frame") card.Size = UDim2.new(1, -5, 0, 38) card.BackgroundColor3 = Color3.fromRGB(35, 35, 42) card.BorderSizePixel = 0 card.Parent = PlayerList local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 6) corner.Parent = card local toggle = Instance.new("TextButton") toggle.Size = UDim2.new(1, -10, 0, 34) toggle.Position = UDim2.fromOffset(5, 2) toggle.BackgroundTransparency = 1 toggle.Text = "+ " .. player.DisplayName .. " (@" .. player.Name .. ")" toggle.TextColor3 = Color3.new(1, 1, 1) toggle.TextSize = 13 toggle.Font = Enum.Font.Gotham toggle.TextXAlignment = Enum.TextXAlignment.Left toggle.Parent = card local statsFrame = Instance.new("Frame") statsFrame.Position = UDim2.fromOffset(8, 38) statsFrame.Size = UDim2.new(1, -16, 0, 0) statsFrame.AutomaticSize = Enum.AutomaticSize.Y statsFrame.BackgroundTransparency = 1 statsFrame.Visible = false statsFrame.Parent = card local statsLayout = Instance.new("UIListLayout") statsLayout.Padding = UDim.new(0, 2) statsLayout.SortOrder = Enum.SortOrder.LayoutOrder statsLayout.Parent = statsFrame playerFrames[player] = { card = card, toggle = toggle, stats = statsFrame } toggle.MouseButton1Click:Connect(function() local data = playerFrames[player] if not data then return end expandedPlayers[player] = not expandedPlayers[player] -- Закрываем остальные карточки if expandedPlayers[player] then for otherPlayer, otherData in pairs(playerFrames) do if otherPlayer ~= player and expandedPlayers[otherPlayer] then expandedPlayers[otherPlayer] = false otherData.stats.Visible = false otherData.toggle.Text = "+ " .. otherPlayer.DisplayName .. " (@" .. otherPlayer.Name .. ")" otherData.card.Size = UDim2.new(1, -5, 0, 38) otherData.card.LayoutOrder = 0 end end end data.stats.Visible = expandedPlayers[player] data.toggle.Text = (expandedPlayers[player] and "▼ " or "+ ") .. player.DisplayName .. " (@" .. player.Name .. ")" data.card.LayoutOrder = expandedPlayers[player] and -1 or 0 updateAllStats() end) end -- Игроки for _, player in ipairs(Players:GetPlayers()) do createPlayerCard(player) end Players.PlayerAdded:Connect(createPlayerCard) Players.PlayerRemoving:Connect(function(player) local data = playerFrames[player] if data then data.card:Destroy() end playerFrames[player] = nil expandedPlayers[player] = nil end) -- Переключение страниц SettingsButton.MouseButton1Click:Connect(function() settingsOpen = true PlayerList.Visible = false SettingsFrame.Visible = true refreshTree() end) BackButton.MouseButton1Click:Connect(function() settingsOpen = false SettingsFrame.Visible = false PlayerList.Visible = true updateAllStats() end) RefreshButton.MouseButton1Click:Connect(function() refreshTree() end) -- Сворачивание MinButton.MouseButton1Click:Connect(function() minimized = not minimized Content.Visible = not minimized Main.Size = minimized and UDim2.fromOffset(440, 38) or UDim2.fromOffset(440, 500) MinButton.Text = minimized and "+" or "-" end) -- Закрытие GUI CloseButton.MouseButton1Click:Connect(function() ScreenGui:Destroy() end) -- Автоматическое обновление task.spawn(function() while ScreenGui.Parent do if not settingsOpen then updateAllStats() end task.wait(1) end end) refreshTree()