-- [[ Rscripts Risk Notice ]] -- This script is not verified by rscripts.net. Deal with caution. -- -- Stay safe: -- • Never log in on unofficial Roblox sites or lookalike domains. -- • Real Roblox links use roblox.com (check the .com ending). -- • Treat fake Roblox login / "claim reward" pages as phishing. -- [[ End Rscripts Risk Notice ]] local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local ReplicatedFirst = game:GetService("ReplicatedFirst") local Camera = workspace.CurrentCamera local CustomMeshCharacter = require(ReplicatedFirst.GunSystemPlugins.CustomMeshCharacter) local LocalFriendlyService = require(ReplicatedFirst.Core.Services.LocalFriendlyService) local targetPosition = nil local function IsVisible(entry, origin) local myChar = CustomMeshCharacter:GetWorldCharacterFromPlayer(game:GetService("Players").LocalPlayer) if not myChar then return true end local targetPos = entry.part.Position local direction = targetPos - origin local params = RaycastParams.new() params.FilterType = Enum.RaycastFilterType.Exclude params.FilterDescendantsInstances = { myChar } params.IgnoreWater = true local result = workspace:Raycast(origin, direction, params) if not result then return true end return result.Instance:IsDescendantOf(entry.char) end local function GetEnemyTargets() local result = {} local enemies = LocalFriendlyService:GetEnemyPlayers() for _, player in enemies do if player:GetAttribute("Dead") then continue end local char = CustomMeshCharacter:GetWorldCharacterFromPlayer(player) if not char then continue end local hitbox = char:FindFirstChild("Hitbox") if not hitbox then continue end local part = hitbox:FindFirstChild("Chest") if not part then continue end table.insert(result, { player = player, char = char, part = part }) end return result end local function GetClosestTarget(origin) local mousePos = UserInputService:GetMouseLocation() local best, bestDist = nil, math.huge for _, entry in GetEnemyTargets() do if not IsVisible(entry, origin) then continue end local screenPos, onScreen = Camera:WorldToViewportPoint(entry.part.Position) if not onScreen then continue end local dist = (Vector2.new(screenPos.X, screenPos.Y) - mousePos).Magnitude if dist < bestDist then bestDist = dist best = entry end end return best end local CamerasTable = filtergc("table", { Keys = { "LookCamera" } }, true) RunService.RenderStepped:Connect(function() local lc = CamerasTable and CamerasTable.LookCamera if not lc then return end local origin = lc.ComputedFocalPoint or lc.CFrame.Position local best = GetClosestTarget(origin) targetPosition = best and best.part.Position or nil if not targetPosition then return end local cf = CFrame.lookAt(origin, targetPosition) local pitch, yaw = cf:ToEulerAnglesYXZ() lc.Orientation.Pitch = pitch lc.Orientation.Yaw = yaw lc.Orientation.Roll = 0 lc.ComputedOrientation.Pitch = pitch + lc.OrientationOffset.Pitch lc.ComputedOrientation.Yaw = yaw + lc.OrientationOffset.Yaw lc.ComputedOrientation.Roll = lc.OrientationOffset.Roll end)