Advertisement
_Thanh_Thy_Cute_

Island Royale SILENT AIM OPEN SOURCE

Aug 5th, 2021
655
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. -- vars
  2. local Players = game.GetService(game, "Players"); -- only reason i did this is bc island royale would error if i use other way ( :shrug: )
  3. local Player = Players.LocalPlayer;
  4. local Mouse = Player:GetMouse();
  5. local CurrentCam= game.GetService(game, "Workspace").CurrentCamera;
  6.  
  7. -- player func
  8. local function getClosestPlayer()
  9. local closestPlayer;
  10. local shortestDistance = math.huge;
  11.  
  12. for i, v in next, Players.GetPlayers(Players) do
  13. if (v ~= Player and v.Character and v.Character.FindFirstChild(v.Character, "Head")) then
  14. local pos = CurrentCam.WorldToViewportPoint(CurrentCam, v.Character.Head.Position);
  15. local magnitude = (Vector2.new(pos.X, pos.Y) - Vector2.new(Mouse.X, Mouse.Y)).magnitude;
  16.  
  17. if (magnitude < shortestDistance) then
  18. closestPlayer = v;
  19. shortestDistance = magnitude;
  20. end;
  21. end;
  22. end;
  23.  
  24. return closestPlayer;
  25. end;
  26.  
  27. -- main hook
  28. local oldHook;
  29. oldHook = hookmetamethod(game, "__namecall", function(self, ...)
  30. local args = {...};
  31. local method = getnamecallmethod();
  32.  
  33. if (method == "FindPartOnRayWithIgnoreList" and getfenv(2).script.Name == "RC") then
  34. local closePlayer = getClosestPlayer();
  35.  
  36. if (closePlayer and closePlayer.Character and closePlayer.Character.FindFirstChild(closePlayer.Character, "Head")) then
  37. local wally = (closePlayer.Character.Head.Position - CurrentCam.CFrame.Position);
  38.  
  39. args[1] = Ray.new(CurrentCam.CFrame.Position, wally.unit * wally.magnitude);
  40. end;
  41. end;
  42.  
  43. return oldHook(self, unpack(args));
  44. end);
  45.  
  46. print'running' -- made by the sexy beast named icee
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement