Advertisement
kill21_2

скрипт для меню

Apr 29th, 2025
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.43 KB | None | 0 0
  1. local Player = game:GetService("Players").LocalPlayer
  2. local GuiService = game:GetService("GuiService")
  3. local RunService = game:GetService("RunService")
  4. local TweenService = game:GetService("TweenService")
  5. local UserInputService = game:GetService("UserInputService")
  6.  
  7. -- Создаем основной GUI
  8. local ScreenGui = Instance.new("ScreenGui")
  9. ScreenGui.Name = "StatsGui"
  10. ScreenGui.ResetOnSpawn = false
  11. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  12. ScreenGui.Parent = Player:WaitForChild("PlayerGui")
  13.  
  14. -- Основной фрейм
  15. local MainFrame = Instance.new("Frame")
  16. MainFrame.Name = "MainFrame"
  17. MainFrame.Size = UDim2.new(0, 220, 0, 140)
  18. MainFrame.Position = UDim2.new(0.5, -110, 0, 20)
  19. MainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
  20. MainFrame.BackgroundTransparency = 0.2
  21. MainFrame.BorderSizePixel = 0
  22. MainFrame.Active = true
  23. MainFrame.Draggable = true
  24. MainFrame.ClipsDescendants = true
  25. MainFrame.Parent = ScreenGui
  26.  
  27. -- Закругление углов
  28. local UICorner = Instance.new("UICorner")
  29. UICorner.CornerRadius = UDim.new(0, 8)
  30. UICorner.Parent = MainFrame
  31.  
  32. -- Эффект тени
  33. local DropShadow = Instance.new("ImageLabel")
  34. DropShadow.Name = "DropShadow"
  35. DropShadow.Size = UDim2.new(1, 12, 1, 12)
  36. DropShadow.Position = UDim2.new(0, -6, 0, -6)
  37. DropShadow.BackgroundTransparency = 1
  38. DropShadow.Image = "rbxassetid://5234388158"
  39. DropShadow.ImageColor3 = Color3.fromRGB(0, 0, 0)
  40. DropShadow.ImageTransparency = 0.8
  41. DropShadow.ScaleType = Enum.ScaleType.Slice
  42. DropShadow.SliceCenter = Rect.new(10, 10, 118, 118)
  43. DropShadow.Parent = MainFrame
  44.  
  45. -- Top Bar
  46. local TopBar = Instance.new("Frame")
  47. TopBar.Name = "TopBar"
  48. TopBar.Size = UDim2.new(1, 0, 0, 30)
  49. TopBar.Position = UDim2.new(0, 0, 0, 0)
  50. TopBar.BackgroundColor3 = Color3.fromRGB(45, 45, 60)
  51. TopBar.BorderSizePixel = 0
  52. TopBar.Parent = MainFrame
  53.  
  54. local UICornerTop = Instance.new("UICorner")
  55. UICornerTop.CornerRadius = UDim.new(0, 8)
  56. UICornerTop.Parent = TopBar
  57.  
  58. -- Градиент для верхнего бара
  59. local UIGradient = Instance.new("UIGradient")
  60. UIGradient.Color = ColorSequence.new({
  61. ColorSequenceKeypoint.new(0, Color3.fromRGB(80, 80, 120)),
  62. ColorSequenceKeypoint.new(1, Color3.fromRGB(45, 45, 60))
  63. })
  64. UIGradient.Rotation = 90
  65. UIGradient.Parent = TopBar
  66.  
  67. -- Заголовок
  68. local Title = Instance.new("TextLabel")
  69. Title.Name = "Title"
  70. Title.Size = UDim2.new(0, 120, 1, 0)
  71. Title.Position = UDim2.new(0, 10, 0, 0)
  72. Title.BackgroundTransparency = 1
  73. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  74. Title.Text = "SYSTEM STATS"
  75. Title.Font = Enum.Font.GothamBold
  76. Title.TextSize = 14
  77. Title.TextXAlignment = Enum.TextXAlignment.Left
  78. Title.Parent = TopBar
  79.  
  80. -- Кнопка закрытия
  81. local CloseButton = Instance.new("ImageButton")
  82. CloseButton.Name = "CloseButton"
  83. CloseButton.Size = UDim2.new(0, 20, 0, 20)
  84. CloseButton.Position = UDim2.new(1, -25, 0.5, -10)
  85. CloseButton.BackgroundTransparency = 1
  86. CloseButton.Image = "rbxassetid://3926305904"
  87. CloseButton.ImageColor3 = Color3.fromRGB(200, 200, 200)
  88. CloseButton.ImageRectOffset = Vector2.new(284, 4)
  89. CloseButton.ImageRectSize = Vector2.new(24, 24)
  90. CloseButton.Parent = TopBar
  91.  
  92. -- Анимация при наведении на кнопку закрытия
  93. CloseButton.MouseEnter:Connect(function()
  94. TweenService:Create(CloseButton, TweenInfo.new(0.2), {
  95. ImageColor3 = Color3.fromRGB(255, 80, 80),
  96. Rotation = 90
  97. }):Play()
  98. end)
  99.  
  100. CloseButton.MouseLeave:Connect(function()
  101. TweenService:Create(CloseButton, TweenInfo.new(0.2), {
  102. ImageColor3 = Color3.fromRGB(200, 200, 200),
  103. Rotation = 0
  104. }):Play()
  105. end)
  106.  
  107. -- Обработчик закрытия окна
  108. CloseButton.MouseButton1Click:Connect(function()
  109. local tween = TweenService:Create(MainFrame, TweenInfo.new(0.3), {
  110. Size = UDim2.new(0, 220, 0, 0),
  111. Position = UDim2.new(0.5, -110, 0, MainFrame.Position.Y.Offset)
  112. })
  113. tween:Play()
  114. tween.Completed:Wait()
  115. ScreenGui:Destroy()
  116. end)
  117.  
  118. -- Контейнер для статистики
  119. local StatsContainer = Instance.new("Frame")
  120. StatsContainer.Name = "StatsContainer"
  121. StatsContainer.Size = UDim2.new(1, -20, 1, -40)
  122. StatsContainer.Position = UDim2.new(0, 10, 0, 35)
  123. StatsContainer.BackgroundTransparency = 1
  124. StatsContainer.Parent = MainFrame
  125.  
  126. -- Иконка FPS (кликабельная)
  127. local FpsIcon = Instance.new("ImageButton")
  128. FpsIcon.Name = "FpsIcon"
  129. FpsIcon.Size = UDim2.new(0, 20, 0, 20)
  130. FpsIcon.Position = UDim2.new(0, 0, 0, 10)
  131. FpsIcon.BackgroundTransparency = 1
  132. FpsIcon.Image = "rbxassetid://3926305904"
  133. FpsIcon.ImageColor3 = Color3.fromRGB(100, 180, 255)
  134. FpsIcon.ImageRectOffset = Vector2.new(964, 324)
  135. FpsIcon.ImageRectSize = Vector2.new(36, 36)
  136. FpsIcon.Parent = StatsContainer
  137.  
  138. -- Текст FPS
  139. local FpsText = Instance.new("TextLabel")
  140. FpsText.Name = "FpsText"
  141. FpsText.Size = UDim2.new(1, -30, 0, 20)
  142. FpsText.Position = UDim2.new(0, 25, 0, 10)
  143. FpsText.BackgroundTransparency = 1
  144. FpsText.TextColor3 = Color3.fromRGB(255, 255, 255)
  145. FpsText.Text = "FPS: 0"
  146. FpsText.Font = Enum.Font.Gotham
  147. FpsText.TextSize = 14
  148. FpsText.TextXAlignment = Enum.TextXAlignment.Left
  149. FpsText.Parent = StatsContainer
  150.  
  151. -- Индикатор нагрузки FPS
  152. local FpsIndicator = Instance.new("Frame")
  153. FpsIndicator.Name = "FpsIndicator"
  154. FpsIndicator.Size = UDim2.new(0, 5, 0, 20)
  155. FpsIndicator.Position = UDim2.new(1, -5, 0, 10)
  156. FpsIndicator.BackgroundColor3 = Color3.fromRGB(100, 255, 100)
  157. FpsIndicator.BorderSizePixel = 0
  158. FpsIndicator.Parent = StatsContainer
  159.  
  160. local UICornerIndicator = Instance.new("UICorner")
  161. UICornerIndicator.CornerRadius = UDim.new(0, 2)
  162. UICornerIndicator.Parent = FpsIndicator
  163.  
  164. -- Иконка времени
  165. local TimeIcon = Instance.new("ImageLabel")
  166. TimeIcon.Name = "TimeIcon"
  167. TimeIcon.Size = UDim2.new(0, 20, 0, 20)
  168. TimeIcon.Position = UDim2.new(0, 0, 0, 40)
  169. TimeIcon.BackgroundTransparency = 1
  170. TimeIcon.Image = "rbxassetid://3926305904"
  171. TimeIcon.ImageColor3 = Color3.fromRGB(255, 150, 100)
  172. TimeIcon.ImageRectOffset = Vector2.new(324, 524)
  173. TimeIcon.ImageRectSize = Vector2.new(36, 36)
  174. TimeIcon.Parent = StatsContainer
  175.  
  176. -- Текст времени
  177. local TimeText = Instance.new("TextLabel")
  178. TimeText.Name = "TimeText"
  179. TimeText.Size = UDim2.new(1, -30, 0, 20)
  180. TimeText.Position = UDim2.new(0, 25, 0, 40)
  181. TimeText.BackgroundTransparency = 1
  182. TimeText.TextColor3 = Color3.fromRGB(255, 255, 255)
  183. TimeText.Text = "TIME: 00:00:00"
  184. TimeText.Font = Enum.Font.Gotham
  185. TimeText.TextSize = 14
  186. TimeText.TextXAlignment = Enum.TextXAlignment.Left
  187. TimeText.Parent = StatsContainer
  188.  
  189. -- Разделительная линия
  190. local Divider = Instance.new("Frame")
  191. Divider.Name = "Divider"
  192. Divider.Size = UDim2.new(1, 0, 0, 1)
  193. Divider.Position = UDim2.new(0, 0, 0, 75)
  194. Divider.BackgroundColor3 = Color3.fromRGB(60, 60, 80)
  195. Divider.BorderSizePixel = 0
  196. Divider.Parent = StatsContainer
  197.  
  198. -- Фрейм для графика FPS
  199. local GraphFrame = Instance.new("Frame")
  200. GraphFrame.Name = "GraphFrame"
  201. GraphFrame.Size = UDim2.new(1, 0, 0, 50)
  202. GraphFrame.Position = UDim2.new(0, 0, 0, 80)
  203. GraphFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 30)
  204. GraphFrame.BackgroundTransparency = 0.5
  205. GraphFrame.BorderSizePixel = 0
  206. GraphFrame.Visible = false
  207. GraphFrame.Parent = StatsContainer
  208.  
  209. local GraphCorner = Instance.new("UICorner")
  210. GraphCorner.CornerRadius = UDim.new(0, 4)
  211. GraphCorner.Parent = GraphFrame
  212.  
  213. -- Контейнер для линий графика
  214. local GraphContainer = Instance.new("Frame")
  215. GraphContainer.Name = "GraphContainer"
  216. GraphContainer.Size = UDim2.new(1, -10, 1, -10)
  217. GraphContainer.Position = UDim2.new(0, 5, 0, 5)
  218. GraphContainer.BackgroundTransparency = 1
  219. GraphContainer.ClipsDescendants = true
  220. GraphContainer.Parent = GraphFrame
  221.  
  222. -- Текст версии
  223. local VersionText = Instance.new("TextLabel")
  224. VersionText.Name = "VersionText"
  225. VersionText.Size = UDim2.new(1, 0, 0, 20)
  226. VersionText.Position = UDim2.new(0, 0, 0, 85)
  227. VersionText.BackgroundTransparency = 1
  228. VersionText.TextColor3 = Color3.fromRGB(150, 150, 150)
  229. VersionText.Text = "v2.0 | © 2023"
  230. VersionText.Font = Enum.Font.Gotham
  231. VersionText.TextSize = 12
  232. VersionText.TextXAlignment = Enum.TextXAlignment.Right
  233. VersionText.Parent = StatsContainer
  234.  
  235. -- Переменные для графика
  236. local fpsHistory = {}
  237. local maxGraphPoints = 30
  238. local graphLines = {}
  239. local isGraphVisible = false
  240.  
  241. -- Создаем линии графика заранее
  242. for i = 1, maxGraphPoints do
  243. local line = Instance.new("Frame")
  244. line.Name = "Line_"..i
  245. line.Size = UDim2.new(0, 4, 0, 0)
  246. line.Position = UDim2.new(0, (i-1)*6, 1, 0)
  247. line.AnchorPoint = Vector2.new(0, 1)
  248. line.BackgroundColor3 = Color3.fromRGB(100, 180, 255)
  249. line.BorderSizePixel = 0
  250. line.Visible = false
  251. line.Parent = GraphContainer
  252.  
  253. local lineCorner = Instance.new("UICorner")
  254. lineCorner.CornerRadius = UDim.new(0, 2)
  255. lineCorner.Parent = line
  256.  
  257. table.insert(graphLines, line)
  258. end
  259.  
  260. -- Функция для обновления графика
  261. local function updateGraph()
  262. if not isGraphVisible then return end
  263.  
  264. -- Удаляем старые линии (если точек меньше максимума)
  265. for i = #fpsHistory + 1, maxGraphPoints do
  266. graphLines[i].Visible = false
  267. end
  268.  
  269. -- Обновляем видимые линии
  270. for i, fps in ipairs(fpsHistory) do
  271. local line = graphLines[i]
  272. line.Visible = true
  273.  
  274. -- Нормализуем высоту (макс 60 FPS = полная высота)
  275. local height = math.clamp(fps / 60 * GraphContainer.AbsoluteSize.Y, 2, GraphContainer.AbsoluteSize.Y)
  276.  
  277. -- Плавное изменение высоты
  278. TweenService:Create(line, TweenInfo.new(0.2), {
  279. Size = UDim2.new(0, 4, 0, height)
  280. }):Play()
  281.  
  282. -- Изменяем цвет в зависимости от значения
  283. local color
  284. if fps > 50 then
  285. color = Color3.fromRGB(100, 255, 100)
  286. elseif fps > 30 then
  287. color = Color3.fromRGB(255, 200, 50)
  288. else
  289. color = Color3.fromRGB(255, 80, 80)
  290. end
  291.  
  292. TweenService:Create(line, TweenInfo.new(0.3), {
  293. BackgroundColor3 = color
  294. }):Play()
  295. end
  296. end
  297.  
  298. -- Обработчик клика по иконке FPS
  299. FpsIcon.MouseButton1Click:Connect(function()
  300. isGraphVisible = not isGraphVisible
  301.  
  302. if isGraphVisible then
  303. -- Показываем график с анимацией
  304. GraphFrame.Visible = true
  305. GraphFrame.Size = UDim2.new(1, 0, 0, 0)
  306. TweenService:Create(GraphFrame, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {
  307. Size = UDim2.new(1, 0, 0, 50)
  308. }):Play()
  309.  
  310. -- Увеличиваем основной фрейм
  311. TweenService:Create(MainFrame, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {
  312. Size = UDim2.new(0, 220, 0, 190)
  313. }):Play()
  314. else
  315. -- Скрываем график с анимацией
  316. TweenService:Create(GraphFrame, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {
  317. Size = UDim2.new(1, 0, 0, 0)
  318. }):Play()
  319.  
  320. -- Уменьшаем основной фрейм
  321. TweenService:Create(MainFrame, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {
  322. Size = UDim2.new(0, 220, 0, 140)
  323. }):Play()
  324.  
  325. task.wait(0.3)
  326. GraphFrame.Visible = false
  327. end
  328. end)
  329.  
  330. -- Анимация при наведении на иконку FPS
  331. FpsIcon.MouseEnter:Connect(function()
  332. TweenService:Create(FpsIcon, TweenInfo.new(0.2), {
  333. ImageColor3 = Color3.fromRGB(150, 220, 255),
  334. Size = UDim2.new(0, 22, 0, 22),
  335. Position = UDim2.new(0, -1, 0, 9)
  336. }):Play()
  337. end)
  338.  
  339. FpsIcon.MouseLeave:Connect(function()
  340. TweenService:Create(FpsIcon, TweenInfo.new(0.2), {
  341. ImageColor3 = Color3.fromRGB(100, 180, 255),
  342. Size = UDim2.new(0, 20, 0, 20),
  343. Position = UDim2.new(0, 0, 0, 10)
  344. }):Play()
  345. end)
  346.  
  347. -- Функция форматирования времени
  348. local function formatTime(seconds)
  349. local hours = math.floor(seconds / 3600)
  350. local minutes = math.floor((seconds % 3600) / 60)
  351. local secs = seconds % 60
  352.  
  353. return string.format("%02d:%02d:%02d", hours, minutes, secs)
  354. end
  355.  
  356. -- Переменные для подсчета FPS
  357. local lastTick = tick()
  358. local frameCount = 0
  359. local fps = 0
  360. local startTime = os.time()
  361.  
  362. -- Основной цикл обновления
  363. RunService.Heartbeat:Connect(function()
  364. -- Подсчет FPS
  365. frameCount = frameCount + 1
  366.  
  367. if tick() - lastTick >= 0.5 then
  368. fps = math.floor(frameCount / (tick() - lastTick))
  369. frameCount = 0
  370. lastTick = tick()
  371.  
  372. -- Обновляем текст FPS
  373. FpsText.Text = "FPS: " .. fps
  374.  
  375. -- Обновляем индикатор
  376. local indicatorColor
  377. if fps > 50 then
  378. indicatorColor = Color3.fromRGB(100, 255, 100)
  379. elseif fps > 30 then
  380. indicatorColor = Color3.fromRGB(255, 200, 50)
  381. else
  382. indicatorColor = Color3.fromRGB(255, 80, 80)
  383. end
  384.  
  385. TweenService:Create(FpsIndicator, TweenInfo.new(0.3), {
  386. BackgroundColor3 = indicatorColor
  387. }):Play()
  388.  
  389. -- Добавляем значение в историю для графика
  390. table.insert(fpsHistory, fps)
  391. if #fpsHistory > maxGraphPoints then
  392. table.remove(fpsHistory, 1)
  393. end
  394.  
  395. -- Обновляем график
  396. updateGraph()
  397. end
  398.  
  399. -- Обновление времени
  400. local elapsed = os.time() - startTime
  401. TimeText.Text = "TIME: " .. formatTime(elapsed)
  402. end)
  403.  
  404. -- Анимация появления
  405. MainFrame.Size = UDim2.new(0, 220, 0, 0)
  406. MainFrame.Position = UDim2.new(0.5, -110, 0, 10)
  407. TweenService:Create(MainFrame, TweenInfo.new(0.5, Enum.EasingStyle.Back), {
  408. Size = UDim2.new(0, 220, 0, 140),
  409. Position = UDim2.new(0.5, -110, 0, 20)
  410. }):Play()
  411.  
  412. -- Горячая клавиша для показа/скрытия (F5)
  413. UserInputService.InputBegan:Connect(function(input, processed)
  414. if not processed and input.KeyCode == Enum.KeyCode.F5 then
  415. MainFrame.Visible = not MainFrame.Visible
  416. end
  417. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement