-- @build-failed -- killaura local config = { killaura = true, spamsound = false } local getservice, findfirstchild, waitforchild = game.GetService, game.FindFirstChild, game.WaitForChild local runservice, players, replicatedstorage = getservice(game, "RunService"), getservice(game, "Players"), getservice(game, "ReplicatedStorage") local localplayer = players.LocalPlayer local folders = {} folders.remoteFunctions, folders.remoteEvents = waitforchild(replicatedstorage, "Functions"), waitforchild(replicatedstorage, "Events") local events = {} events.OnWeaponHit, events.OnWeaponUse = waitforchild(folders.remoteFunctions, "OnWeaponHit"), waitforchild(folders.remoteEvents, "OnWeaponUse") local utils = {} function utils.getClosestTarget() local closestPlayer = nil local closestDistance = math.huge for _, player in players:GetPlayers() do if not player then continue end local character = player.Character ; if not character then continue end if player.Team == localplayer.Team then continue end local forcefield = findfirstchild(character, "ForceField") ; if forcefield 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 -------------------- Main Loop -------------------- if getgenv().killauraConn then getgenv().killauraConn:Disconnect() ; getgenv().killauraConn = nil end getgenv().killauraConn = runservice.Heartbeat:Connect(function() if not (config.killaura or config.spamsound) then return end local target = utils.getClosestTarget() ; if not target then return end --! main code !-- local character = target.Character ; if not character then return end local tool = localplayer.Character:FindFirstChildOfClass("Tool") ; if not tool then return end if config.spamsound then local Handle = tool:WaitForChild("Handle") ; if not Handle then return end local ItemUsedSound = tool:WaitForChild("ItemUsedSound") ; if not ItemUsedSound then return end events.OnWeaponUse:FireServer("PlaySound", ItemUsedSound) end if config.killaura then local humanoid = findfirstchild(character, "Humanoid") ; if not humanoid then return end events.OnWeaponHit:InvokeServer(humanoid, tool) end end)