explore
key systems
new
docs
discord
search scripts
⌘K
explore
key systems
new
docs
discord
sign in
⌘↵
--
publishes from anywhere on this page
new paste
untitled.luau
empty
/ 512kb
open file
⌘O
explore
key systems
new
docs
sign in
slient-aim-with-team-check-open-source-copy.luau
53 lines · 1.6kb
/ 512kb
open file
⌘O
local target = nil local mod = filtergc("table", {Keys = {"SameTeam"}}, true) local function GetClosestPlayer() local closestDistance = math.huge local closest = nil local camera = workspace.CurrentCamera for _, v in pairs(game.Players:GetPlayers()) do if v == game.Players.LocalPlayer then continue end local char = v.Character if not char then continue end local hrp = char:FindFirstChild("HumanoidRootPart") if not hrp then continue end local head = char:FindFirstChild("Head") if not head then continue end local screenPos, onScreen = camera:WorldToViewportPoint(hrp.Position) if not mod:SameTeam(game.Players.LocalPlayer, v) then if onScreen then local distance = (Vector2.new(screenPos.X, screenPos.Y) - camera.ViewportSize / 2).Magnitude if distance < closestDistance then closestDistance = distance closest = head end end end end return closest end game:GetService("RunService").RenderStepped:Connect(function() target = GetClosestPlayer() end) local mouse = game.Players.LocalPlayer:GetMouse() local old old = hookmetamethod(game, "__index", function(self, property) if self == mouse and not checkcaller() then if property == "Target" or property == "target" then if target then return target end end if property == "Hit" or property == "hit" then if target then return target.CFrame end end end return old(self, property) end)