Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Player = game:GetService("Players").LocalPlayer
- local GuiService = game:GetService("GuiService")
- local RunService = game:GetService("RunService")
- local TweenService = game:GetService("TweenService")
- local UserInputService = game:GetService("UserInputService")
- -- Создаем основной GUI
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Name = "StatsGui"
- ScreenGui.ResetOnSpawn = false
- ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- ScreenGui.Parent = Player:WaitForChild("PlayerGui")
- -- Основной фрейм
- local MainFrame = Instance.new("Frame")
- MainFrame.Name = "MainFrame"
- MainFrame.Size = UDim2.new(0, 220, 0, 140)
- MainFrame.Position = UDim2.new(0.5, -110, 0, 20)
- MainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
- MainFrame.BackgroundTransparency = 0.2
- MainFrame.BorderSizePixel = 0
- MainFrame.Active = true
- MainFrame.Draggable = true
- MainFrame.ClipsDescendants = true
- MainFrame.Parent = ScreenGui
- -- Закругление углов
- local UICorner = Instance.new("UICorner")
- UICorner.CornerRadius = UDim.new(0, 8)
- UICorner.Parent = MainFrame
- -- Эффект тени
- local DropShadow = Instance.new("ImageLabel")
- DropShadow.Name = "DropShadow"
- DropShadow.Size = UDim2.new(1, 12, 1, 12)
- DropShadow.Position = UDim2.new(0, -6, 0, -6)
- DropShadow.BackgroundTransparency = 1
- DropShadow.Image = "rbxassetid://5234388158"
- DropShadow.ImageColor3 = Color3.fromRGB(0, 0, 0)
- DropShadow.ImageTransparency = 0.8
- DropShadow.ScaleType = Enum.ScaleType.Slice
- DropShadow.SliceCenter = Rect.new(10, 10, 118, 118)
- DropShadow.Parent = MainFrame
- -- Top Bar
- local TopBar = Instance.new("Frame")
- TopBar.Name = "TopBar"
- TopBar.Size = UDim2.new(1, 0, 0, 30)
- TopBar.Position = UDim2.new(0, 0, 0, 0)
- TopBar.BackgroundColor3 = Color3.fromRGB(45, 45, 60)
- TopBar.BorderSizePixel = 0
- TopBar.Parent = MainFrame
- local UICornerTop = Instance.new("UICorner")
- UICornerTop.CornerRadius = UDim.new(0, 8)
- UICornerTop.Parent = TopBar
- -- Градиент для верхнего бара
- local UIGradient = Instance.new("UIGradient")
- UIGradient.Color = ColorSequence.new({
- ColorSequenceKeypoint.new(0, Color3.fromRGB(80, 80, 120)),
- ColorSequenceKeypoint.new(1, Color3.fromRGB(45, 45, 60))
- })
- UIGradient.Rotation = 90
- UIGradient.Parent = TopBar
- -- Заголовок
- local Title = Instance.new("TextLabel")
- Title.Name = "Title"
- Title.Size = UDim2.new(0, 120, 1, 0)
- Title.Position = UDim2.new(0, 10, 0, 0)
- Title.BackgroundTransparency = 1
- Title.TextColor3 = Color3.fromRGB(255, 255, 255)
- Title.Text = "SYSTEM STATS"
- Title.Font = Enum.Font.GothamBold
- Title.TextSize = 14
- Title.TextXAlignment = Enum.TextXAlignment.Left
- Title.Parent = TopBar
- -- Кнопка закрытия
- local CloseButton = Instance.new("ImageButton")
- CloseButton.Name = "CloseButton"
- CloseButton.Size = UDim2.new(0, 20, 0, 20)
- CloseButton.Position = UDim2.new(1, -25, 0.5, -10)
- CloseButton.BackgroundTransparency = 1
- CloseButton.Image = "rbxassetid://3926305904"
- CloseButton.ImageColor3 = Color3.fromRGB(200, 200, 200)
- CloseButton.ImageRectOffset = Vector2.new(284, 4)
- CloseButton.ImageRectSize = Vector2.new(24, 24)
- CloseButton.Parent = TopBar
- -- Анимация при наведении на кнопку закрытия
- CloseButton.MouseEnter:Connect(function()
- TweenService:Create(CloseButton, TweenInfo.new(0.2), {
- ImageColor3 = Color3.fromRGB(255, 80, 80),
- Rotation = 90
- }):Play()
- end)
- CloseButton.MouseLeave:Connect(function()
- TweenService:Create(CloseButton, TweenInfo.new(0.2), {
- ImageColor3 = Color3.fromRGB(200, 200, 200),
- Rotation = 0
- }):Play()
- end)
- -- Обработчик закрытия окна
- CloseButton.MouseButton1Click:Connect(function()
- local tween = TweenService:Create(MainFrame, TweenInfo.new(0.3), {
- Size = UDim2.new(0, 220, 0, 0),
- Position = UDim2.new(0.5, -110, 0, MainFrame.Position.Y.Offset)
- })
- tween:Play()
- tween.Completed:Wait()
- ScreenGui:Destroy()
- end)
- -- Контейнер для статистики
- local StatsContainer = Instance.new("Frame")
- StatsContainer.Name = "StatsContainer"
- StatsContainer.Size = UDim2.new(1, -20, 1, -40)
- StatsContainer.Position = UDim2.new(0, 10, 0, 35)
- StatsContainer.BackgroundTransparency = 1
- StatsContainer.Parent = MainFrame
- -- Иконка FPS (кликабельная)
- local FpsIcon = Instance.new("ImageButton")
- FpsIcon.Name = "FpsIcon"
- FpsIcon.Size = UDim2.new(0, 20, 0, 20)
- FpsIcon.Position = UDim2.new(0, 0, 0, 10)
- FpsIcon.BackgroundTransparency = 1
- FpsIcon.Image = "rbxassetid://3926305904"
- FpsIcon.ImageColor3 = Color3.fromRGB(100, 180, 255)
- FpsIcon.ImageRectOffset = Vector2.new(964, 324)
- FpsIcon.ImageRectSize = Vector2.new(36, 36)
- FpsIcon.Parent = StatsContainer
- -- Текст FPS
- local FpsText = Instance.new("TextLabel")
- FpsText.Name = "FpsText"
- FpsText.Size = UDim2.new(1, -30, 0, 20)
- FpsText.Position = UDim2.new(0, 25, 0, 10)
- FpsText.BackgroundTransparency = 1
- FpsText.TextColor3 = Color3.fromRGB(255, 255, 255)
- FpsText.Text = "FPS: 0"
- FpsText.Font = Enum.Font.Gotham
- FpsText.TextSize = 14
- FpsText.TextXAlignment = Enum.TextXAlignment.Left
- FpsText.Parent = StatsContainer
- -- Индикатор нагрузки FPS
- local FpsIndicator = Instance.new("Frame")
- FpsIndicator.Name = "FpsIndicator"
- FpsIndicator.Size = UDim2.new(0, 5, 0, 20)
- FpsIndicator.Position = UDim2.new(1, -5, 0, 10)
- FpsIndicator.BackgroundColor3 = Color3.fromRGB(100, 255, 100)
- FpsIndicator.BorderSizePixel = 0
- FpsIndicator.Parent = StatsContainer
- local UICornerIndicator = Instance.new("UICorner")
- UICornerIndicator.CornerRadius = UDim.new(0, 2)
- UICornerIndicator.Parent = FpsIndicator
- -- Иконка времени
- local TimeIcon = Instance.new("ImageLabel")
- TimeIcon.Name = "TimeIcon"
- TimeIcon.Size = UDim2.new(0, 20, 0, 20)
- TimeIcon.Position = UDim2.new(0, 0, 0, 40)
- TimeIcon.BackgroundTransparency = 1
- TimeIcon.Image = "rbxassetid://3926305904"
- TimeIcon.ImageColor3 = Color3.fromRGB(255, 150, 100)
- TimeIcon.ImageRectOffset = Vector2.new(324, 524)
- TimeIcon.ImageRectSize = Vector2.new(36, 36)
- TimeIcon.Parent = StatsContainer
- -- Текст времени
- local TimeText = Instance.new("TextLabel")
- TimeText.Name = "TimeText"
- TimeText.Size = UDim2.new(1, -30, 0, 20)
- TimeText.Position = UDim2.new(0, 25, 0, 40)
- TimeText.BackgroundTransparency = 1
- TimeText.TextColor3 = Color3.fromRGB(255, 255, 255)
- TimeText.Text = "TIME: 00:00:00"
- TimeText.Font = Enum.Font.Gotham
- TimeText.TextSize = 14
- TimeText.TextXAlignment = Enum.TextXAlignment.Left
- TimeText.Parent = StatsContainer
- -- Разделительная линия
- local Divider = Instance.new("Frame")
- Divider.Name = "Divider"
- Divider.Size = UDim2.new(1, 0, 0, 1)
- Divider.Position = UDim2.new(0, 0, 0, 75)
- Divider.BackgroundColor3 = Color3.fromRGB(60, 60, 80)
- Divider.BorderSizePixel = 0
- Divider.Parent = StatsContainer
- -- Фрейм для графика FPS
- local GraphFrame = Instance.new("Frame")
- GraphFrame.Name = "GraphFrame"
- GraphFrame.Size = UDim2.new(1, 0, 0, 50)
- GraphFrame.Position = UDim2.new(0, 0, 0, 80)
- GraphFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 30)
- GraphFrame.BackgroundTransparency = 0.5
- GraphFrame.BorderSizePixel = 0
- GraphFrame.Visible = false
- GraphFrame.Parent = StatsContainer
- local GraphCorner = Instance.new("UICorner")
- GraphCorner.CornerRadius = UDim.new(0, 4)
- GraphCorner.Parent = GraphFrame
- -- Контейнер для линий графика
- local GraphContainer = Instance.new("Frame")
- GraphContainer.Name = "GraphContainer"
- GraphContainer.Size = UDim2.new(1, -10, 1, -10)
- GraphContainer.Position = UDim2.new(0, 5, 0, 5)
- GraphContainer.BackgroundTransparency = 1
- GraphContainer.ClipsDescendants = true
- GraphContainer.Parent = GraphFrame
- -- Текст версии
- local VersionText = Instance.new("TextLabel")
- VersionText.Name = "VersionText"
- VersionText.Size = UDim2.new(1, 0, 0, 20)
- VersionText.Position = UDim2.new(0, 0, 0, 85)
- VersionText.BackgroundTransparency = 1
- VersionText.TextColor3 = Color3.fromRGB(150, 150, 150)
- VersionText.Text = "v2.0 | © 2023"
- VersionText.Font = Enum.Font.Gotham
- VersionText.TextSize = 12
- VersionText.TextXAlignment = Enum.TextXAlignment.Right
- VersionText.Parent = StatsContainer
- -- Переменные для графика
- local fpsHistory = {}
- local maxGraphPoints = 30
- local graphLines = {}
- local isGraphVisible = false
- -- Создаем линии графика заранее
- for i = 1, maxGraphPoints do
- local line = Instance.new("Frame")
- line.Name = "Line_"..i
- line.Size = UDim2.new(0, 4, 0, 0)
- line.Position = UDim2.new(0, (i-1)*6, 1, 0)
- line.AnchorPoint = Vector2.new(0, 1)
- line.BackgroundColor3 = Color3.fromRGB(100, 180, 255)
- line.BorderSizePixel = 0
- line.Visible = false
- line.Parent = GraphContainer
- local lineCorner = Instance.new("UICorner")
- lineCorner.CornerRadius = UDim.new(0, 2)
- lineCorner.Parent = line
- table.insert(graphLines, line)
- end
- -- Функция для обновления графика
- local function updateGraph()
- if not isGraphVisible then return end
- -- Удаляем старые линии (если точек меньше максимума)
- for i = #fpsHistory + 1, maxGraphPoints do
- graphLines[i].Visible = false
- end
- -- Обновляем видимые линии
- for i, fps in ipairs(fpsHistory) do
- local line = graphLines[i]
- line.Visible = true
- -- Нормализуем высоту (макс 60 FPS = полная высота)
- local height = math.clamp(fps / 60 * GraphContainer.AbsoluteSize.Y, 2, GraphContainer.AbsoluteSize.Y)
- -- Плавное изменение высоты
- TweenService:Create(line, TweenInfo.new(0.2), {
- Size = UDim2.new(0, 4, 0, height)
- }):Play()
- -- Изменяем цвет в зависимости от значения
- local color
- if fps > 50 then
- color = Color3.fromRGB(100, 255, 100)
- elseif fps > 30 then
- color = Color3.fromRGB(255, 200, 50)
- else
- color = Color3.fromRGB(255, 80, 80)
- end
- TweenService:Create(line, TweenInfo.new(0.3), {
- BackgroundColor3 = color
- }):Play()
- end
- end
- -- Обработчик клика по иконке FPS
- FpsIcon.MouseButton1Click:Connect(function()
- isGraphVisible = not isGraphVisible
- if isGraphVisible then
- -- Показываем график с анимацией
- GraphFrame.Visible = true
- GraphFrame.Size = UDim2.new(1, 0, 0, 0)
- TweenService:Create(GraphFrame, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {
- Size = UDim2.new(1, 0, 0, 50)
- }):Play()
- -- Увеличиваем основной фрейм
- TweenService:Create(MainFrame, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {
- Size = UDim2.new(0, 220, 0, 190)
- }):Play()
- else
- -- Скрываем график с анимацией
- TweenService:Create(GraphFrame, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {
- Size = UDim2.new(1, 0, 0, 0)
- }):Play()
- -- Уменьшаем основной фрейм
- TweenService:Create(MainFrame, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {
- Size = UDim2.new(0, 220, 0, 140)
- }):Play()
- task.wait(0.3)
- GraphFrame.Visible = false
- end
- end)
- -- Анимация при наведении на иконку FPS
- FpsIcon.MouseEnter:Connect(function()
- TweenService:Create(FpsIcon, TweenInfo.new(0.2), {
- ImageColor3 = Color3.fromRGB(150, 220, 255),
- Size = UDim2.new(0, 22, 0, 22),
- Position = UDim2.new(0, -1, 0, 9)
- }):Play()
- end)
- FpsIcon.MouseLeave:Connect(function()
- TweenService:Create(FpsIcon, TweenInfo.new(0.2), {
- ImageColor3 = Color3.fromRGB(100, 180, 255),
- Size = UDim2.new(0, 20, 0, 20),
- Position = UDim2.new(0, 0, 0, 10)
- }):Play()
- end)
- -- Функция форматирования времени
- local function formatTime(seconds)
- local hours = math.floor(seconds / 3600)
- local minutes = math.floor((seconds % 3600) / 60)
- local secs = seconds % 60
- return string.format("%02d:%02d:%02d", hours, minutes, secs)
- end
- -- Переменные для подсчета FPS
- local lastTick = tick()
- local frameCount = 0
- local fps = 0
- local startTime = os.time()
- -- Основной цикл обновления
- RunService.Heartbeat:Connect(function()
- -- Подсчет FPS
- frameCount = frameCount + 1
- if tick() - lastTick >= 0.5 then
- fps = math.floor(frameCount / (tick() - lastTick))
- frameCount = 0
- lastTick = tick()
- -- Обновляем текст FPS
- FpsText.Text = "FPS: " .. fps
- -- Обновляем индикатор
- local indicatorColor
- if fps > 50 then
- indicatorColor = Color3.fromRGB(100, 255, 100)
- elseif fps > 30 then
- indicatorColor = Color3.fromRGB(255, 200, 50)
- else
- indicatorColor = Color3.fromRGB(255, 80, 80)
- end
- TweenService:Create(FpsIndicator, TweenInfo.new(0.3), {
- BackgroundColor3 = indicatorColor
- }):Play()
- -- Добавляем значение в историю для графика
- table.insert(fpsHistory, fps)
- if #fpsHistory > maxGraphPoints then
- table.remove(fpsHistory, 1)
- end
- -- Обновляем график
- updateGraph()
- end
- -- Обновление времени
- local elapsed = os.time() - startTime
- TimeText.Text = "TIME: " .. formatTime(elapsed)
- end)
- -- Анимация появления
- MainFrame.Size = UDim2.new(0, 220, 0, 0)
- MainFrame.Position = UDim2.new(0.5, -110, 0, 10)
- TweenService:Create(MainFrame, TweenInfo.new(0.5, Enum.EasingStyle.Back), {
- Size = UDim2.new(0, 220, 0, 140),
- Position = UDim2.new(0.5, -110, 0, 20)
- }):Play()
- -- Горячая клавиша для показа/скрытия (F5)
- UserInputService.InputBegan:Connect(function(input, processed)
- if not processed and input.KeyCode == Enum.KeyCode.F5 then
- MainFrame.Visible = not MainFrame.Visible
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement