SIKEHELPS

Untitled

Nov 4th, 2025 (edited)
811
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 15.78 KB | None | 0 0
  1. -- --- СЕРВИСЫ И ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ ---
  2. local TweenService = game:GetService("TweenService")
  3. local CoreGui = game:GetService("CoreGui")
  4. local Workspace = game:GetService("Workspace")
  5. local Players = game:GetService("Players")
  6. local LocalPlayer = Players.LocalPlayer
  7. local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
  8.  
  9. local isOpen = false
  10. local isEspActive = false
  11. local espFolder = nil
  12. local espConnections = {} -- Таблица для хранения активных подключений (сигналов)
  13.  
  14. -- --- СОЗДАНИЕ GUI ---
  15.  
  16. -- 1. Главный ScreenGui
  17. local MyScreenGui = Instance.new("ScreenGui")
  18. MyScreenGui.Name = "MyMenu_v2"
  19. MyScreenGui.Parent = PlayerGui
  20. MyScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  21.  
  22. -- 2. Кнопка Открытия (Круглая кнопка "M")
  23. local OpenButton = Instance.new("TextButton")
  24. OpenButton.Name = "OpenButton"
  25. OpenButton.Parent = MyScreenGui
  26. OpenButton.Size = UDim2.new(0, 60, 0, 60)
  27. OpenButton.Position = UDim2.new(0.02, 0, 0.5, -30)
  28. OpenButton.AnchorPoint = Vector2.new(0, 0.5)
  29. OpenButton.Text = "M"
  30. OpenButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  31. OpenButton.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  32. OpenButton.Font = Enum.Font.GothamSemibold
  33. OpenButton.TextSize = 24
  34. OpenButton.ZIndex = 3
  35.  
  36. local btnCorner = Instance.new("UICorner")
  37. btnCorner.CornerRadius = UDim.new(1, 0)
  38. btnCorner.Parent = OpenButton
  39.  
  40. local btnStroke = Instance.new("UIStroke")
  41. btnStroke.Color = Color3.fromRGB(80, 80, 80)
  42. btnStroke.Thickness = 2
  43. btnStroke.Parent = OpenButton
  44.  
  45. -- 3. Главное Меню (Frame) - *** УВЕЛИЧЕНО ***
  46. local MenuFrame = Instance.new("Frame")
  47. MenuFrame.Name = "MenuFrame"
  48. MenuFrame.Parent = MyScreenGui
  49. MenuFrame.Size = UDim2.new(0, 400, 0, 350) -- *** НОВЫЙ РАЗМЕР ***
  50. MenuFrame.Position = UDim2.new(-0.5, 0, 0.5, 0)
  51. MenuFrame.AnchorPoint = Vector2.new(0, 0.5)
  52. MenuFrame.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
  53. MenuFrame.BorderSizePixel = 0
  54. MenuFrame.ClipsDescendants = true -- Важно для табов
  55. MenuFrame.ZIndex = 2
  56.  
  57. local frameCorner = Instance.new("UICorner")
  58. frameCorner.CornerRadius = UDim.new(0, 12)
  59. frameCorner.Parent = MenuFrame
  60.  
  61. local frameStroke = Instance.new("UIStroke")
  62. frameStroke.Color = Color3.fromRGB(80, 80, 80)
  63. frameStroke.Thickness = 2
  64. frameStroke.Parent = MenuFrame
  65.  
  66. local frameGradient = Instance.new("UIGradient")
  67. frameGradient.Color = ColorSequence.new({
  68.     ColorSequenceKeypoint.new(0, Color3.fromRGB(50, 50, 50)),
  69.     ColorSequenceKeypoint.new(1, Color3.fromRGB(30, 30, 30))
  70. })
  71. frameGradient.Rotation = 90
  72. frameGradient.Parent = MenuFrame
  73.  
  74. -- 4. Заголовок Меню
  75. local TitleLabel = Instance.new("TextLabel")
  76. TitleLabel.Name = "Title"
  77. TitleLabel.Parent = MenuFrame
  78. TitleLabel.Size = UDim2.new(1, 0, 0, 40)
  79. TitleLabel.Position = UDim2.new(0, 0, 0, 0)
  80. TitleLabel.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  81. TitleLabel.Text = "My Cool Menu"
  82. TitleLabel.Font = Enum.Font.GothamBold
  83. TitleLabel.TextSize = 18
  84. TitleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  85.  
  86. local titleCorner = Instance.new("UICorner")
  87. titleCorner.CornerRadius = UDim.new(0, 12)
  88. titleCorner.Parent = TitleLabel
  89.  
  90. -- 5. *** НОВОЕ: Кнопка Закрытия (Крестик) ***
  91. local CloseButton = Instance.new("TextButton")
  92. CloseButton.Name = "CloseButton"
  93. CloseButton.Parent = MenuFrame
  94. CloseButton.Size = UDim2.new(0, 25, 0, 25)
  95. CloseButton.Position = UDim2.new(1, -10, 0, 7.5) -- Справа вверху
  96. CloseButton.AnchorPoint = Vector2.new(1, 0)
  97. CloseButton.Text = "X"
  98. CloseButton.Font = Enum.Font.GothamBold
  99. CloseButton.TextSize = 16
  100. CloseButton.TextColor3 = Color3.fromRGB(200, 200, 200)
  101. CloseButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25) -- Тот же цвет, что и шапка
  102. CloseButton.BackgroundTransparency = 0.5
  103. CloseButton.ZIndex = 3
  104.  
  105. local closeCorner = Instance.new("UICorner")
  106. closeCorner.CornerRadius = UDim.new(0, 6)
  107. closeCorner.Parent = CloseButton
  108.  
  109. -- Анимация наведения на крестик
  110. local closeHoverInfo = TweenInfo.new(0.2, Enum.EasingStyle.Quad)
  111. local closeHoverTween = TweenService:Create(CloseButton, closeHoverInfo, {
  112.     BackgroundColor3 = Color3.fromRGB(200, 50, 50),
  113.     BackgroundTransparency = 0,
  114.     TextColor3 = Color3.fromRGB(255, 255, 255)
  115. })
  116. local closeUnhoverTween = TweenService:Create(CloseButton, closeHoverInfo, {
  117.     BackgroundColor3 = Color3.fromRGB(25, 25, 25),
  118.     BackgroundTransparency = 0.5,
  119.     TextColor3 = Color3.fromRGB(200, 200, 200)
  120. })
  121.  
  122. CloseButton.MouseEnter:Connect(function() closeHoverTween:Play() end)
  123. CloseButton.MouseLeave:Connect(function() closeUnhoverTween:Play() end)
  124.  
  125.  
  126. -- 6. *** НОВОЕ: СИСТЕМА ТАБОВ (ВКЛАДОК) ***
  127.  
  128. -- Контейнер для кнопок-табов
  129. local TabContainer = Instance.new("Frame")
  130. TabContainer.Name = "TabContainer"
  131. TabContainer.Parent = MenuFrame
  132. TabContainer.Size = UDim2.new(1, 0, 0, 35)
  133. TabContainer.Position = UDim2.new(0, 0, 0, 40) -- Под заголовком
  134. TabContainer.BackgroundTransparency = 1
  135.  
  136. -- Контейнер для содержимого табов
  137. local ContentContainer = Instance.new("Frame")
  138. ContentContainer.Name = "ContentContainer"
  139. ContentContainer.Parent = MenuFrame
  140. ContentContainer.Size = UDim2.new(1, -20, 1, -85) -- Отступы
  141. ContentContainer.Position = UDim2.new(0, 10, 0, 75) -- Под табами
  142. ContentContainer.BackgroundTransparency = 1
  143.  
  144. -- Создаем табы
  145. local TabButtonVisuals = Instance.new("TextButton")
  146. TabButtonVisuals.Name = "TabVisuals"
  147. TabButtonVisuals.Parent = TabContainer
  148. TabButtonVisuals.Size = UDim2.new(0, 100, 1, 0)
  149. TabButtonVisuals.Position = UDim2.new(0, 10, 0, 0)
  150. TabButtonVisuals.Font = Enum.Font.GothamSemibold
  151. TabButtonVisuals.Text = "Visuals"
  152. TabButtonVisuals.TextSize = 16
  153. TabButtonVisuals.TextColor3 = Color3.fromRGB(255, 255, 255) -- *Активный*
  154. TabButtonVisuals.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  155. local tabVisualsCorner = Instance.new("UICorner", TabButtonVisuals)
  156. tabVisualsCorner.CornerRadius = UDim.new(0, 6)
  157.  
  158. local TabButtonMain = Instance.new("TextButton")
  159. TabButtonMain.Name = "TabMain"
  160. TabButtonMain.Parent = TabContainer
  161. TabButtonMain.Size = UDim2.new(0, 100, 1, 0)
  162. TabButtonMain.Position = UDim2.new(0, 115, 0, 0)
  163. TabButtonMain.Font = Enum.Font.Gotham
  164. TabButtonMain.Text = "Main"
  165. TabButtonMain.TextSize = 16
  166. TabButtonMain.TextColor3 = Color3.fromRGB(150, 150, 150) -- *Неактивный*
  167. TabButtonMain.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  168. local tabMainCorner = Instance.new("UICorner", TabButtonMain)
  169. tabMainCorner.CornerRadius = UDim.new(0, 6)
  170.  
  171. -- Создаем страницы (содержимое) для табов
  172. local VisualsFrame = Instance.new("Frame")
  173. VisualsFrame.Name = "VisualsFrame"
  174. VisualsFrame.Parent = ContentContainer
  175. VisualsFrame.Size = UDim2.new(1, 0, 1, 0)
  176. VisualsFrame.BackgroundTransparency = 1
  177. VisualsFrame.Visible = true -- Показываем по умолчанию
  178.  
  179. local MainFrame = Instance.new("Frame")
  180. MainFrame.Name = "MainFrame"
  181. MainFrame.Parent = ContentContainer
  182. MainFrame.Size = UDim2.new(1, 0, 1, 0)
  183. MainFrame.BackgroundTransparency = 1
  184. MainFrame.Visible = false -- Скрываем
  185.  
  186. -- Логика переключения табов
  187. local tabs = {TabButtonVisuals, TabButtonMain}
  188. local pages = {VisualsFrame, MainFrame}
  189.  
  190. local function switchTab(tabToSelect)
  191.     for i, tab in ipairs(tabs) do
  192.         local page = pages[i]
  193.         if tab == tabToSelect then
  194.             -- Активировать
  195.             page.Visible = true
  196.             tab.Font = Enum.Font.GothamSemibold
  197.             tab.TextColor3 = Color3.fromRGB(255, 255, 255)
  198.             tab.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  199.         else
  200.             -- Деактивировать
  201.             page.Visible = false
  202.             tab.Font = Enum.Font.Gotham
  203.             tab.TextColor3 = Color3.fromRGB(150, 150, 150)
  204.             tab.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  205.         end
  206.     end
  207. end
  208.  
  209. TabButtonVisuals.MouseButton1Click:Connect(function() switchTab(TabButtonVisuals) end)
  210. TabButtonMain.MouseButton1Click:Connect(function() switchTab(TabButtonMain) end)
  211.  
  212. -- --- ИНТЕГРАЦИЯ ESP (Твой код) ---
  213.  
  214. -- Кнопка-переключатель для ESP
  215. local espToggle = Instance.new("TextButton")
  216. espToggle.Name = "ESPToggle"
  217. espToggle.Parent = VisualsFrame -- *Добавляем во вкладку Visuals*
  218. espToggle.Size = UDim2.new(1, 0, 0, 30)
  219. espToggle.Position = UDim2.new(0, 0, 0, 10)
  220. espToggle.Font = Enum.Font.GothamSemibold
  221. espToggle.Text = "ESP (RemainingTime) [OFF]"
  222. espToggle.TextSize = 16
  223. espToggle.TextColor3 = Color3.fromRGB(255, 255, 255)
  224. espToggle.BackgroundColor3 = Color3.fromRGB(180, 50, 50) -- [OFF] цвет
  225.  
  226. local espToggleCorner = Instance.new("UICorner", espToggle)
  227. espToggleCorner.CornerRadius = UDim.new(0, 8)
  228.  
  229. -- Главная функция для Вкл/Выкл ESP
  230. -- Мы "оборачиваем" твой код в эту функцию
  231. local function ToggleESP(state)
  232.     if state == true then
  233.         -- --- ВКЛЮЧАЕМ ESP ---
  234.         if isEspActive then return end
  235.         isEspActive = true
  236.         espToggle.Text = "ESP (RemainingTime) [ON]"
  237.         espToggle.BackgroundColor3 = Color3.fromRGB(50, 180, 50) -- [ON] цвет
  238.        
  239.         -- Создаем папку, если ее нет
  240.         espFolder = CoreGui:FindFirstChild("ESP_RemainingTimers") or Instance.new("Folder", CoreGui)
  241.         espFolder.Name = "ESP_RemainingTimers"
  242.  
  243.         -- Настройки из твоего скрипта
  244.         local textColor = Color3.fromRGB(0, 255, 255)
  245.         local textSize = 12
  246.         local maxY = 50
  247.  
  248.         local function isFirstFloor(part)
  249.             return part and part.Position.Y <= maxY
  250.         end
  251.        
  252.         -- Функция makeESP (немного изменена для очистки)
  253.         local function makeESP(hitbox, sourceText)
  254.             if not hitbox or not sourceText then return end
  255.             local id = sourceText:GetFullName()
  256.             if espFolder:FindFirstChild(id) or not isFirstFloor(hitbox) then return end
  257.  
  258.             local gui = Instance.new("BillboardGui")
  259.             gui.Name = id
  260.             gui.Adornee = hitbox
  261.             gui.Size = UDim2.new(0, 100, 0, 20)
  262.             gui.StudsOffset = Vector3.new(0, 3, 0)
  263.             gui.AlwaysOnTop = true
  264.             gui.Parent = espFolder -- Важно: родитель - наша папка
  265.  
  266.             local label = Instance.new("TextLabel")
  267.             label.Size = UDim2.new(1, 0, 1, 0)
  268.             label.BackgroundTransparency = 1
  269.             label.TextColor3 = textColor
  270.             label.TextStrokeTransparency = 0.5
  271.             label.Font = Enum.Font.Gotham
  272.             label.TextSize = textSize
  273.             label.Text = sourceText.Text
  274.             label.Parent = gui
  275.  
  276.             local propConn, ancConn
  277.            
  278.             propConn = sourceText:GetPropertyChangedSignal("Text"):Connect(function()
  279.                 if label and label.Parent then
  280.                     label.Text = sourceText.Text
  281.                 else
  282.                     if propConn then propConn:Disconnect() end
  283.                     if ancConn then ancConn:Disconnect() end
  284.                 end
  285.             end)
  286.  
  287.             ancConn = sourceText.AncestryChanged:Connect(function(_, parent)
  288.                 if not parent then
  289.                     if gui then gui:Destroy() end
  290.                     if propConn then propConn:Disconnect() end
  291.                     if ancConn then ancConn:Disconnect() end
  292.                 end
  293.             end)
  294.            
  295.             -- Сохраняем подключения, чтобы мы могли их "убить" при выключении
  296.             table.insert(espConnections, propConn)
  297.             table.insert(espConnections, ancConn)
  298.         end
  299.  
  300.         -- Обработка существующих
  301.         for _, obj in ipairs(Workspace:GetDescendants()) do
  302.             if obj:IsA("TextLabel") and obj.Name == "RemainingTime" then
  303.                 local model = obj:FindFirstAncestorWhichIsA("Model")
  304.                 local hitbox = model and model:FindFirstChild("Hitbox")
  305.                 if hitbox then makeESP(hitbox, obj) end
  306.             end
  307.         end
  308.  
  309.         -- Обработка новых (главный сигнал)
  310.         local descConn = Workspace.DescendantAdded:Connect(function(obj)
  311.             if obj:IsA("TextLabel") and obj.Name == "RemainingTime" then
  312.                 local model = obj:FindFirstAncestorWhichIsA("Model")
  313.                 local hitbox = model and model:FindFirstChild("Hitbox")
  314.                 if hitbox then makeESP(hitbox, obj) end
  315.             end
  316.         end)
  317.         -- Сохраняем главный сигнал
  318.         table.insert(espConnections, descConn)
  319.  
  320.     elseif state == false then
  321.         -- --- ВЫКЛЮЧАЕМ ESP ---
  322.         if not isEspActive then return end
  323.         isEspActive = false
  324.         espToggle.Text = "ESP (RemainingTime) [OFF]"
  325.         espToggle.BackgroundColor3 = Color3.fromRGB(180, 50, 50)
  326.        
  327.         -- 1. Отключаем все сигналы (ОЧЕНЬ ВАЖНО)
  328.         for _, conn in ipairs(espConnections) do
  329.             if conn then conn:Disconnect() end
  330.         end
  331.         espConnections = {} -- Очищаем таблицу
  332.        
  333.         -- 2. Уничтожаем папку со всеми ESP
  334.         if espFolder then
  335.             espFolder:Destroy()
  336.             espFolder = nil
  337.         end
  338.     end
  339. end
  340.  
  341. -- Подключаем функцию к кнопке-переключателю
  342. espToggle.MouseButton1Click:Connect(function()
  343.     ToggleESP(not isEspActive) -- Инвертируем состояние (вкл -> выкл, выкл -> вкл)
  344. end)
  345.  
  346. -- --- ГЛАВНАЯ ЛОГИКА АНИМАЦИЙ (Open/Close) ---
  347.  
  348. local animationInfo = TweenInfo.new(0.4, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out)
  349. local closedPosition = UDim2.new(-0.5, 0, 0.5, 0)
  350. local openPosition = UDim2.new(0.02, 70, 0.5, 0)
  351.  
  352. local openTween = TweenService:Create(MenuFrame, animationInfo, {Position = openPosition})
  353. local closeTween = TweenService:Create(MenuFrame, animationInfo, {Position = closedPosition})
  354.  
  355. -- Анимация наведения на кнопку "M"
  356. local hoverInfo = TweenInfo.new(0.2, Enum.EasingStyle.Quad)
  357. local originalBtnColor = OpenButton.BackgroundColor3
  358. local hoverBtnColor = Color3.fromRGB(60, 60, 60)
  359. local hoverTween = TweenService:Create(OpenButton, hoverInfo, {BackgroundColor3 = hoverBtnColor})
  360. local unhoverTween = TweenService:Create(OpenButton, hoverInfo, {BackgroundColor3 = originalBtnColor})
  361.  
  362. OpenButton.MouseEnter:Connect(function() hoverTween:Play() end)
  363. OpenButton.MouseLeave:Connect(function() unhoverTween:Play() end)
  364.  
  365. -- Открытие/Закрытие по кнопке "M"
  366. OpenButton.MouseButton1Click:Connect(function()
  367.     if isOpen then
  368.         closeTween:Play()
  369.         isOpen = false
  370.     else
  371.         openTween:Play()
  372.         isOpen = true
  373.     end
  374. end)
  375.  
  376. -- *** НОВОЕ: ЛОГИКА ЗАКРЫТИЯ (КРЕСТИК) ***
  377. CloseButton.MouseButton1Click:Connect(function()
  378.     -- Сначала выключаем все функции
  379.     ToggleESP(false)
  380.     -- Затем уничтожаем GUI
  381.     MyScreenGui:Destroy()
  382. end)
  383.  
  384. -- *** НОВОЕ: Безопасная очистка при выгрузке скрипта ***
  385. -- Если GUI будет уничтожен (например, другим скриптом),
  386. -- мы гарантируем, что ESP выключится и не вызовет ошибок.
  387. MyScreenGui.Destroying:Connect(function()
  388.     ToggleESP(false)
  389.     -- (Здесь можно добавить очистку для других функций в будущем)
  390. end)
Tags: Script
Advertisement
Add Comment
Please, Sign In to add comment