local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UIS = game:GetService("UserInputService") local plr = Players.LocalPlayer local cam repeat cam = workspace.CurrentCamera task.wait() until cam --------------------------------------------------- -- MODOS --------------------------------------------------- local MODE = "HOLD" local aiming = false --------------------------------------------------- -- HIGHLIGHTS --------------------------------------------------- local highlights = {} local function getHighlight(char) if not char then return end if highlights[char] and highlights[char].Parent then return highlights[char] end local h = Instance.new("Highlight") h.Name = "AimHighlight" h.FillTransparency = 1 h.OutlineTransparency = 0 h.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop h.Parent = char highlights[char] = h return h end --------------------------------------------------- -- INPUT --------------------------------------------------- UIS.InputBegan:Connect(function(i, gpe) if gpe then return end if i.KeyCode == Enum.KeyCode.M then if MODE == "HOLD" then MODE = "TOGGLE" print("Modo: TOGGLE") else MODE = "HOLD" aiming = false print("Modo: HOLD") end end if MODE == "TOGGLE" and i.KeyCode == Enum.KeyCode.T then aiming = not aiming print("Aiming:", aiming) end if MODE == "HOLD" and i.UserInputType == Enum.UserInputType.MouseButton2 then aiming = true end end) UIS.InputEnded:Connect(function(i) if MODE == "HOLD" and i.UserInputType == Enum.UserInputType.MouseButton2 then aiming = false end end) --------------------------------------------------- -- TARGET --------------------------------------------------- local function getClosest() local closest = nil local shortest = math.huge local center = Vector2.new(cam.ViewportSize.X/2, cam.ViewportSize.Y/2) for _, v in ipairs(Players:GetPlayers()) do if v ~= plr and v.Character then local hum = v.Character:FindFirstChild("Humanoid") local head = v.Character:FindFirstChild("Head") if hum and head and hum.Health > 0 then local pos, onScreen = cam:WorldToViewportPoint(head.Position) if onScreen then local dist = (Vector2.new(pos.X, pos.Y) - center).Magnitude if dist < shortest then shortest = dist closest = head end end end end end return closest end --------------------------------------------------- -- LOOP --------------------------------------------------- RunService.RenderStepped:Connect(function() local currentTarget = nil -- rojo a todos for _, v in ipairs(Players:GetPlayers()) do if v ~= plr and v.Character then local h = getHighlight(v.Character) if h then h.OutlineColor = Color3.fromRGB(255, 0, 0) end end end if aiming then local target = getClosest() if target then currentTarget = target.Parent local h = getHighlight(currentTarget) if h then h.OutlineColor = Color3.fromRGB(0, 255, 0) end local camPos = cam.CFrame.Position cam.CFrame = CFrame.new(camPos, target.Position) end end end)