Okb00mer

Untitled

Mar 26th, 2023
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.69 KB | None | 0 0
  1. local Players, Client, Mouse, RS, Camera, r =
  2. game:GetService("Players"),
  3. game:GetService("Players").LocalPlayer,
  4. game:GetService("Players").LocalPlayer:GetMouse(),
  5. game:GetService("RunService"),
  6. game.Workspace.CurrentCamera,
  7. math.random
  8.  
  9. local Circle = Drawing.new("Circle")
  10. Circle.Color = Color3.new(1,1,1)
  11. Circle.Thickness = 1
  12.  
  13. local UpdateFOV = function ()
  14. if (not Circle) then
  15. return Circle
  16. end
  17.  
  18. if Tonka then
  19. Circle.Visible = Tonka.Fov["Visible"]
  20. Circle.Radius = Tonka.Fov.Radius * 2.9461
  21. else
  22. return Tonka
  23. end
  24.  
  25. Circle.Position = Vector2.new(Mouse.X, Mouse.Y + (game:GetService("GuiService"):GetGuiInset().Y))
  26. return Circle
  27. end
  28.  
  29. RS.Heartbeat:Connect(UpdateFOV)
  30.  
  31. Mouse.KeyDown:Connect(function(TonkaSilentAimEnable)
  32. if TonkaSilentAimEnable.KeyCode ~= Tonka.TonkaSilent.Keybind then
  33. return
  34. elseif TonkaSilentAimEnable.KeyCode == Tonka.TonkaSilent.Keybind then
  35. Tonka.TonkaSilent.Enabled = not Tonka.TonkaSilent.Enabled
  36. end
  37. end)
  38.  
  39.  
  40.  
  41. ClosestPlrFromMouse = function()
  42. local Target, Closest = nil, 1/0
  43.  
  44. for _ ,v in pairs(Players:GetPlayers()) do
  45. if (v.Character and v ~= Client and v.Character:FindFirstChild("HumanoidRootPart")) then
  46. local Position, OnScreen = Camera:WorldToScreenPoint(v.Character.HumanoidRootPart.Position)
  47. local Distance = (Vector2.new(Position.X, Position.Y) - Vector2.new(Mouse.X, Mouse.Y)).Magnitude
  48.  
  49. if (Circle.Radius > Distance and Distance < Closest and OnScreen) then
  50. Closest = Distance
  51. Target = v
  52. end
  53. end
  54. end
  55. return Target
  56. end
  57.  
  58. local WTS = function (Object)
  59. local ObjectVector = Camera:WorldToScreenPoint(Object.Position)
  60. return Vector2.new(ObjectVector.X, ObjectVector.Y)
  61. end
  62.  
  63. local IsOnScreen = function (Object)
  64. local IsOnScreen = Camera:WorldToScreenPoint(Object.Position)
  65. return IsOnScreen
  66. end
  67.  
  68. local FilterObjs = function (Object)
  69. if string.find(Object.Name, "Gun") then
  70. return
  71. end
  72. if table.find({"Part", "MeshPart", "BasePart"}, Object.ClassName) then
  73. return true
  74. end
  75. end
  76.  
  77. local GetClosestBodyPart = function (character)
  78. local ClosestDistance = 1/0
  79. local BodyPart = nil
  80. if (character and character:GetChildren()) then
  81. for _, x in next, character:GetChildren() do
  82. if FilterObjs(x) and IsOnScreen(x) then
  83. local Distance = ((WTS(x) - Vector2.new(Mouse.X, Mouse.Y))/Tonka.TonkaSilent.DistanceDivided).Magnitude
  84. if (Circle.Radius > Distance and Distance < ClosestDistance) then
  85. ClosestDistance = Distance
  86. BodyPart = x
  87. end
  88. end
  89. end
  90. end
  91. return BodyPart
  92. end
  93.  
  94. local Prey
  95. local PartToUse = Tonka.TonkaSilent.Part
  96.  
  97. task.spawn(function ()
  98. while task.wait() do
  99. if Prey then
  100. if Tonka.TonkaSilent.Enabled and Tonka.TonkaSilent.ClosestPart == true then
  101. PartToUse = tostring(GetClosestBodyPart(Prey.Character))
  102. end
  103. if Tonka.TonkaSilent.UnlockOnDeath == true then
  104. if Prey.Character.Humanoid.Health < 2 then
  105. Prey = nil
  106. end
  107. end
  108. if Tonka.TonkaSilent.UnlockOnYourDeath == true then
  109. if Client.Character.Humanoid.Health < 2 then
  110. Prey = nil
  111. end
  112. end
  113. if Tonka.Resolver.Enabled[1] == true then
  114. local playertoresolve = Prey.Character.HumanoidRootPart
  115. if playertoresolve.Velocity.X > Tonka.Resolver.Enabled[2] or playertoresolve.Velocity.X < Tonka.Resolver.Enabled[3] or playertoresolve.Velocity.Y > Tonka.Resolver.Enabled[2] or playertoresolve.Velocity.Y < Tonka.Resolver.Enabled[3] or playertoresolve.Velocity.Z > Tonka.Resolver.Enabled[2] or playertoresolve.Velocity.Z < Tonka.Resolver.Enabled[3] then
  116. playertoresolve.Velocity = Vector3.new(0, 0, 0)
  117. end
  118. end
  119. if Tonka.TonkaSilent.AntiGroundShots then
  120. pcall(function()
  121. local TargetVelv5 = Prey.Character[Tonka.TonkaSilent.Part]
  122. TargetVelv5.Velocity = Vector3.new(TargetVelv5.Velocity.X, (TargetVelv5.Velocity.Y * 0.5), TargetVelv5.Velocity.Z)
  123. TargetVelv5.AssemblyLinearVelocity = Vector3.new(TargetVelv5.Velocity.X, (TargetVelv5.Velocity.Y * 0.5), TargetVelv5.Velocity.Z)
  124. end)
  125. end
  126. if Tonka.Resolver.DisableOnAnti.Enabled == true and Prey.Character and Prey.Character:FindFirstChild(Sub.AIM.AIM_PART) then
  127. local playertoresolve = Prey.Character.HumanoidRootPart
  128. if playertoresolve.Velocity.X > Tonka.Resolver.DisableOnAnti.Max or playertoresolve.Velocity.X < Tonka.Resolver.DisableOnAnti.Min or playertoresolve.Velocity.Y > Tonka.Resolver.DisableOnAnti.Max or playertoresolve.Velocity.Y < Tonka.Resolver.DisableOnAnti.Min or playertoresolve.Velocity.Z > Tonka.Resolver.DisableOnAnti.Max or playertoresolve.Velocity.Z < Tonka.Resolver.DisableOnAnti.Min then
  129. AimlockTarget = nil
  130. end
  131. end
  132. end
  133. end
  134. end)
  135.  
  136. local grmt = getrawmetatable(game)
  137. local backupindex = grmt.__index
  138. setreadonly(grmt, false)
  139.  
  140. grmt.__index = newcclosure(function(self, v)
  141. if (Tonka.TonkaSilent.Enabled and Mouse and tostring(v) == "Hit") then
  142.  
  143. Prey = ClosestPlrFromMouse()
  144.  
  145. if Prey then
  146. local endpoint = game.Players[tostring(Prey)].Character[PartToUse].CFrame + (
  147. game.Players[tostring(Prey)].Character[PartToUse].Velocity * Tonka.TonkaSilent.Pred
  148. )
  149. return (tostring(v) == "Hit" and endpoint)
  150. end
  151. end
  152. return backupindex(self, v)
  153. end)
Add Comment
Please, Sign In to add comment