NotSirMeme

grgerhstdfghnb

Dec 10th, 2020
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. Mouse = game.Players.LocalPlayer:GetMouse()
  2. function GetChars()
  3. Chars = {}
  4. for i,v in pairs(game.Players:GetChildren()) do
  5. if v ~= game.Players.LocalPlayer and v.GameStats.Team.Value ~= game.Players.LocalPlayer.GameStats.Team.Value and game.workspace:FindFirstChild(v.Name) then
  6. table.insert(Chars,game.workspace:FindFirstChild(v.Name))
  7. end
  8. end
  9. return Chars
  10. end
  11. function GetClosestPlr()
  12. Clr = nil
  13. Dist = math.huge
  14. for i,v in pairs(GetChars()) do
  15. if v:FindFirstChild('HumanoidRootPart') and game.Players.LocalPlayer.Character:FindFirstChild('HumanoidRootPart') then
  16. local PlrPos, onScreen = game.Workspace.CurrentCamera:WorldToViewportPoint(v.HumanoidRootPart.Position);
  17. local mag = (Vector2.new(PlrPos.X, PlrPos.Y) - Vector2.new(Mouse.X, Mouse.Y)).magnitude
  18. if mag < Dist then
  19. Clr = v
  20. Dist = mag
  21. end
  22. end
  23. end
  24. return Clr
  25. end
  26. function SilentAim()
  27. if game.Players.LocalPlayer.PlayerScripts.Shockwave.Disabled == false then
  28. old = getsenv(game.Players.LocalPlayer.PlayerScripts.Shockwave).FireManage
  29. getsenv(game.Players.LocalPlayer.PlayerScripts.Shockwave).FireManage = function(gunname, pos, ...)
  30. args = {...}
  31. if GetClosestPlr() ~= nil and GetClosestPlr():FindFirstChild('HumanoidRootPart') then
  32. pos = CFrame.new(game.Workspace.CurrentCamera.CFrame.p, GetClosestPlr().HumanoidRootPart.Position)
  33. end
  34. return old(gunname, pos, unpack(args))
  35. end
  36. end
  37. end
  38. game.Players.LocalPlayer.PlayerScripts.Shockwave:GetPropertyChangedSignal("Disabled"):Connect(SilentAim)
Add Comment
Please, Sign In to add comment