Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- // i know the table is messy you can fix that on ur own time
- getgenv().dnss = { -- // auto closest point
- test = {
- Enabled = true,
- ToggleKey = "C",
- Prediction = 0.133,
- AutoPrediction = true,
- AntiGroundShots = false,
- TakeOff = 3 -- // dont got to high (remember ground shots are caused by pred)
- }
- }
- --[[ info
- ----
- it will unlock if the player is out of view and if the same
- player comes back in view it will lock back on
- ----
- EaseStyle,Direction are handmade not using roblox's so might feel a bit diff
- ----
- auto unlock if the player is knocked or grabbed
- ----
- auto resolver
- ]]
- Trace = {
- Key = "Q",
- Enabled = true,
- AimPart = "HumanoidRootPart",
- Prediction = 0.13,
- Smoothness = 0.0064,
- EaseStyle = true,
- EaseStyleType = "Exponential", -- might feel diff cus i remade the easestyle same goes for direction
- Shake = false,
- shakeIntensity = {SX = 11, SY = 27, SZ = 10}, -- Shake X, Shake Y, Shake Z
- UseDirection = false,
- Direction = "InOut"
- }
- Checks = {
- KOCheck = true,
- GrabbedCheck = true,
- CrewCheck = false
- }
- FOV = {
- Enabled = true,
- Size = 50,
- Color = Color3.fromRGB(255, 255, 255)
- }
- -- // cache
- local Circle = Drawing.new("Circle")
- local rPoint
- local UserInputService = game:GetService("UserInputService")
- local RunService = game:GetService("RunService")
- local Players = game:GetService("Players")
- local localPlayer = Players.LocalPlayer
- local character = localPlayer.Character or localPlayer.CharacterAdded:Wait()
- local cam = workspace.CurrentCamera
- local camLock = false
- local targetPlayer = nil
- local cameraSpeed = Trace.Smoothness
- local predictionFactor = Trace.Prediction
- local mouse = localPlayer:GetMouse()
- Circle.Transparency = 1
- Circle.Radius = FOV.Size * 3
- Circle.Visible = FOV.Enabled
- Circle.Color = FOV.Color
- Circle.Thickness = 1
- local smoothingFactor, positionData, currentIndex = 30, {}, 1
- local function calculateVelocityAverage(positionData)
- local totalVelocity = 0
- local avgPosition = Vector3.new()
- local avgTime = 0
- local len = # positionData
- if len == 0 then
- return avgPosition, avgTime
- end
- for i = 1, len do
- local data = positionData[i]
- if data and data.pos then
- local velocity = smoothingFactor - i + 1
- avgPosition += data.pos * velocity
- avgTime += data.time * velocity
- totalVelocity += velocity
- end
- end
- avgPosition = avgPosition / totalVelocity
- avgTime = avgTime / totalVelocity
- return avgPosition, avgTime
- end
- local function smoothVelocity(character)
- local currentPos = character.HumanoidRootPart.Position
- local currentTick = tick()
- positionData[currentIndex] = {
- pos = currentPos,
- time = currentTick
- }
- currentIndex = (currentIndex % smoothingFactor) + 1
- local avgPosition, avgTime = calculateVelocityAverage(positionData)
- local prevData = positionData[currentIndex]
- if prevData and prevData.pos then
- local Velocity = (currentPos - prevData.pos) / (currentTick - prevData.time)
- return Velocity
- end
- end
- -- // auto pred (based off your normal pred)
- local function getPingBasedPrediction()
- if dnss.test.AutoPrediction then
- local ping = game:GetService("Stats").Network.ServerStatsItem["Data Ping"]:GetValue()
- local calculatedPrediction = (((ping - 0) / 200) * (0.2 - 0.1)) + 0.1
- return dnss.test.Prediction + calculatedPrediction
- else
- return dnss.test.Prediction
- end
- end
- -- // Mem spoofer
- pcall(function()
- local spoofer, updating = false
- for i, v in pairs(game:GetService("CoreGui").RobloxGui.PerformanceStats:GetChildren()) do
- v.Name = i
- end
- game:GetService("CoreGui").RobloxGui.PerformanceStats["1"].StatsMiniTextPanelClass.ValueLabel:GetPropertyChangedSignal("Text"):Connect(function()
- if not updating then
- updating = true
- spoofer = math.random(800, 900) .. "." .. math.random(10, 99) .. "MB" -- // you can make a toggle if you want
- game:GetService("CoreGui").RobloxGui.PerformanceStats["1"].StatsMiniTextPanelClass.ValueLabel.Text = spoofer
- updating = false
- end
- end)
- end)
- function wallCheck(position, ignoreList)
- return not workspace:FindPartOnRayWithIgnoreList(Ray.new(workspace.CurrentCamera.CFrame.p, position - workspace.CurrentCamera.CFrame.p), ignoreList)
- end
- function KnockedCheck(_)
- if _.Character.BodyEffects["K.O"] and Checks.KOCheck then
- return _.Character.BodyEffects["K.O"].Value ~= true
- end
- end
- function isSameCrew(Player1, Player2)
- 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
- local Player1Crew = Player1.DataFolder.Information.Crew.Value
- local Player2Crew = Player2.DataFolder.Information.Crew.Value
- if Player1Crew ~= nil and Player2Crew ~= nil and Player1Crew ~= "" and Player2Crew ~= "" then
- return Player1Crew == Player2Crew
- end
- end
- return false
- end
- function GrabbedCheck(_)
- if Checks.GrabbedCheck then
- return not _.Character:FindFirstChild("GRABBING_CONSTRAINT")
- end
- end
- local userInputService = game:GetService("UserInputService")
- userInputService.InputBegan:Connect(function(input, gameProcessedEvent)
- if input.KeyCode.Name == dnss.test.ToggleKey and not gameProcessedEvent then
- dnss.test.Enabled = not dnss.test.Enabled
- end
- end)
- function getClosestPart(Target)
- if Target and Target:GetChildren() then
- local closestpart, closdist = nil, math.huge
- for _, child in ipairs(Target:GetChildren()) do
- if child:IsA("BasePart") then
- local ting = child
- local them, vis = workspace.CurrentCamera:WorldToScreenPoint(ting.Position)
- local mousepos = game.Players.LocalPlayer:GetMouse()
- local magnitude = (Vector2.new(them.X, them.Y) - Vector2.new(mousepos.X, mousepos.Y)).magnitude
- if vis and Circle.Radius > magnitude and magnitude < closdist then
- closestpart, closdist = ting, magnitude
- end
- end
- end
- return closestpart
- end
- end
- -- // Closest point
- local prevClosestPtOnPart, prevClosestPtOffPart, prevClampedPos
- function cls(target)
- local selPart = getClosestPart(target)
- if not selPart or not target then
- return nil, nil
- end
- local mouse = game.Players.LocalPlayer:GetMouse()
- local mousePos, mouseTarget = mouse.hit.p, mouse.Target
- local dirToPart = (selPart.Position - mousePos).unit
- local halfSize = selPart.Size / 2
- local ptOnPart = selPart.Position - dirToPart * halfSize
- local ptOffPart = mousePos
- if mouseTarget and mouseTarget:IsDescendantOf(target) then
- ptOnPart, ptOffPart = mousePos, ptOnPart + dirToPart * (halfSize * 2)
- end
- local newPos = Vector3.new(
- 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))
- prevClosestPtOnPart, prevClosestPtOffPart = ptOnPart, ptOffPart
- prevClampedPos = newPos
- return newPos, ptOffPart
- end
- function getClosestPlayer()
- local closestPlayer, closestDistance = nil, math.huge
- local Mouse = game.Players.LocalPlayer:GetMouse()
- local mousePos = Mouse.hit.p
- local localPlayer = game.Players.LocalPlayer
- for _, player in ipairs(game:GetService("Players"):GetPlayers()) do
- if player ~= localPlayer and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
- local distance = (player.Character.HumanoidRootPart.Position - mousePos).magnitude
- if not closestDistance or distance < closestDistance then
- local vis = workspace.CurrentCamera:WorldToViewportPoint(player.Character.HumanoidRootPart.Position)
- if KnockedCheck(player) and GrabbedCheck(player) and vis and wallCheck(player.Character.UpperTorso.Position, {
- localPlayer,
- player.Character
- }) and not isSameCrew(localPlayer, player) then
- closestPlayer = player
- closestDistance = distance
- end
- end
- end
- end
- return closestPlayer
- end
- if self ~= nil and dnss.test.AntiGroundShots and self.Character.Humanoid.FloorMaterial == Enum.Material.Air then
- game.RunService.Stepped:Connect(function()
- local currentvelocity = self.Character.HumanoidRootPart.Velocity
- self.Character.HumanoidRootPart.Velocity = Vector3.new(currentvelocity.X, currentvelocity.Y / dnss.test.TakeOff, currentvelocity.Z)
- end)
- end
- function isAnti()
- local calculateVelocityAverage = smoothVelocity(self.Character)
- return self.Character.HumanoidRootPart.Velocity.Magnitude > 50 and calculateVelocityAverage * dnss.test.Prediction or self.Character.HumanoidRootPart.Velocity * dnss.test.Prediction
- end
- function isAnti2()
- local calculateVelocityAverage = smoothVelocity(self.Character)
- return self.Character.HumanoidRootPart.Velocity.Magnitude > 50 and calculateVelocityAverage * Trace.Prediction or self.Character.HumanoidRootPart.Velocity * Trace.Prediction
- end
- game.RunService.Heartbeat:Connect(function()
- local pos = game:GetService("UserInputService"):GetMouseLocation()
- Circle.Position = Vector2.new(pos.X, pos.Y)
- if dnss.test.Enabled and self then
- rPoint = cls(self.Character)
- getgenv().Result = getClosestPart(self.Character)
- end
- if dnss.test.Enabled then
- self = getClosestPlayer()
- end
- end)
- local function isPlayerVisible(player)
- local ray = Ray.new(cam.CFrame.p, (player.Character.HumanoidRootPart.Position - cam.CFrame.p).unit * (player.Character.HumanoidRootPart.Position - cam.CFrame.p).magnitude)
- local ignoreList = {localPlayer.Character,player.Character}
- return workspace:FindPartOnRayWithIgnoreList(ray, ignoreList) == nil
- end
- local function isPlayerOnScreen(player)
- local playerCharacter = player.Character
- if not playerCharacter or not playerCharacter:FindFirstChild("HumanoidRootPart") then
- return false
- end
- return cam:WorldToViewportPoint(playerCharacter.HumanoidRootPart.Position)
- end
- local function isTargetValid(target)
- if not target or not target.Character or not target.Character:FindFirstChild("Humanoid") then
- return false
- end
- local humanoid = target.Character.Humanoid
- if humanoid.Health <= 0 then
- return false
- end
- local kocheck = target.Character.BodyEffects:FindFirstChild("K.O") and target.Character.BodyEffects["K.O"].Value
- local grabbed = target.Character:FindFirstChild("GRABBING_CONSTRAINT") ~= nil
- if kocheck or grabbed then
- return false
- end
- return true
- end
- local function getClosestPlayercam()
- local closestPlayer, closestDistance = nil, Circle.Radius -- // got lazy
- for _, player in ipairs(game:GetService("Players"):GetPlayers()) do
- if player ~= localPlayer and isPlayerOnScreen(player) and isPlayerVisible(player) then
- local playerCharacter = player.Character
- if playerCharacter and playerCharacter:FindFirstChild("HumanoidRootPart") then
- local distance = (playerCharacter.HumanoidRootPart.Position - localPlayer.Character.HumanoidRootPart.Position).magnitude
- if distance < closestDistance then
- closestPlayer, closestDistance = player, distance
- end
- end
- end
- end
- return closestPlayer
- end
- local function toggleCamLock()
- camLock = not camLock
- if camLock then
- targetPlayer = getClosestPlayercam()
- end
- end
- local function onInputBegan(input, gameProcessedEvent)
- if gameProcessedEvent then
- return
- end
- if input.KeyCode.Name == Trace.Key then
- toggleCamLock()
- end
- end
- -- // cache
- EaseStyle = Trace.EaseStyle
- EaseStyleType = Trace.EaseStyleType
- shake = Trace.Shake
- shakeIntensity = Trace.shakeIntensity
- UseDirection = Trace.UseDirection
- Direction = Trace.Direction
- local function getEaseStyleValue(progress)
- if not EaseStyle then
- return progress
- end
- local easeValue
- if EaseStyleType == "Linear" then
- easeValue = progress
- elseif EaseStyleType == "Sine" then
- easeValue = 1 - math.cos((progress * math.pi) / 2)
- elseif EaseStyleType == "Back" then
- local overshoot = 1.70158
- easeValue = progress * progress * ((overshoot + 1) * progress - overshoot)
- elseif EaseStyleType == "Quad" then
- easeValue = progress * progress
- elseif EaseStyleType == "Quart" then
- easeValue = progress * progress * progress * progress
- elseif EaseStyleType == "Quint" then
- easeValue = progress * progress * progress * progress * progress
- elseif EaseStyleType == "Bounce" then
- local function bounce(t)
- if t < 1 / 2.75 then
- return 7.5625 * t * t
- elseif t < 2 / 2.75 then
- t = t - 1.5 / 2.75
- return 7.5625 * t * t + 0.75 -- // im a fucking math nerd but i have f's in school
- elseif t < 2.5 / 2.75 then
- t = t - 2.25 / 2.75
- return 7.5625 * t * t + 0.9375
- else
- t = t - 2.625 / 2.75
- return 7.5625 * t * t + 0.984375
- end
- end
- easeValue = 1 - bounce(1 - progress)
- elseif EaseStyleType == "Elastic" then
- local period = 0.3
- local s = period / (2 * math.pi) * math.asin(1)
- easeValue = -(2 ^ (-10 * progress) * math.sin((progress - s) * (2 * math.pi) / period))
- elseif EaseStyleType == "Exponential" then
- easeValue = 1 - math.exp(-5 * progress)
- elseif EaseStyleType == "Circular" then
- easeValue = 1 - math.sqrt(1 - progress * progress)
- elseif EaseStyleType == "Cubic" then
- easeValue = progress * progress * progress
- end -- // fuck you roblox i remade your shit in 10 mins
- if UseDirection then
- if Direction == "In" then
- -- // its default is in
- elseif Direction == "Out" then
- easeValue = 1 - easeValue
- elseif Direction == "InOut" then
- if progress < 0.5 then
- easeValue = easeValue / 2
- else
- easeValue = 1 - (1 - easeValue) / 2
- end
- end
- end
- return easeValue
- end
- local function applyShake(cFrame)
- if shake then
- local x = math.random(-shakeIntensity.SX, shakeIntensity.SX) / 300 -- // random number change it to whatever
- local y = math.random(-shakeIntensity.SY, shakeIntensity.SY) / 300
- local z = math.random(-shakeIntensity.SZ, shakeIntensity.SZ) / 300
- return cFrame * CFrame.new(x, y, z)
- else
- return cFrame
- end
- end
- local function onRenderStep()
- if not camLock then
- return
- end
- if not targetPlayer or (targetPlayer and not targetPlayer.Character) or not targetPlayer.Character:FindFirstChild(Trace.AimPart) then
- return
- end
- if Trace.Enabled then
- if not isTargetValid(targetPlayer) then
- targetPlayer = nil
- return
- end
- local targetPosition = targetPlayer.Character.HumanoidRootPart.Position
- local targetVelocity = isAnti2()
- local predictedPosition = targetPosition + targetVelocity
- local targetCFrame = CFrame.new(cam.CFrame.p, predictedPosition)
- local newPosition = cam.CFrame.p:Lerp(targetCFrame.p, getEaseStyleValue(cameraSpeed))
- local newLookVector = cam.CFrame.LookVector:Lerp(targetCFrame.LookVector, getEaseStyleValue(cameraSpeed))
- local newCFrame = CFrame.lookAt(newPosition, newPosition + newLookVector)
- local controlPoint = (cam.CFrame.p + targetCFrame.p) * 0.5
- newPosition = (1 - getEaseStyleValue(cameraSpeed)) * ((1 - getEaseStyleValue(cameraSpeed)) * cam.CFrame.p + getEaseStyleValue(cameraSpeed) * controlPoint) + getEaseStyleValue(cameraSpeed) * ((1 - getEaseStyleValue(cameraSpeed)) * controlPoint + getEaseStyleValue(cameraSpeed) * targetCFrame.p)
- cam.CFrame = applyShake(CFrame.lookAt(newPosition, newPosition + newLookVector))
- end
- end
- UserInputService.InputBegan:Connect(onInputBegan)
- RunService.RenderStepped:Connect(onRenderStep)
- local __index
- __index = hookmetamethod(game, "__index", function(t, k)
- if t:IsA("Mouse") and k == "Hit" or k == "Target" then
- if self ~= nil and Result ~= nil and rPoint then
- local Hit = CFrame.new(rPoint) + isAnti()
- return (k == "Hit" and Hit)
- end
- end
- return __index(t, k)
- end)
Add Comment
Please, Sign In to add comment