scripercory1

SlientPF

Mar 20th, 2021
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.48 KB | None | 0 0
  1. local network
  2. local trajectory
  3. local gamelogic
  4. local getbodyparts
  5. local camera
  6. local heartbeat
  7.  
  8. local Settings = {
  9. ["HitPart"] = "Head", --'Head', 'Torso', 'Left Arm', 'Right Arm', 'HumanoidRootPart'
  10. ["Undetectable"] = false --Makes the silent aim worse but does make it undetectable
  11. }
  12.  
  13. for i,v in pairs(getgc(true)) do
  14. if type(v) == "table" and rawget(v, "getbodyparts") then
  15. getbodyparts = v.getbodyparts
  16. end
  17. if type(v) == "function" then
  18. if debug.getinfo(v).name == "trajectory" then
  19. trajectory = v
  20. end
  21. for i2,v2 in pairs(debug.getupvalues(v)) do
  22. if type(v2) == "table" and rawget(v2, "send") then
  23. network = v2;
  24. end
  25. if type(v2) == "table" and rawget(v2, "gammo") then
  26. gamelogic = v2;
  27. end
  28. if type(v2) == "table" and rawget(v2, "basecframe") then
  29. camera = v2
  30. end
  31. end
  32. end
  33. end
  34.  
  35. if not (network and trajectory and gamelogic and getbodyparts) then
  36. return
  37. end
  38.  
  39. spawn(function()
  40. while true do
  41. heartbeat = game:GetService("RunService").Heartbeat:Wait() -- needed because else the undetectable shit breaks lmao
  42. end
  43. end)
  44.  
  45. local GetTarget = function()
  46. local closestdist = math.huge
  47. local closestplr
  48. local closestplrbody
  49.  
  50. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  51. local target_body = getbodyparts(v)
  52. if target_body and rawget(target_body, "rootpart") and v ~= game:GetService("Players").LocalPlayer and v.Team.Name ~= game:GetService("Players").LocalPlayer.Team.Name then
  53. local f = game.Workspace.CurrentCamera:WorldToScreenPoint(target_body.rootpart.Parent["Head"].Position)
  54. local f2 = Vector2.new(f.X, f.Y)
  55. local mouseloc = Vector2.new(game:GetService("Players").LocalPlayer:GetMouse().X, game:GetService("Players").LocalPlayer:GetMouse().Y)
  56. local dist = (f2 - mouseloc).Magnitude
  57. if dist < closestdist then
  58. closestdist = dist
  59. closestplr = v
  60. closestplrbody = target_body.rootpart.Parent
  61. end
  62. end
  63. end
  64.  
  65. if closestplr and closestplrbody then if closestplrbody:FindFirstChild("Head") then return closestplrbody, closestplr end end
  66. return
  67. end
  68.  
  69. local __old = network.send
  70. network.send = function(self, ...)
  71. local args = { ... }
  72. if args[1] == "newbullets" then
  73. local target, playertarget = GetTarget()
  74. print(target, playertarget)
  75. if target and playertarget then
  76. local playerposition = camera.basecframe.Position
  77. args[2]["firepos"] = playerposition
  78. args[2]["camerapos"] = playerposition
  79.  
  80. for i,v in pairs(args[2]["bullets"]) do
  81. v[1] = trajectory(playerposition, Vector3.new(0, game.Workspace.Gravity, 0), target[Settings["HitPart"]].Position, gamelogic.currentgun.data.bulletspeed)
  82. end
  83.  
  84. __old(self, unpack(args))
  85.  
  86. if Settings["Undetectable"] then
  87. local totaltimewaited = 0
  88. repeat
  89. totaltimewaited = totaltimewaited + heartbeat
  90. until totaltimewaited >= ((target[Settings["HitPart"]].Position - playerposition).Magnitude / gamelogic.currentgun.data.bulletspeed)
  91. end
  92.  
  93. for i,v in pairs(args[2]["bullets"]) do
  94. if target and v[2] then
  95. local bullethitarguments = {
  96. "bullethit",
  97. playertarget,
  98. target[Settings["HitPart"]].Position,
  99. target[Settings["HitPart"]],
  100. v[2]
  101. }
  102. network.send(self, unpack(bullethitarguments))
  103. end
  104. end
  105.  
  106. return
  107. end
  108. end
  109. if args[1] == "chatted" then
  110. local message = args[2]
  111. if string.find(message:lower(), "sethitpart") then
  112. for w in message:gmatch('[^:%s]+') do
  113. if w ~= "sethitpart" then
  114. Settings["HitPart"] = w
  115. end
  116. end
  117. return
  118. end
  119. if string.find(message:lower(), "setundetectable") then
  120. for w in message:gmatch('[^:%s]+') do
  121. if w ~= "setundetectable" then
  122. if w:lower() == "true" then
  123. Settings["Undetectable"] = true
  124. elseif w:lower() == "false" then
  125. Settings["Undetectable"] = false
  126. end
  127. end
  128. end
  129. return
  130. end
  131. end
  132. return __old(self, unpack(args))
  133. end
  134.  
  135. wait(0)game.StarterGui:SetCore("SendNotification", {Title = "Silent AIM"; Text = "Silent Aim Loaded! Sub to Eraniuns on YT!";})
  136.  
  137. print("Silent aim loaded! Eraniuns on YT!")
Advertisement
Add Comment
Please, Sign In to add comment