local Players = game:GetService("Players") local VirtualInputManager = game:GetService("VirtualInputManager") local player = Players.LocalPlayer local function getCharacter() return player.Character or player.CharacterAdded:Wait() end local function getRoot() return getCharacter():WaitForChild("HumanoidRootPart") end local function pressQ() VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.Q, false, game) task.wait(0.05) VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.Q, false, game) end local SAVE_PART_NAME = "SavePart" local function makeSavePart() local root = getRoot() local savePart = workspace:FindFirstChild(SAVE_PART_NAME) if not savePart then savePart = Instance.new("Part") savePart.Name = SAVE_PART_NAME savePart.Size = Vector3.new(4, 1, 4) savePart.Anchored = true savePart.CanCollide = true savePart.Color = Color3.fromRGB(0, 255, 0) savePart.Parent = workspace end savePart.CFrame = CFrame.new(root.Position - Vector3.new(0, 3, 0)) end local function isDownedCharacter(character) if not character then return false end if character:GetAttribute("Downed") == true then return true end if character:GetAttribute("downed") == true then return true end local downed = character:FindFirstChild("Downed") if downed and downed:IsA("BoolValue") and downed.Value == true then return true end local knocked = character:FindFirstChild("Knocked") if knocked and knocked:IsA("BoolValue") and knocked.Value == true then return true end local ko = character:FindFirstChild("KO") if ko and ko:IsA("BoolValue") and ko.Value == true then return true end local humanoid = character:FindFirstChildOfClass("Humanoid") if humanoid and humanoid.Health > 0 and humanoid.PlatformStand then return true end return false end local function findNearestDownedRoot() local myRoot = getRoot() local nearestRoot = nil local nearestDistance = math.huge for _, otherPlayer in ipairs(Players:GetPlayers()) do if otherPlayer ~= player then local character = otherPlayer.Character if character and isDownedCharacter(character) then local root = character:FindFirstChild("HumanoidRootPart") if root then local distance = (myRoot.Position - root.Position).Magnitude if distance < nearestDistance then nearestDistance = distance nearestRoot = root end end end end end return nearestRoot end local busy = false local function rescue() if busy then return end busy = true local root = getRoot() local targetRoot = findNearestDownedRoot() if not targetRoot then warn("No downed player found") busy = false return end local savePart = workspace:FindFirstChild(SAVE_PART_NAME) if not savePart then warn("Make SavePart first") busy = false return end -- TP to downed player root.CFrame = targetRoot.CFrame + Vector3.new(0, 2, 0) task.wait(0.6) pressQ() task.wait(0.2) -- TP high root.CFrame = root.CFrame + Vector3.new(300,10000, 0) task.wait(2) pressQ() task.wait(0.6) -- TP back root.CFrame = savePart.CFrame + Vector3.new(0, 3, 0) busy = false end local gui = Instance.new("ScreenGui") gui.Name = "RescueGui" gui.ResetOnSpawn = false gui.Parent = player:WaitForChild("PlayerGui") local saveBtn = Instance.new("TextButton") saveBtn.Size = UDim2.new(0, 150, 0, 50) saveBtn.Position = UDim2.new(0, 20, 0.5, -60) saveBtn.Text = "Save" saveBtn.Parent = gui local rescueBtn = Instance.new("TextButton") rescueBtn.Size = UDim2.new(0, 150, 0, 50) rescueBtn.Position = UDim2.new(0, 20, 0.5, 10) rescueBtn.Text = "Rescue" rescueBtn.Parent = gui saveBtn.MouseButton1Click:Connect(makeSavePart) rescueBtn.MouseButton1Click:Connect(rescue)