-- [[ 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 UIS = game:GetService("UserInputService") local Players = game:GetService("Players") local RunService = game:GetService("RunService") local LocalPlayer = Players.LocalPlayer local camera = workspace.CurrentCamera local TARGET_MODE = "CROSSHAIR" local TARGET_PART = "HumanoidRootPart" local CLOSE_SPEED = 0.33 local BASE_SPEED = 0.33 local FAR_SPEED = 0.33 local MAX_DISTANCE = 250 local FOV_ANGLE = 45 local TRACK_THROUGH_WALLS = false local FOV_STICKY_BUFFER = 10 local BASE_DISTANCE = 50 local aimTrackingConnection = nil local currentTarget = nil local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "TargetModeGui" ScreenGui.ResetOnSpawn = false ScreenGui.Parent = LocalPlayer:WaitForChild("PlayerGui") local Main = Instance.new("Frame") Main.Size = UDim2.new(0, 220, 0, 110) Main.Position = UDim2.new(0.5, -110, 0.25, 0) Main.BackgroundColor3 = Color3.fromRGB(25, 25, 25) Main.BorderSizePixel = 0 Main.Active = true Main.Parent = ScreenGui local Corner = Instance.new("UICorner") Corner.CornerRadius = UDim.new(0, 8) Corner.Parent = Main local Title = Instance.new("TextLabel") Title.Size = UDim2.new(1, 0, 0, 35) Title.BackgroundTransparency = 1 Title.Text = "Target Mode" Title.TextColor3 = Color3.fromRGB(255, 255, 255) Title.TextSize = 18 Title.Font = Enum.Font.GothamBold Title.Parent = Main local CrosshairButton = Instance.new("TextButton") CrosshairButton.Size = UDim2.new(0, 95, 0, 45) CrosshairButton.Position = UDim2.new(0, 10, 0, 50) CrosshairButton.Text = "Crosshair" CrosshairButton.TextColor3 = Color3.fromRGB(255, 255, 255) CrosshairButton.TextSize = 14 CrosshairButton.Font = Enum.Font.GothamSemibold CrosshairButton.BorderSizePixel = 0 CrosshairButton.Parent = Main local CrosshairCorner = Instance.new("UICorner") CrosshairCorner.CornerRadius = UDim.new(0, 6) CrosshairCorner.Parent = CrosshairButton local ClosestButton = Instance.new("TextButton") ClosestButton.Size = UDim2.new(0, 95, 0, 45) ClosestButton.Position = UDim2.new(0, 115, 0, 50) ClosestButton.Text = "Closest" ClosestButton.TextColor3 = Color3.fromRGB(255, 255, 255) ClosestButton.TextSize = 14 ClosestButton.Font = Enum.Font.GothamSemibold ClosestButton.BorderSizePixel = 0 ClosestButton.Parent = Main local ClosestCorner = Instance.new("UICorner") ClosestCorner.CornerRadius = UDim.new(0, 6) ClosestCorner.Parent = ClosestButton local function updateButtons() if TARGET_MODE == "CROSSHAIR" then CrosshairButton.BackgroundColor3 = Color3.fromRGB(0, 170, 255) ClosestButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50) else CrosshairButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50) ClosestButton.BackgroundColor3 = Color3.fromRGB(0, 170, 255) end end CrosshairButton.MouseButton1Click:Connect(function() TARGET_MODE = "CROSSHAIR" currentTarget = nil updateButtons() end) ClosestButton.MouseButton1Click:Connect(function() TARGET_MODE = "CLOSEST" currentTarget = nil updateButtons() end) updateButtons() local dragging = false local dragInput local dragStart local startPos Title.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = true dragStart = input.Position startPos = Main.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) Title.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement then dragInput = input end end) UIS.InputChanged:Connect(function(input) if input == dragInput and dragging then local delta = input.Position - dragStart Main.Position = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y ) end end) --// FOV local function isInFOV(targetPart, extraAngle) extraAngle = extraAngle or 0 local cameraDirection = camera.CFrame.LookVector local targetDirection = (targetPart.Position - camera.CFrame.Position).Unit local dotProduct = cameraDirection:Dot(targetDirection) local angle = math.deg(math.acos(math.clamp(dotProduct, -1, 1))) return angle <= (FOV_ANGLE + extraAngle) end --// Visibility local function isVisible(targetPart) if TRACK_THROUGH_WALLS then return true end local origin = camera.CFrame.Position local direction = targetPart.Position - origin local raycastParams = RaycastParams.new() raycastParams.FilterType = Enum.RaycastFilterType.Exclude local ignoreList = {} if LocalPlayer.Character then table.insert(ignoreList, LocalPlayer.Character) end if targetPart.Parent then table.insert(ignoreList, targetPart.Parent) end raycastParams.FilterDescendantsInstances = ignoreList local result = workspace:Raycast( origin, direction, raycastParams ) return result == nil end --// Target validation local function isValidTarget(player, isCurrent) if not player or player == LocalPlayer then return false end if player.Team and LocalPlayer.Team and player.Team == LocalPlayer.Team then return false end local char = player.Character if not char then return false end local humanoid = char:FindFirstChildOfClass("Humanoid") local targetPart = char:FindFirstChild(TARGET_PART) local hrp = char:FindFirstChild("HumanoidRootPart") local myChar = LocalPlayer.Character local myHrp = myChar and myChar:FindFirstChild("HumanoidRootPart") if not (humanoid and humanoid.Health > 0 and targetPart and hrp and myHrp) then return false end local distance = (myHrp.Position - hrp.Position).Magnitude if distance > MAX_DISTANCE then return false end -- CROSSHAIR MODE: -- No FOV restriction at all. -- -- CLOSEST MODE: -- Keeps the original 45 degree FOV behavior. if TARGET_MODE == "CROSSHAIR" then if not isVisible(targetPart) then return false end else local fovBuffer = isCurrent and FOV_STICKY_BUFFER or 0 if not isInFOV(targetPart, fovBuffer) then return false end if not isVisible(targetPart) then return false end end return true end --// Distance from mouse local function getDistanceFromCrosshair(targetPart) local mousePos = UIS:GetMouseLocation() local screenPos, onScreen = camera:WorldToViewportPoint(targetPart.Position) if not onScreen then return math.huge end local targetVector = Vector2.new(screenPos.X, screenPos.Y) return (mousePos - targetVector).Magnitude end --// Find closest target local function getClosestPlayer() local closestDistance = math.huge local closestPlayer = nil local myChar = LocalPlayer.Character if not myChar or not myChar:FindFirstChild("HumanoidRootPart") then return nil end for _, v in pairs(Players:GetPlayers()) do if isValidTarget(v, false) then local targetPart = v.Character:FindFirstChild(TARGET_PART) if targetPart then local distance if TARGET_MODE == "CROSSHAIR" then distance = getDistanceFromCrosshair(targetPart) else distance = (myChar.HumanoidRootPart.Position - v.Character.HumanoidRootPart.Position).Magnitude end if distance <= closestDistance then closestDistance = distance closestPlayer = v end end end end return closestPlayer end --// Get target local function getTarget() if currentTarget and isValidTarget(currentTarget, true) then return currentTarget end currentTarget = getClosestPlayer() return currentTarget end UIS.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.UserInputType == Enum.UserInputType.MouseButton2 then if aimTrackingConnection then aimTrackingConnection:Disconnect() end currentTarget = nil aimTrackingConnection = RunService.RenderStepped:Connect(function(deltaTime) local target = getTarget() local myChar = LocalPlayer.Character if target and target.Character and myChar and myChar:FindFirstChild("HumanoidRootPart") then local humanoid = target.Character:FindFirstChildOfClass("Humanoid") local targetPart = target.Character:FindFirstChild(TARGET_PART) if humanoid and humanoid.Health > 0 and targetPart and isVisible(targetPart) then local distance = (myChar.HumanoidRootPart.Position - targetPart.Position).Magnitude if distance <= MAX_DISTANCE then local dynamicSpeed if distance < BASE_DISTANCE then dynamicSpeed = CLOSE_SPEED elseif distance == BASE_DISTANCE then dynamicSpeed = BASE_SPEED else dynamicSpeed = FAR_SPEED end local smoothFactor = 1 - math.exp(-dynamicSpeed * deltaTime * 60) local targetCFrame = CFrame.new( camera.CFrame.Position, targetPart.Position ) camera.CFrame = camera.CFrame:Lerp( targetCFrame, smoothFactor ) end end end end) end end) UIS.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton2 then if aimTrackingConnection then aimTrackingConnection:Disconnect() aimTrackingConnection = nil end currentTarget = nil end end)