-- TARGET LOCK + TEAMCHECK + WALLCHECK -- LocalScript local Players = game:GetService("Players") local RunService = game:GetService("RunService") local LocalPlayer = Players.LocalPlayer local Camera = workspace.CurrentCamera local Enabled = true local Smoothness = 0.12 local TeamCheck = true local WallCheck = true -- UI local ScreenGui = Instance.new("ScreenGui") ScreenGui.Parent = game.CoreGui local Toggle = Instance.new("TextButton") Toggle.Parent = ScreenGui Toggle.Size = UDim2.new(0, 70, 0, 28) Toggle.Position = UDim2.new(0.5, -35, 0.8, 0) Toggle.BackgroundColor3 = Color3.fromRGB(25,25,25) Toggle.TextColor3 = Color3.new(1,1,1) Toggle.Text = "LOCK : ON" Toggle.TextScaled = true Toggle.Active = true Toggle.Draggable = true Instance.new("UICorner", Toggle).CornerRadius = UDim.new(0,8) Toggle.MouseButton1Click:Connect(function() Enabled = not Enabled if Enabled then Toggle.Text = "LOCK : ON" else Toggle.Text = "LOCK : OFF" end end) -- WALLCHECK local function IsVisible(TargetPart) if not WallCheck then return true end local Origin = Camera.CFrame.Position local Direction = (TargetPart.Position - Origin) local Params = RaycastParams.new() Params.FilterType = Enum.RaycastFilterType.Blacklist Params.FilterDescendantsInstances = {LocalPlayer.Character} local Result = workspace:Raycast(Origin, Direction, Params) if Result and Result.Instance then return Result.Instance:IsDescendantOf(TargetPart.Parent) end return false end -- TARGET local function GetClosestTarget() local Closest = nil local Shortest = math.huge for _, Player in pairs(Players:GetPlayers()) do if Player ~= LocalPlayer and Player.Character then local Humanoid = Player.Character:FindFirstChild("Humanoid") local HRP = Player.Character:FindFirstChild("HumanoidRootPart") if Humanoid and HRP and Humanoid.Health > 0 then -- TEAMCHECK if TeamCheck and Player.Team == LocalPlayer.Team then continue end local Pos, Visible = Camera:WorldToViewportPoint(HRP.Position) if Visible and IsVisible(HRP) then local Distance = (Vector2.new(Pos.X, Pos.Y) - Vector2.new( Camera.ViewportSize.X / 2, Camera.ViewportSize.Y / 2 )).Magnitude if Distance < Shortest then Shortest = Distance Closest = HRP end end end end end return Closest end RunService.RenderStepped:Connect(function() if Enabled then local Target = GetClosestTarget() if Target then local Aim = CFrame.new(Camera.CFrame.Position, Target.Position) Camera.CFrame = Camera.CFrame:Lerp(Aim, Smoothness) end end end)