vtrvsted

DNS LEAK

Apr 18th, 2023
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.09 KB | None | 0 0
  1. -- // i know the table is messy you can fix that on ur own time
  2. getgenv().dnss = { -- // auto closest point
  3.     test = {
  4.         Enabled = true,
  5.         ToggleKey = "C",
  6.         Prediction = 0.133,
  7.         AutoPrediction = true,
  8.         AntiGroundShots = false,
  9.         TakeOff = 3 -- // dont got to high (remember ground shots are caused by pred)
  10.     }
  11. }
  12.  
  13. --[[ info
  14. ----
  15. it will unlock if the player is out of view and if the same
  16. player comes back in view it will lock back on
  17. ----
  18. EaseStyle,Direction are handmade not using roblox's so might feel a bit diff
  19. ----
  20. auto unlock if the player is knocked or grabbed
  21. ----
  22. auto resolver
  23. ]]
  24. Trace = {
  25.     Key = "Q",
  26.     Enabled = true,
  27.     AimPart = "HumanoidRootPart",
  28.     Prediction = 0.13,
  29.     Smoothness = 0.0064,
  30.     EaseStyle = true,
  31.     EaseStyleType = "Exponential", -- might feel diff cus i remade the easestyle same goes for direction
  32.     Shake = false,
  33.     shakeIntensity = {SX = 11, SY = 27, SZ = 10}, -- Shake X, Shake Y,  Shake Z
  34.     UseDirection = false,  
  35.     Direction = "InOut"
  36. }
  37. Checks = {
  38.     KOCheck = true,
  39.     GrabbedCheck = true,
  40.     CrewCheck = false
  41. }
  42. FOV = {
  43.     Enabled = true,
  44.     Size = 50,
  45.     Color = Color3.fromRGB(255, 255, 255)
  46. }
  47.  
  48. -- // cache
  49. local Circle = Drawing.new("Circle")
  50. local rPoint
  51. local UserInputService = game:GetService("UserInputService")
  52. local RunService = game:GetService("RunService")
  53. local Players = game:GetService("Players")
  54. local localPlayer = Players.LocalPlayer
  55. local character = localPlayer.Character or localPlayer.CharacterAdded:Wait()
  56. local cam = workspace.CurrentCamera
  57. local camLock = false
  58. local targetPlayer = nil
  59. local cameraSpeed = Trace.Smoothness
  60. local predictionFactor = Trace.Prediction
  61. local mouse = localPlayer:GetMouse()
  62.  
  63. Circle.Transparency = 1
  64. Circle.Radius = FOV.Size * 3
  65. Circle.Visible = FOV.Enabled
  66. Circle.Color = FOV.Color
  67. Circle.Thickness = 1
  68.  
  69. local smoothingFactor, positionData, currentIndex = 30, {}, 1
  70. local function calculateVelocityAverage(positionData)
  71.     local totalVelocity = 0
  72.     local avgPosition = Vector3.new()
  73.     local avgTime = 0
  74.     local len = # positionData
  75.     if len == 0 then
  76.         return avgPosition, avgTime
  77.     end
  78.     for i = 1, len do
  79.         local data = positionData[i]
  80.         if data and data.pos then
  81.             local velocity = smoothingFactor - i + 1
  82.             avgPosition += data.pos * velocity
  83.             avgTime += data.time * velocity
  84.             totalVelocity += velocity
  85.         end
  86.     end
  87.     avgPosition = avgPosition / totalVelocity
  88.     avgTime = avgTime / totalVelocity
  89.     return avgPosition, avgTime
  90. end
  91. local function smoothVelocity(character)
  92.     local currentPos = character.HumanoidRootPart.Position
  93.     local currentTick = tick()
  94.     positionData[currentIndex] = {
  95.         pos = currentPos,
  96.         time = currentTick
  97.     }
  98.     currentIndex = (currentIndex % smoothingFactor) + 1
  99.     local avgPosition, avgTime = calculateVelocityAverage(positionData)
  100.     local prevData = positionData[currentIndex]
  101.     if prevData and prevData.pos then
  102.         local Velocity = (currentPos - prevData.pos) / (currentTick - prevData.time)
  103.         return Velocity
  104.     end
  105. end
  106.  
  107. -- // auto pred (based off your normal pred)
  108. local function getPingBasedPrediction()
  109.     if dnss.test.AutoPrediction then
  110.         local ping = game:GetService("Stats").Network.ServerStatsItem["Data Ping"]:GetValue()
  111.         local calculatedPrediction = (((ping - 0) / 200) * (0.2 - 0.1)) + 0.1
  112.         return dnss.test.Prediction + calculatedPrediction
  113.     else
  114.         return dnss.test.Prediction
  115.     end
  116. end
  117.  
  118. -- // Mem spoofer
  119. pcall(function()
  120.     local spoofer, updating = false
  121.     for i, v in pairs(game:GetService("CoreGui").RobloxGui.PerformanceStats:GetChildren()) do
  122.         v.Name = i
  123.     end
  124.     game:GetService("CoreGui").RobloxGui.PerformanceStats["1"].StatsMiniTextPanelClass.ValueLabel:GetPropertyChangedSignal("Text"):Connect(function()
  125.         if not updating then
  126.             updating = true
  127.             spoofer = math.random(800, 900) .. "." .. math.random(10, 99) .. "MB" -- // you can make a toggle if you want
  128.             game:GetService("CoreGui").RobloxGui.PerformanceStats["1"].StatsMiniTextPanelClass.ValueLabel.Text = spoofer
  129.             updating = false
  130.         end
  131.     end)
  132. end)
  133.  
  134. function wallCheck(position, ignoreList)
  135.     return not workspace:FindPartOnRayWithIgnoreList(Ray.new(workspace.CurrentCamera.CFrame.p, position - workspace.CurrentCamera.CFrame.p), ignoreList)
  136. end
  137.  
  138. function KnockedCheck(_)
  139.     if _.Character.BodyEffects["K.O"] and Checks.KOCheck then
  140.         return _.Character.BodyEffects["K.O"].Value ~= true
  141.     end
  142. end
  143.  
  144. function isSameCrew(Player1, Player2)
  145.     if Checks.CrewCheck and Player1:FindFirstChild("DataFolder") and Player1.DataFolder:FindFirstChild("Information") and Player1.DataFolder.Information:FindFirstChild("Crew") and Player2:FindFirstChild("DataFolder") and Player2.DataFolder:FindFirstChild("Information") and Player2.DataFolder.Information:FindFirstChild("Crew") then
  146.         local Player1Crew = Player1.DataFolder.Information.Crew.Value
  147.         local Player2Crew = Player2.DataFolder.Information.Crew.Value
  148.         if Player1Crew ~= nil and Player2Crew ~= nil and Player1Crew ~= "" and Player2Crew ~= "" then
  149.             return Player1Crew == Player2Crew
  150.         end
  151.     end
  152.     return false
  153. end
  154.  
  155. function GrabbedCheck(_)
  156.     if Checks.GrabbedCheck then
  157.         return not _.Character:FindFirstChild("GRABBING_CONSTRAINT")
  158.     end
  159. end
  160.  
  161. local userInputService = game:GetService("UserInputService")
  162. userInputService.InputBegan:Connect(function(input, gameProcessedEvent)
  163.     if input.KeyCode.Name == dnss.test.ToggleKey and not gameProcessedEvent then
  164.         dnss.test.Enabled = not dnss.test.Enabled
  165.     end
  166. end)
  167.  
  168. function getClosestPart(Target)
  169.     if Target and Target:GetChildren() then
  170.         local closestpart, closdist = nil, math.huge
  171.         for _, child in ipairs(Target:GetChildren()) do
  172.             if child:IsA("BasePart") then
  173.                 local ting = child
  174.                 local them, vis = workspace.CurrentCamera:WorldToScreenPoint(ting.Position)
  175.                 local mousepos = game.Players.LocalPlayer:GetMouse()
  176.                 local magnitude = (Vector2.new(them.X, them.Y) - Vector2.new(mousepos.X, mousepos.Y)).magnitude
  177.                 if vis and Circle.Radius > magnitude and magnitude < closdist then
  178.                     closestpart, closdist = ting, magnitude
  179.                 end
  180.             end
  181.         end
  182.         return closestpart
  183.     end
  184. end
  185.  
  186. -- // Closest point
  187. local prevClosestPtOnPart, prevClosestPtOffPart, prevClampedPos
  188. function cls(target)
  189.     local selPart = getClosestPart(target)
  190.     if not selPart or not target then
  191.         return nil, nil
  192.     end
  193.     local mouse = game.Players.LocalPlayer:GetMouse()
  194.     local mousePos, mouseTarget = mouse.hit.p, mouse.Target
  195.     local dirToPart = (selPart.Position - mousePos).unit
  196.     local halfSize = selPart.Size / 2
  197.     local ptOnPart = selPart.Position - dirToPart * halfSize
  198.     local ptOffPart = mousePos
  199.     if mouseTarget and mouseTarget:IsDescendantOf(target) then
  200.         ptOnPart, ptOffPart = mousePos, ptOnPart + dirToPart * (halfSize * 2)
  201.     end
  202.     local newPos = Vector3.new(
  203.     math.clamp(ptOnPart.X, selPart.Position.X - halfSize.X, selPart.Position.X + halfSize.X), math.clamp(ptOnPart.Y, selPart.Position.Y - halfSize.Y, selPart.Position.Y + halfSize.Y), math.clamp(ptOnPart.Z, selPart.Position.Z - halfSize.Z, selPart.Position.Z + halfSize.Z))
  204.     prevClosestPtOnPart, prevClosestPtOffPart = ptOnPart, ptOffPart
  205.     prevClampedPos = newPos
  206.     return newPos, ptOffPart
  207. end
  208.  
  209. function getClosestPlayer()
  210.     local closestPlayer, closestDistance = nil, math.huge
  211.     local Mouse = game.Players.LocalPlayer:GetMouse()
  212.     local mousePos = Mouse.hit.p
  213.     local localPlayer = game.Players.LocalPlayer
  214.     for _, player in ipairs(game:GetService("Players"):GetPlayers()) do
  215.         if player ~= localPlayer and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
  216.             local distance = (player.Character.HumanoidRootPart.Position - mousePos).magnitude
  217.             if not closestDistance or distance < closestDistance then
  218.                 local vis = workspace.CurrentCamera:WorldToViewportPoint(player.Character.HumanoidRootPart.Position)
  219.                 if KnockedCheck(player) and GrabbedCheck(player) and vis and wallCheck(player.Character.UpperTorso.Position, {
  220.                     localPlayer,
  221.                     player.Character
  222.                 }) and not isSameCrew(localPlayer, player) then
  223.                     closestPlayer = player
  224.                     closestDistance = distance
  225.                 end
  226.             end
  227.         end
  228.     end
  229.     return closestPlayer
  230. end
  231.  
  232. if self ~= nil and dnss.test.AntiGroundShots and self.Character.Humanoid.FloorMaterial == Enum.Material.Air then
  233.     game.RunService.Stepped:Connect(function()
  234.         local currentvelocity = self.Character.HumanoidRootPart.Velocity
  235.         self.Character.HumanoidRootPart.Velocity = Vector3.new(currentvelocity.X, currentvelocity.Y / dnss.test.TakeOff, currentvelocity.Z)
  236.     end)
  237. end
  238.  
  239. function isAnti()
  240.     local calculateVelocityAverage = smoothVelocity(self.Character)
  241.     return self.Character.HumanoidRootPart.Velocity.Magnitude > 50 and calculateVelocityAverage * dnss.test.Prediction or self.Character.HumanoidRootPart.Velocity * dnss.test.Prediction
  242. end
  243.  
  244. function isAnti2()
  245.     local calculateVelocityAverage = smoothVelocity(self.Character)
  246.     return self.Character.HumanoidRootPart.Velocity.Magnitude > 50 and calculateVelocityAverage * Trace.Prediction or self.Character.HumanoidRootPart.Velocity * Trace.Prediction
  247. end
  248.  
  249. game.RunService.Heartbeat:Connect(function()
  250.     local pos = game:GetService("UserInputService"):GetMouseLocation()
  251.     Circle.Position = Vector2.new(pos.X, pos.Y)
  252.     if dnss.test.Enabled and self then
  253.         rPoint = cls(self.Character)
  254.         getgenv().Result = getClosestPart(self.Character)
  255.     end
  256.     if dnss.test.Enabled then
  257.         self = getClosestPlayer()
  258.     end
  259. end)
  260.  
  261. local function isPlayerVisible(player)
  262.     local ray = Ray.new(cam.CFrame.p, (player.Character.HumanoidRootPart.Position - cam.CFrame.p).unit * (player.Character.HumanoidRootPart.Position - cam.CFrame.p).magnitude)
  263.     local ignoreList = {localPlayer.Character,player.Character}
  264.     return workspace:FindPartOnRayWithIgnoreList(ray, ignoreList) == nil
  265. end
  266.  
  267. local function isPlayerOnScreen(player)
  268.     local playerCharacter = player.Character
  269.     if not playerCharacter or not playerCharacter:FindFirstChild("HumanoidRootPart") then
  270.         return false
  271.     end
  272.     return cam:WorldToViewportPoint(playerCharacter.HumanoidRootPart.Position)
  273. end
  274.  
  275. local function isTargetValid(target)
  276.     if not target or not target.Character or not target.Character:FindFirstChild("Humanoid") then
  277.         return false
  278.     end
  279.     local humanoid = target.Character.Humanoid
  280.     if humanoid.Health <= 0 then
  281.         return false
  282.     end
  283.     local kocheck = target.Character.BodyEffects:FindFirstChild("K.O") and target.Character.BodyEffects["K.O"].Value
  284.     local grabbed = target.Character:FindFirstChild("GRABBING_CONSTRAINT") ~= nil
  285.     if kocheck or grabbed then
  286.         return false
  287.     end
  288.     return true
  289. end
  290.  
  291. local function getClosestPlayercam()
  292.     local closestPlayer, closestDistance = nil, Circle.Radius  -- // got lazy
  293.     for _, player in ipairs(game:GetService("Players"):GetPlayers()) do
  294.         if player ~= localPlayer and isPlayerOnScreen(player) and isPlayerVisible(player) then
  295.             local playerCharacter = player.Character
  296.             if playerCharacter and playerCharacter:FindFirstChild("HumanoidRootPart") then
  297.                 local distance = (playerCharacter.HumanoidRootPart.Position - localPlayer.Character.HumanoidRootPart.Position).magnitude
  298.                 if distance < closestDistance then
  299.                     closestPlayer, closestDistance = player, distance
  300.                 end
  301.             end
  302.         end
  303.     end
  304.     return closestPlayer
  305. end
  306.  
  307. local function toggleCamLock()
  308.     camLock = not camLock
  309.     if camLock then
  310.         targetPlayer = getClosestPlayercam()
  311.     end
  312. end
  313.        
  314. local function onInputBegan(input, gameProcessedEvent)
  315.     if gameProcessedEvent then
  316.         return
  317.     end
  318.     if input.KeyCode.Name == Trace.Key then
  319.         toggleCamLock()
  320.     end
  321. end
  322.  
  323. -- // cache
  324. EaseStyle = Trace.EaseStyle
  325. EaseStyleType = Trace.EaseStyleType
  326. shake = Trace.Shake
  327. shakeIntensity = Trace.shakeIntensity
  328. UseDirection = Trace.UseDirection
  329. Direction = Trace.Direction
  330.  
  331. local function getEaseStyleValue(progress)
  332.     if not EaseStyle then
  333.         return progress
  334.     end
  335.     local easeValue
  336.     if EaseStyleType == "Linear" then
  337.         easeValue = progress
  338.     elseif EaseStyleType == "Sine" then
  339.         easeValue = 1 - math.cos((progress * math.pi) / 2)
  340.     elseif EaseStyleType == "Back" then
  341.         local overshoot = 1.70158
  342.         easeValue = progress * progress * ((overshoot + 1) * progress - overshoot)
  343.     elseif EaseStyleType == "Quad" then
  344.         easeValue = progress * progress
  345.     elseif EaseStyleType == "Quart" then
  346.         easeValue = progress * progress * progress * progress
  347.     elseif EaseStyleType == "Quint" then
  348.         easeValue = progress * progress * progress * progress * progress
  349.     elseif EaseStyleType == "Bounce" then
  350.         local function bounce(t)
  351.             if t < 1 / 2.75 then
  352.                 return 7.5625 * t * t
  353.             elseif t < 2 / 2.75 then
  354.                 t = t - 1.5 / 2.75
  355.                 return 7.5625 * t * t + 0.75 -- // im a fucking math nerd but i have f's in school
  356.             elseif t < 2.5 / 2.75 then
  357.                 t = t - 2.25 / 2.75
  358.                 return 7.5625 * t * t + 0.9375
  359.             else
  360.                 t = t - 2.625 / 2.75
  361.                 return 7.5625 * t * t + 0.984375
  362.             end
  363.         end
  364.         easeValue = 1 - bounce(1 - progress)
  365.     elseif EaseStyleType == "Elastic" then
  366.         local period = 0.3
  367.         local s = period / (2 * math.pi) * math.asin(1)
  368.         easeValue = -(2 ^ (-10 * progress) * math.sin((progress - s) * (2 * math.pi) / period))
  369.     elseif EaseStyleType == "Exponential" then
  370.         easeValue = 1 - math.exp(-5 * progress)
  371.     elseif EaseStyleType == "Circular" then
  372.         easeValue = 1 - math.sqrt(1 - progress * progress)
  373.     elseif EaseStyleType == "Cubic" then
  374.         easeValue = progress * progress * progress
  375.     end -- // fuck you roblox i remade your shit in 10 mins
  376.     if UseDirection then
  377.         if Direction == "In" then
  378.             -- // its default is in
  379.         elseif Direction == "Out" then
  380.             easeValue = 1 - easeValue
  381.         elseif Direction == "InOut" then
  382.             if progress < 0.5 then
  383.                 easeValue = easeValue / 2
  384.             else
  385.                 easeValue = 1 - (1 - easeValue) / 2
  386.             end
  387.         end
  388.     end
  389.     return easeValue
  390. end
  391.  
  392. local function applyShake(cFrame)
  393.     if shake then
  394.         local x = math.random(-shakeIntensity.SX, shakeIntensity.SX) / 300 -- // random number change it to whatever
  395.         local y = math.random(-shakeIntensity.SY, shakeIntensity.SY) / 300
  396.         local z = math.random(-shakeIntensity.SZ, shakeIntensity.SZ) / 300
  397.         return cFrame * CFrame.new(x, y, z)
  398.     else
  399.         return cFrame
  400.     end
  401. end
  402.  
  403. local function onRenderStep()
  404.     if not camLock then
  405.         return
  406.     end
  407.     if not targetPlayer or (targetPlayer and not targetPlayer.Character) or not targetPlayer.Character:FindFirstChild(Trace.AimPart) then
  408.         return
  409.     end
  410.     if Trace.Enabled then
  411.         if not isTargetValid(targetPlayer) then
  412.             targetPlayer = nil
  413.             return
  414.         end
  415.         local targetPosition = targetPlayer.Character.HumanoidRootPart.Position
  416.         local targetVelocity = isAnti2()
  417.         local predictedPosition = targetPosition + targetVelocity
  418.         local targetCFrame = CFrame.new(cam.CFrame.p, predictedPosition)
  419.         local newPosition = cam.CFrame.p:Lerp(targetCFrame.p, getEaseStyleValue(cameraSpeed))
  420.         local newLookVector = cam.CFrame.LookVector:Lerp(targetCFrame.LookVector, getEaseStyleValue(cameraSpeed))
  421.         local newCFrame = CFrame.lookAt(newPosition, newPosition + newLookVector)
  422.         local controlPoint = (cam.CFrame.p + targetCFrame.p) * 0.5
  423.         newPosition = (1 - getEaseStyleValue(cameraSpeed)) * ((1 - getEaseStyleValue(cameraSpeed)) * cam.CFrame.p + getEaseStyleValue(cameraSpeed) * controlPoint) + getEaseStyleValue(cameraSpeed) * ((1 - getEaseStyleValue(cameraSpeed)) * controlPoint + getEaseStyleValue(cameraSpeed) * targetCFrame.p)
  424.         cam.CFrame = applyShake(CFrame.lookAt(newPosition, newPosition + newLookVector))
  425.     end
  426. end
  427.  
  428. UserInputService.InputBegan:Connect(onInputBegan)
  429. RunService.RenderStepped:Connect(onRenderStep)
  430.  
  431.  
  432. local __index
  433. __index = hookmetamethod(game, "__index", function(t, k)
  434.     if t:IsA("Mouse") and k == "Hit" or k == "Target" then
  435.         if self ~= nil and Result ~= nil and rPoint then
  436.             local Hit = CFrame.new(rPoint) + isAnti()
  437.             return (k == "Hit" and Hit)
  438.         end
  439.     end
  440.     return __index(t, k)
  441. end)
Add Comment
Please, Sign In to add comment