Advertisement
Alex_great

PL

Jun 23rd, 2022
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. local Players = game.Players
  2. local LocalPlayer = Players.LocalPlayer
  3. local GetPlayers = Players.GetPlayers
  4. local Camera = workspace.CurrentCamera
  5. local WTSP = Camera.WorldToScreenPoint
  6. local FindFirstChild = game.FindFirstChild
  7. local Vector2_new = Vector2.new
  8. local Mouse = LocalPlayer.GetMouse(LocalPlayer)
  9. function ClosestChar()
  10. local Max, Close = math.huge
  11. for I,V in pairs(GetPlayers(Players)) do
  12. if V ~= LocalPlayer and V.Team ~= LocalPlayer.Team and V.Character then
  13. local Torso = FindFirstChild(V.Character, "Torso")
  14. if Torso then
  15. local Pos, OnScreen = WTSP(Camera, Torso.Position)
  16. if OnScreen then
  17. local Dist = (Vector2_new(Pos.X, Pos.Y) - Vector2_new(Mouse.X, Mouse.Y)).Magnitude
  18. if Dist < Max then
  19. Max = Dist
  20. Close = V.Character
  21. end
  22. end
  23. end
  24. end
  25. end
  26. return Close
  27. end
  28.  
  29. local MT = getrawmetatable(game)
  30. local __namecall = MT.__namecall
  31. setreadonly(MT, false)
  32. MT.__namecall = newcclosure(function(self, ...)
  33. local Method = getnamecallmethod()
  34. if Method == "FindPartOnRay" and not checkcaller() and tostring(getfenv(0).script) == "GunInterface" then
  35. local Character = ClosestChar()
  36. if Character then
  37. return Character.Torso, Character.Torso.Position
  38. end
  39. end
  40.  
  41. return __namecall(self, ...)
  42. end)
  43. setreadonly(MT, true)
  44. local vu = game:GetService("VirtualUser")
  45. game:GetService("Players").LocalPlayer.Idled:connect(function()
  46. vu:Button2Down(Vector2.new(0,0),workspace.CurrentCamera.CFrame)
  47. wait(1)
  48. vu:Button2Up(Vector2.new(0,0),workspace.CurrentCamera.CFrame)
  49. end)
  50.  
  51. game.StarterGui:SetCore("SendNotification", {
  52. Title = "Subscribe To AlexScripterUnfounded";
  53. Text = "modified by AlexScripterUnfounded"; -- what the text says (ofc)
  54. Duration = 20;
  55. })
  56. wait(1)
  57. game.StarterGui:SetCore("SendNotification", {
  58. Title = "Yeah Boy";
  59. Text = "Enjoy"; -- what the text says (ofc)
  60. Duration = 20;
  61. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement