-- @build-failed -- tp + kill aura local getservice, findfirstchild, waitforchild, getattribute = game.GetService, game.FindFirstChild, game.WaitForChild, game.GetAttribute local players, replicatedstorage, runservice = getservice(game, "Players"), getservice(game, "ReplicatedStorage"), getservice(game, "RunService") local localplayer = players.LocalPlayer local folders = {} folders.Events = waitforchild(replicatedstorage, "Events") local events = {} events.HitEvent = waitforchild(folders.Events, "HitEvent") events.CombatEvent = waitforchild(folders.Events, "CombatEvent") local utils = {} function utils.getClosestTarget() local closestPlayer = nil local closestDistance = math.huge for _, player in players:GetPlayers() do if not player or player == localplayer then continue end local character = player.Character ; if not character then continue end local humanoid = findfirstchild(character, "Humanoid") ; if not humanoid then continue end ; if humanoid.Health <= 0 then continue end local forcefield = findfirstchild(character, "ForceField") ; if forcefield then continue end local blocking = getattribute(character, "Blocking") ; if blocking then continue end local localCharacter = localplayer.Character ; if not localCharacter then continue end local targetRootPart = findfirstchild(character, "HumanoidRootPart") ; if not targetRootPart then continue end local localRootPart = findfirstchild(localCharacter, "HumanoidRootPart") ; if not localRootPart then continue end local targetDistance = (targetRootPart.Position - localRootPart.Position).Magnitude ; if targetDistance >= closestDistance then continue end closestDistance = targetDistance closestPlayer = player end return closestPlayer end function utils.Attack(attackPlayer) if not attackPlayer then return end local target = {} target.player = attackPlayer ; if not target.player then return end target.Character = target.player.Character ; if not target.Character then return end events.CombatEvent:FireServer("Attack") events.HitEvent:FireServer({target.Character}) end ---------- connections ---------- if getgenv().killAuraConn then getgenv().killAuraConn:Disconnect() ; getgenv().killAuraConn = nil end getgenv().killAuraConn = runservice.Heartbeat:Connect(function() local target = utils.getClosestTarget() ; if not target then return end local targetCharacter = target.Character ; if not targetCharacter then return end local targetRootpart = findfirstchild(targetCharacter, "HumanoidRootPart") ; if not targetRootpart then return end local localCharacter = localplayer.Character ; if not localCharacter then return end local localRootPart = findfirstchild(localCharacter, "HumanoidRootPart") ; if not localRootPart then return end localRootPart.CFrame = targetRootpart.CFrame + Vector3.new(0, -8, 0) utils.Attack(target) end)