--[[ WARNING: Heads up! This script has not been verified by ScriptBlox. Use at your own risk! ]] local Players = game:GetService("Players") local RunService = game:GetService("RunService") local CoreGui = game:GetService("CoreGui") local LocalPlayer = Players.LocalPlayer -- Очистка старого GUI при повторном запуске local oldGui = CoreGui:FindFirstChild("BehindTargetGui") if oldGui then oldGui:Destroy() end local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "BehindTargetGui" ScreenGui.ResetOnSpawn = false ScreenGui.Parent = CoreGui local EXPANDED_SIZE = UDim2.new(0, 290, 0, 472) local COLLAPSED_SIZE = UDim2.new(0, 290, 0, 38) local MainFrame = Instance.new("Frame") MainFrame.Size = EXPANDED_SIZE MainFrame.Position = UDim2.new(0, 12, 0.14, 0) MainFrame.BackgroundColor3 = Color3.fromRGB(28, 28, 34) MainFrame.BorderSizePixel = 0 MainFrame.Active = true MainFrame.Draggable = true MainFrame.ClipsDescendants = true MainFrame.Parent = ScreenGui -- Шапка окна local Header = Instance.new("Frame") Header.Size = UDim2.new(1, 0, 0, 38) Header.BackgroundColor3 = Color3.fromRGB(22, 22, 28) Header.BorderSizePixel = 0 Header.Parent = MainFrame local Title = Instance.new("TextLabel") Title.Size = UDim2.new(1, -104, 1, 0) Title.Position = UDim2.new(0, 10, 0, 0) Title.BackgroundTransparency = 1 Title.Text = "Цели: 0 | ВЫКЛ" Title.TextColor3 = Color3.fromRGB(240, 240, 245) Title.TextSize = 13 Title.Font = Enum.Font.GothamBold Title.TextXAlignment = Enum.TextXAlignment.Left Title.Parent = Header local function createHeaderBtn(text, offsetFromRight, bgColor) local btn = Instance.new("TextButton") btn.Size = UDim2.new(0, 26, 0, 26) btn.Position = UDim2.new(1, offsetFromRight, 0.5, -13) btn.BackgroundColor3 = bgColor btn.BorderSizePixel = 0 btn.Text = text btn.TextColor3 = Color3.fromRGB(255, 255, 255) btn.TextSize = 13 btn.Font = Enum.Font.GothamBold btn.Parent = Header return btn end local PinBtn = createHeaderBtn("📌", -90, Color3.fromRGB(52, 52, 64)) local MinBtn = createHeaderBtn("-", -60, Color3.fromRGB(52, 52, 64)) local CloseBtn = createHeaderBtn("❌", -30, Color3.fromRGB(165, 45, 45)) local DEFAULT_DISTANCE = 3.5 -- Верхняя панель управления: кнопки "Вкл" и "Выкл" local PowerFrame = Instance.new("Frame") PowerFrame.Size = UDim2.new(1, -16, 0, 32) PowerFrame.Position = UDim2.new(0, 8, 0, 44) PowerFrame.BackgroundTransparency = 1 PowerFrame.Parent = MainFrame local OnBtn = Instance.new("TextButton") OnBtn.Size = UDim2.new(0.5, -4, 1, 0) OnBtn.Position = UDim2.new(0, 0, 0, 0) OnBtn.BackgroundColor3 = Color3.fromRGB(45, 145, 75) OnBtn.BorderSizePixel = 0 OnBtn.Text = "Вкл" OnBtn.TextColor3 = Color3.fromRGB(255, 255, 255) OnBtn.TextSize = 14 OnBtn.Font = Enum.Font.GothamBold OnBtn.Parent = PowerFrame local OffBtn = Instance.new("TextButton") OffBtn.Size = UDim2.new(0.5, -4, 1, 0) OffBtn.Position = UDim2.new(0.5, 4, 0, 0) OffBtn.BackgroundColor3 = Color3.fromRGB(165, 45, 45) OffBtn.BorderSizePixel = 0 OffBtn.Text = "Выкл" OffBtn.TextColor3 = Color3.fromRGB(255, 255, 255) OffBtn.TextSize = 14 OffBtn.Font = Enum.Font.GothamBold OffBtn.Parent = PowerFrame -- Поле ввода расстояния (TextBox) сверху под "Вкл/Выкл" local DistFrame = Instance.new("Frame") DistFrame.Size = UDim2.new(1, -16, 0, 32) DistFrame.Position = UDim2.new(0, 8, 0, 82) DistFrame.BackgroundColor3 = Color3.fromRGB(38, 38, 46) DistFrame.BorderSizePixel = 0 DistFrame.Parent = MainFrame local DistLabel = Instance.new("TextLabel") DistLabel.Size = UDim2.new(0.56, -6, 1, 0) DistLabel.Position = UDim2.new(0, 8, 0, 0) DistLabel.BackgroundTransparency = 1 DistLabel.Text = "Дистанция (st):" DistLabel.TextColor3 = Color3.fromRGB(225, 225, 235) DistLabel.TextSize = 12 DistLabel.Font = Enum.Font.GothamBold DistLabel.TextXAlignment = Enum.TextXAlignment.Left DistLabel.Parent = DistFrame local DistBox = Instance.new("TextBox") DistBox.Size = UDim2.new(0.44, -8, 1, -6) DistBox.Position = UDim2.new(0.56, 0, 0, 3) DistBox.BackgroundColor3 = Color3.fromRGB(24, 24, 30) DistBox.BorderSizePixel = 0 DistBox.Text = tostring(DEFAULT_DISTANCE) DistBox.PlaceholderText = "3.5" DistBox.ClearTextOnFocus = false DistBox.TextColor3 = Color3.fromRGB(255, 255, 255) DistBox.TextSize = 13 DistBox.Font = Enum.Font.GothamBold DistBox.Parent = DistFrame -- Панель выбора позиции (до 3 сторон одновременно) local PosGrid = Instance.new("Frame") PosGrid.Size = UDim2.new(1, -16, 0, 68) PosGrid.Position = UDim2.new(0, 8, 0, 120) PosGrid.BackgroundTransparency = 1 PosGrid.Parent = MainFrame local UIGridLayout = Instance.new("UIGridLayout") UIGridLayout.CellSize = UDim2.new(0.3333, -4, 0, 30) UIGridLayout.CellPadding = UDim2.new(0, 6, 0, 6) UIGridLayout.FillDirectionMaxCells = 3 UIGridLayout.Parent = PosGrid local POSITION_MODES = { { name = "Сзади", dir = Vector3.new(0, 0, 1), opposite = "Впереди" }, { name = "Впереди", dir = Vector3.new(0, 0, -1), opposite = "Сзади" }, { name = "Слева", dir = Vector3.new(-1, 0, 0), opposite = "Справа" }, { name = "Справа", dir = Vector3.new(1, 0, 0), opposite = "Слева" }, { name = "Сверху", dir = Vector3.new(0, 1, 0), opposite = "Снизу" }, { name = "Снизу", dir = Vector3.new(0, -1, 0), opposite = "Сверху" }, } local modeLookup = {} for _, mode in ipairs(POSITION_MODES) do modeLookup[mode.name] = mode end local currentDistance = DEFAULT_DISTANCE local selectedModes = { "Сзади" } -- максимум 3 стороны local modeButtons = {} -- Список игроков (внизу, после всех панелей) local ListFrame = Instance.new("ScrollingFrame") ListFrame.Size = UDim2.new(1, -16, 1, -202) ListFrame.Position = UDim2.new(0, 8, 0, 194) ListFrame.BackgroundColor3 = Color3.fromRGB(38, 38, 46) ListFrame.BorderSizePixel = 0 ListFrame.ScrollBarThickness = 5 ListFrame.CanvasSize = UDim2.new(0, 0, 0, 0) ListFrame.Parent = MainFrame local UIListLayout = Instance.new("UIListLayout") UIListLayout.Padding = UDim.new(0, 4) UIListLayout.Parent = ListFrame -- Состояние local alive = true local enabled = false local isPinned = false local isMinimized = false local selectedPlayers = {} -- без ограничения по количеству local activeTarget = nil local playerButtons = {} local connections = {} local function getCombinedOffset() local totalDir = Vector3.zero for _, modeName in ipairs(selectedModes) do local mode = modeLookup[modeName] if mode then totalDir += mode.dir end end if totalDir.Magnitude > 0 then totalDir = totalDir.Unit end return totalDir * currentDistance end local function getModesLabel() if #selectedModes == 0 then return "Без смещения" end return table.concat(selectedModes, " + ") end local function applyDistanceInput(syncText) local cleaned = DistBox.Text:gsub(",", ".") local num = tonumber(cleaned) if num and num >= 0 and num <= 500 then currentDistance = num if syncText then DistBox.Text = tostring(num) end elseif syncText then DistBox.Text = tostring(currentDistance) end end DistBox.FocusLost:Connect(function() applyDistanceInput(true) end) DistBox:GetPropertyChangedSignal("Text"):Connect(function() applyDistanceInput(false) end) local function getHRP(player) if not player or not player.Parent then return nil end local char = player.Character return char and char:FindFirstChild("HumanoidRootPart") end local function recoverCharacterFromGround() local char = LocalPlayer.Character local myHRP = getHRP(LocalPlayer) if not char or not myHRP then return end myHRP.AssemblyLinearVelocity = Vector3.zero myHRP.AssemblyAngularVelocity = Vector3.zero local rayParams = RaycastParams.new() rayParams.FilterType = Enum.RaycastFilterType.Exclude rayParams.FilterDescendantsInstances = { char } local origin = myHRP.Position local upResult = workspace:Raycast(origin, Vector3.new(0, 18, 0), rayParams) if upResult then myHRP.CFrame = CFrame.new(origin.X, upResult.Position.Y + 3.5, origin.Z) * myHRP.CFrame.Rotation origin = myHRP.Position end local downResult = workspace:Raycast(origin + Vector3.new(0, 5, 0), Vector3.new(0, -15, 0), rayParams) if downResult then local safeY = math.max(origin.Y, downResult.Position.Y + 3.3) myHRP.CFrame = CFrame.new(origin.X, safeY, origin.Z) * myHRP.CFrame.Rotation else myHRP.CFrame = myHRP.CFrame + Vector3.new(0, 4, 0) end local hum = char:FindFirstChildOfClass("Humanoid") if hum then hum:ChangeState(Enum.HumanoidStateType.GettingUp) end end local function getDistanceText(targetPlayer) local myHRP = getHRP(LocalPlayer) local targetHRP = getHRP(targetPlayer) if not myHRP or not targetHRP then return "—" end local dist = math.floor((myHRP.Position - targetHRP.Position).Magnitude + 0.5) return tostring(dist) .. " st" end local function formatPlayerButtonText(plr) local idx = table.find(selectedPlayers, plr) local distText = getDistanceText(plr) if idx then return plr.DisplayName .. " (@" .. plr.Name .. ") [" .. idx .. "] | " .. distText end return plr.DisplayName .. " (@" .. plr.Name .. ") | " .. distText end local function updateStatusUI() local stateLabel = enabled and ("ВКЛ (" .. getModesLabel() .. ", " .. tostring(currentDistance) .. "st)") or "ВЫКЛ" Title.Text = "Цели: " .. tostring(#selectedPlayers) .. " | " .. stateLabel if enabled then OnBtn.BackgroundColor3 = Color3.fromRGB(65, 200, 105) OffBtn.BackgroundColor3 = Color3.fromRGB(130, 40, 40) else OnBtn.BackgroundColor3 = Color3.fromRGB(40, 120, 65) OffBtn.BackgroundColor3 = Color3.fromRGB(205, 55, 55) end end local function refreshModeButtons() for modeName, btn in pairs(modeButtons) do local idx = table.find(selectedModes, modeName) local modeData = modeLookup[modeName] if idx then btn.BackgroundColor3 = Color3.fromRGB(65, 115, 210) btn.Text = modeName .. " [" .. idx .. "]" else btn.BackgroundColor3 = Color3.fromRGB(50, 50, 62) btn.Text = modeName end if modeData then btn.TextColor3 = Color3.fromRGB(240, 240, 245) end end updateStatusUI() end local function togglePositionMode(mode) local existingIdx = table.find(selectedModes, mode.name) if existingIdx then table.remove(selectedModes, existingIdx) refreshModeButtons() return end -- Убираем противоположную сторону, если она была выбрана local oppIdx = table.find(selectedModes, mode.opposite) if oppIdx then table.remove(selectedModes, oppIdx) end -- Ограничение: не более 3 сторон одновременно if #selectedModes >= 3 then table.remove(selectedModes, 1) end table.insert(selectedModes, mode.name) refreshModeButtons() end for _, mode in ipairs(POSITION_MODES) do local btn = Instance.new("TextButton") btn.BackgroundColor3 = Color3.fromRGB(50, 50, 62) btn.BorderSizePixel = 0 btn.Text = mode.name btn.TextColor3 = Color3.fromRGB(240, 240, 245) btn.TextSize = 12 btn.Font = Enum.Font.GothamBold btn.Parent = PosGrid btn.MouseButton1Click:Connect(function() togglePositionMode(mode) end) modeButtons[mode.name] = btn end refreshModeButtons() local function teleportToTarget(targetPlayer) local char = LocalPlayer.Character local myHRP = getHRP(LocalPlayer) local targetHRP = getHRP(targetPlayer) if myHRP and targetHRP then local desiredPos = targetHRP.CFrame:PointToWorldSpace(getCombinedOffset()) if char then local rayParams = RaycastParams.new() rayParams.FilterType = Enum.RaycastFilterType.Exclude rayParams.FilterDescendantsInstances = { char, targetPlayer.Character } local floorHit = workspace:Raycast(desiredPos + Vector3.new(0, 2, 0), Vector3.new(0, -10, 0), rayParams) if floorHit and desiredPos.Y < floorHit.Position.Y + 2.8 then desiredPos = Vector3.new(desiredPos.X, floorHit.Position.Y + 2.8, desiredPos.Z) end end local lookTarget = Vector3.new(targetHRP.Position.X, desiredPos.Y, targetHRP.Position.Z) if (lookTarget - desiredPos).Magnitude < 0.01 then lookTarget = targetHRP.Position end myHRP.AssemblyLinearVelocity = Vector3.zero myHRP.AssemblyAngularVelocity = Vector3.zero myHRP.CFrame = CFrame.lookAt(desiredPos, lookTarget) end end local function refreshButtonHighlights() for plr, btn in pairs(playerButtons) do if plr and plr.Parent then local idx = table.find(selectedPlayers, plr) if idx then btn.BackgroundColor3 = Color3.fromRGB(65, 115, 210) else btn.BackgroundColor3 = Color3.fromRGB(52, 52, 62) end btn.Text = formatPlayerButtonText(plr) end end updateStatusUI() end local function cleanupInvalidPlayers() for i = #selectedPlayers, 1, -1 do if not selectedPlayers[i] or not selectedPlayers[i].Parent then table.remove(selectedPlayers, i) end end end local function togglePlayerSelection(plr) local existingIndex = table.find(selectedPlayers, plr) if existingIndex then table.remove(selectedPlayers, existingIndex) else table.insert(selectedPlayers, plr) end cleanupInvalidPlayers() if #selectedPlayers > 0 then if not activeTarget or not table.find(selectedPlayers, activeTarget) then activeTarget = selectedPlayers[1] end else activeTarget = nil end refreshButtonHighlights() end local function rebuildPlayerList() cleanupInvalidPlayers() local savedScroll = ListFrame.CanvasPosition for _, child in ipairs(ListFrame:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end table.clear(playerButtons) for _, plr in ipairs(Players:GetPlayers()) do if plr ~= LocalPlayer then local btn = Instance.new("TextButton") btn.Size = UDim2.new(1, -6, 0, 30) btn.BackgroundColor3 = Color3.fromRGB(52, 52, 62) btn.BorderSizePixel = 0 btn.TextColor3 = Color3.fromRGB(240, 240, 245) btn.TextSize = 12 btn.Font = Enum.Font.Gotham btn.Parent = ListFrame btn.MouseButton1Click:Connect(function() togglePlayerSelection(plr) end) playerButtons[plr] = btn end end refreshButtonHighlights() ListFrame.CanvasSize = UDim2.new(0, 0, 0, UIListLayout.AbsoluteContentSize.Y + 6) ListFrame.CanvasPosition = savedScroll end -- Кнопка Пин PinBtn.MouseButton1Click:Connect(function() isPinned = not isPinned MainFrame.Draggable = not isPinned if isPinned then PinBtn.BackgroundColor3 = Color3.fromRGB(65, 115, 210) else PinBtn.BackgroundColor3 = Color3.fromRGB(52, 52, 64) end end) -- Кнопка Свернуть (-) MinBtn.MouseButton1Click:Connect(function() isMinimized = not isMinimized if isMinimized then MainFrame.Size = COLLAPSED_SIZE PowerFrame.Visible = false DistFrame.Visible = false PosGrid.Visible = false ListFrame.Visible = false MinBtn.Text = "+" else MainFrame.Size = EXPANDED_SIZE PowerFrame.Visible = true DistFrame.Visible = true PosGrid.Visible = true ListFrame.Visible = true MinBtn.Text = "-" end end) -- Кнопка Закрыть (❌) CloseBtn.MouseButton1Click:Connect(function() local wasEnabled = enabled alive = false enabled = false table.clear(selectedPlayers) if wasEnabled then recoverCharacterFromGround() end for _, conn in ipairs(connections) do if conn.Connected then conn:Disconnect() end end if ScreenGui and ScreenGui.Parent then ScreenGui:Destroy() end end) -- Кнопка "Вкл" (работает даже если целей 0) OnBtn.MouseButton1Click:Connect(function() cleanupInvalidPlayers() if #selectedPlayers > 0 and (not activeTarget or not table.find(selectedPlayers, activeTarget)) then activeTarget = selectedPlayers[1] end enabled = true updateStatusUI() end) -- Кнопка "Выкл" OffBtn.MouseButton1Click:Connect(function() enabled = false updateStatusUI() recoverCharacterFromGround() end) table.insert(connections, Players.PlayerAdded:Connect(function() task.wait(0.1) if alive then rebuildPlayerList() end end)) table.insert(connections, Players.PlayerRemoving:Connect(function(plr) local idx = table.find(selectedPlayers, plr) if idx then table.remove(selectedPlayers, idx) end if activeTarget == plr then activeTarget = selectedPlayers[1] end if alive then rebuildPlayerList() end end)) -- Автообновление списка игроков каждые 1 секунду task.spawn(function() while alive do task.wait(1) if alive then rebuildPlayerList() end end end) -- Цикл переключения между выбранными игроками (по 2 сек на каждого) task.spawn(function() while alive do if enabled and #selectedPlayers >= 2 then local index = 1 while alive and enabled and #selectedPlayers >= 2 do cleanupInvalidPlayers() if #selectedPlayers < 2 then break end if index > #selectedPlayers then index = 1 end local candidate = selectedPlayers[index] if candidate and candidate.Parent then activeTarget = candidate task.wait(2) end index += 1 end else task.wait(0.1) end end end) -- Постоянное удержание в выбранной позиции и обновление дистанции в кнопках table.insert(connections, RunService.Heartbeat:Connect(function() if not alive then return end if not isMinimized and ListFrame.Visible then for plr, btn in pairs(playerButtons) do if plr and plr.Parent and btn and btn.Parent then btn.Text = formatPlayerButtonText(plr) end end end if not enabled then return end cleanupInvalidPlayers() if #selectedPlayers == 0 then activeTarget = nil return end if #selectedPlayers == 1 then activeTarget = selectedPlayers[1] elseif not activeTarget or not activeTarget.Parent or not table.find(selectedPlayers, activeTarget) then activeTarget = selectedPlayers[1] end teleportToTarget(activeTarget) end)) rebuildPlayerList()