-- NINJA AIM CONTROL V2 -- Roblox Studio | StarterPlayerScripts | LocalScript local Players = game:GetService("Players") local UIS = game:GetService("UserInputService") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local camera = workspace.CurrentCamera local settings = { Highlight = false, CameraTracker = false, Wallcheck = true, Teamcheck = false, Smoothness = 50, FOV = 100 } local trackedPlayer = nil -- GUI local gui = Instance.new("ScreenGui") gui.Name = "NinjaAimUI" gui.ResetOnSpawn = false gui.IgnoreGuiInset = true gui.DisplayOrder = 100 gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling gui.Parent = player:WaitForChild("PlayerGui") -- MAIN MENU local main = Instance.new("Frame") main.Size = UDim2.fromOffset(270, 355) main.Position = UDim2.new(0.5, -135, 0.5, -177.5) main.BackgroundColor3 = Color3.fromRGB(20, 20, 27) main.BorderSizePixel = 0 main.Active = true main.Draggable = true main.Visible = true main.ZIndex = 2 main.Parent = gui Instance.new("UICorner", main).CornerRadius = UDim.new(0, 10) -- TITLE local title = Instance.new("TextLabel") title.Size = UDim2.new(1, 0, 0, 45) title.BackgroundColor3 = Color3.fromRGB(35, 35, 48) title.Text = "NINJA | AIM CONTROL V2" title.TextColor3 = Color3.new(1, 1, 1) title.Font = Enum.Font.GothamBold title.TextSize = 14 title.ZIndex = 3 title.Parent = main Instance.new("UICorner", title).CornerRadius = UDim.new(0, 10) -- CLOSE BUTTON local closeButton = Instance.new("TextButton") closeButton.Size = UDim2.fromOffset(35, 35) closeButton.Position = UDim2.new(1, -40, 0, 5) closeButton.BackgroundColor3 = Color3.fromRGB(180, 45, 45) closeButton.Text = "X" closeButton.TextColor3 = Color3.new(1, 1, 1) closeButton.Font = Enum.Font.GothamBold closeButton.TextSize = 16 closeButton.ZIndex = 10 closeButton.Parent = main Instance.new("UICorner", closeButton).CornerRadius = UDim.new(0, 7) -- FLOATING N BUTTON local reopenButton = Instance.new("TextButton") reopenButton.Name = "ReopenButton" reopenButton.Size = UDim2.fromOffset(55, 55) reopenButton.Position = UDim2.new(0, 15, 0.5, -27) reopenButton.BackgroundColor3 = Color3.fromRGB(75, 65, 145) reopenButton.Text = "N" reopenButton.TextColor3 = Color3.new(1, 1, 1) reopenButton.Font = Enum.Font.GothamBold reopenButton.TextSize = 25 reopenButton.Visible = false reopenButton.Active = true reopenButton.Selectable = true reopenButton.ZIndex = 100 reopenButton.Parent = gui Instance.new("UICorner", reopenButton).CornerRadius = UDim.new(1, 0) -- CLOSE / REOPEN local function closeMenu() main.Visible = false reopenButton.Visible = true end local function openMenu() main.Visible = true reopenButton.Visible = false end closeButton.Activated:Connect(closeMenu) -- MOBILE + PC N BUTTON DRAG AND TAP local nDragging = false local nMoved = false local nStartPosition local nStartInputPosition local nActiveInput reopenButton.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then nDragging = true nMoved = false nActiveInput = input nStartPosition = reopenButton.Position nStartInputPosition = input.Position end end) UIS.InputChanged:Connect(function(input) if not nDragging then return end local isMouse = input.UserInputType == Enum.UserInputType.MouseMovement and nActiveInput.UserInputType == Enum.UserInputType.MouseButton1 local isTouch = input == nActiveInput if isMouse or isTouch then local delta = input.Position - nStartInputPosition if delta.Magnitude > 5 then nMoved = true end reopenButton.Position = UDim2.new( nStartPosition.X.Scale, nStartPosition.X.Offset + delta.X, nStartPosition.Y.Scale, nStartPosition.Y.Offset + delta.Y ) end end) UIS.InputEnded:Connect(function(input) if not nDragging then return end if input == nActiveInput or input.UserInputType == Enum.UserInputType.MouseButton1 then nDragging = false if not nMoved then openMenu() end nActiveInput = nil end end) -- FOV CIRCLE local circle = Instance.new("Frame") circle.Name = "FOVCircle" circle.AnchorPoint = Vector2.new(0.5, 0.5) circle.BackgroundTransparency = 1 circle.BorderSizePixel = 0 circle.ZIndex = 1 circle.Active = false circle.Parent = gui local stroke = Instance.new("UIStroke") stroke.Color = Color3.fromRGB(125, 105, 255) stroke.Thickness = 1.5 stroke.Parent = circle Instance.new("UICorner", circle).CornerRadius = UDim.new(1, 0) -- TOGGLES local function createToggle(name, key, y) local button = Instance.new("TextButton") button.Size = UDim2.new(1, -24, 0, 35) button.Position = UDim2.fromOffset(12, y) button.BackgroundColor3 = Color3.fromRGB(40, 40, 53) button.TextColor3 = Color3.new(1, 1, 1) button.Font = Enum.Font.Gotham button.TextSize = 13 button.ZIndex = 4 button.Parent = main Instance.new("UICorner", button).CornerRadius = UDim.new(0, 6) local function refresh() button.Text = name .. ": " .. (settings[key] and "ON" or "OFF") button.BackgroundColor3 = settings[key] and Color3.fromRGB(75, 65, 145) or Color3.fromRGB(40, 40, 53) end refresh() button.Activated:Connect(function() settings[key] = not settings[key] refresh() end) end -- SLIDERS (ANDROID + PC) local function createSlider(name, key, y, min, max, default) settings[key] = default local label = Instance.new("TextLabel") label.Size = UDim2.new(1, -24, 0, 22) label.Position = UDim2.fromOffset(12, y) label.BackgroundTransparency = 1 label.TextColor3 = Color3.new(1, 1, 1) label.Font = Enum.Font.Gotham label.TextSize = 12 label.TextXAlignment = Enum.TextXAlignment.Left label.ZIndex = 4 label.Parent = main local slider = Instance.new("TextButton") slider.Size = UDim2.new(1, -24, 0, 18) slider.Position = UDim2.fromOffset(12, y + 22) slider.BackgroundColor3 = Color3.fromRGB(55, 55, 70) slider.Text = "" slider.Active = true slider.AutoButtonColor = false slider.ZIndex = 4 slider.Parent = main Instance.new("UICorner", slider).CornerRadius = UDim.new(1, 0) local fill = Instance.new("Frame") fill.BackgroundColor3 = Color3.fromRGB(125, 105, 255) fill.BorderSizePixel = 0 fill.Size = UDim2.fromScale( (default - min) / (max - min), 1 ) fill.Active = false fill.ZIndex = 5 fill.Parent = slider Instance.new("UICorner", fill).CornerRadius = UDim.new(1, 0) local dragging = false local activeInput = nil local function update(x) local width = slider.AbsoluteSize.X if width <= 0 then return end local percent = math.clamp( (x - slider.AbsolutePosition.X) / width, 0, 1 ) settings[key] = math.floor( min + percent * (max - min) + 0.5 ) fill.Size = UDim2.fromScale(percent, 1) label.Text = name .. ": " .. settings[key] end label.Text = name .. ": " .. default slider.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true activeInput = input update(input.Position.X) end end) UIS.InputChanged:Connect(function(input) if not dragging then return end if input == activeInput then update(input.Position.X) elseif input.UserInputType == Enum.UserInputType.MouseMovement and activeInput and activeInput.UserInputType == Enum.UserInputType.MouseButton1 then update(input.Position.X) end end) UIS.InputEnded:Connect(function(input) if input == activeInput or input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = false activeInput = nil end end) end -- UI CONTROLS createToggle("ESP", "Highlight", 60) createToggle("Camera Tracker", "CameraTracker", 103) createToggle("Wallcheck", "Wallcheck", 146) createToggle("Teamcheck", "Teamcheck", 189) createSlider("Smoothness", "Smoothness", 245, 1, 100, 50) createSlider("FOV", "FOV", 305, 10, 300, 100) -- BOT TEAM DETECTION local function getBotTeam(model) local attribute = model:GetAttribute("Team") if attribute ~= nil then return tostring(attribute) end local teamValue = model:FindFirstChild("Team") if teamValue and teamValue:IsA("StringValue") then return teamValue.Value end return nil end -- TEAM FILTERING local function isSameTeam(target) if not settings.Teamcheck then return false end if target:IsA("Player") then return player.Team ~= nil and target.Team == player.Team end local botTeam = getBotTeam(target) if player.Team and botTeam then return botTeam == player.Team.Name end return false end -- GET ESP TARGET PART -- Supports different character and bot rigs. local function getTargetPart(model) return model:FindFirstChild("Head") or model:FindFirstChild("HumanoidRootPart") or model:FindFirstChild("UpperTorso") or model:FindFirstChild("Torso") end -- ESP HIGHLIGHTS local highlights = {} local function isVisible(model, targetPart) if not targetPart then return false end local origin = camera.CFrame.Position local direction = targetPart.Position - origin local params = RaycastParams.new() params.FilterType = Enum.RaycastFilterType.Exclude params.FilterDescendantsInstances = { player.Character } local result = workspace:Raycast( origin, direction, params ) return result == nil or result.Instance:IsDescendantOf(model) end local function updateModelESP(model, enabled) if not enabled then local old = highlights[model] if old then old:Destroy() highlights[model] = nil end return end local humanoid = model:FindFirstChildOfClass("Humanoid") local targetPart = getTargetPart(model) if not humanoid or not targetPart or humanoid.Health <= 0 then local old = highlights[model] if old then old:Destroy() highlights[model] = nil end return end local highlight = highlights[model] if not highlight then highlight = Instance.new("Highlight") highlight.Name = "NinjaESP" highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop highlight.Parent = workspace highlights[model] = highlight end highlight.Adornee = model highlight.Enabled = true if isVisible(model, targetPart) then highlight.FillColor = Color3.fromRGB(0, 255, 0) highlight.OutlineColor = Color3.fromRGB(0, 255, 0) else highlight.FillColor = Color3.fromRGB(255, 0, 0) highlight.OutlineColor = Color3.fromRGB(255, 0, 0) end end -- PLAYER + BOT ESP local function updateHighlights() local activeModels = {} if settings.Highlight then -- PLAYER ESP for _, target in ipairs(Players:GetPlayers()) do if target ~= player and target.Character then local character = target.Character local humanoid = character:FindFirstChildOfClass("Humanoid") if humanoid and humanoid.Health > 0 and not isSameTeam(target) then activeModels[character] = true updateModelESP(character, true) end end end -- BOT ESP -- Detects NPC models with a Humanoid. -- Does not require a Head part. for _, object in ipairs(workspace:GetDescendants()) do if object:IsA("Model") and Players:GetPlayerFromCharacter(object) == nil and object ~= player.Character then local humanoid = object:FindFirstChildOfClass("Humanoid") if humanoid and humanoid.Health > 0 and getTargetPart(object) and not isSameTeam(object) then activeModels[object] = true updateModelESP(object, true) end end end end -- CLEANUP for model, highlight in pairs(highlights) do if not activeModels[model] or not model.Parent then highlight:Destroy() highlights[model] = nil end end end -- PLAYER FILTERING FOR CAMERA TRACKER local function isValidTarget(target) if target == player then return false end local character = target.Character if not character then return false end local humanoid = character:FindFirstChildOfClass("Humanoid") local head = character:FindFirstChild("Head") if not humanoid or not head or humanoid.Health <= 0 then return false end if isSameTeam(target) then return false end if settings.Wallcheck then local origin = camera.CFrame.Position local direction = head.Position - origin local params = RaycastParams.new() params.FilterType = Enum.RaycastFilterType.Exclude params.FilterDescendantsInstances = { player.Character } local result = workspace:Raycast( origin, direction, params ) if result and not result.Instance:IsDescendantOf(character) then return false end end return true end -- CAMERA TRACKER local function getClosestPlayer() local closest = nil local shortestDistance = settings.FOV for _, target in ipairs(Players:GetPlayers()) do if isValidTarget(target) then local head = target.Character.Head local position, onScreen = camera:WorldToViewportPoint(head.Position) if onScreen then local distance = ( Vector2.new(position.X, position.Y) - camera.ViewportSize / 2 ).Magnitude if distance < shortestDistance then shortestDistance = distance closest = target end end end end return closest end -- FOV CIRCLE + MAIN UPDATE RunService.RenderStepped:Connect(function(dt) camera = workspace.CurrentCamera if not camera then return end local guiSize = gui.AbsoluteSize circle.Position = UDim2.fromOffset( guiSize.X / 2, guiSize.Y / 2 ) circle.Size = UDim2.fromOffset( settings.FOV * 2, settings.FOV * 2 ) circle.Visible = true updateHighlights() if settings.CameraTracker then trackedPlayer = getClosestPlayer() if trackedPlayer and trackedPlayer.Character then local head = trackedPlayer.Character:FindFirstChild("Head") if head then local targetCFrame = CFrame.lookAt( camera.CFrame.Position, head.Position ) local alpha = 1 - math.exp( -settings.Smoothness / 20 * dt ) camera.CFrame = camera.CFrame:Lerp( targetCFrame, alpha ) end end end end) -- RESTORE CAMERA WHEN DISABLED local function restoreCamera() camera = workspace.CurrentCamera if not camera then return end camera.CameraType = Enum.CameraType.Custom local character = player.Character local humanoid = character and character:FindFirstChildOfClass("Humanoid") if humanoid then camera.CameraSubject = humanoid end end settings._previousTracker = false RunService.RenderStepped:Connect(function() if settings._previousTracker and not settings.CameraTracker then restoreCamera() end settings._previousTracker = settings.CameraTracker end) print("NINJA AIM CONTROL V2 loaded!")