--Used ai fully made by neosnapp --Pls support me report bugs discord : neo_snap_31882 -- Services local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") -- Variables local LocalPlayer = Players.LocalPlayer local Camera = workspace.CurrentCamera -- Configuration local Settings = { LockEnabled = false, ToggleKey = Enum.KeyCode.C, Smoothness = 0.2, -- 0.1 to 0.5 (PS5 feel) TargetPart = "HumanoidRootPart", TeamCheck = false -- Set to true to ignore teammates } -- Function to find the NEAREST player by distance (3D Distance) local function GetNearestPlayer() local target = nil local shortestDistance = math.huge -- Start with infinity for _, player in pairs(Players:GetPlayers()) do if player ~= LocalPlayer and player.Character then local root = player.Character:FindFirstChild(Settings.TargetPart) local hum = player.Character:FindFirstChild("Humanoid") local myRoot = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart") if root and hum and hum.Health > 0 and myRoot then if Settings.TeamCheck and player.Team == LocalPlayer.Team then continue end -- Calculate 3D distance between you and the enemy local distance = (myRoot.Position - root.Position).Magnitude -- Check if player is on screen (to avoid snapping to people behind walls) local _, isVisible = Camera:WorldToViewportPoint(root.Position) if isVisible and distance < shortestDistance then target = root shortestDistance = distance end end end end return target end -- Toggle Input UserInputService.InputBegan:Connect(function(input, processed) if not processed and input.KeyCode == Settings.ToggleKey then Settings.LockEnabled = not Settings.LockEnabled end end) -- Main Loop RunService:BindToRenderStep("ProximityLock", 201, function() if Settings.LockEnabled then local target = GetNearestPlayer() if target then -- Smooth PS5-style transition to the nearest body local targetCFrame = CFrame.lookAt(Camera.CFrame.Position, target.Position) Camera.CFrame = Camera.CFrame:Lerp(targetCFrame, Settings.Smoothness) end end end)