Advertisement
Honansik

Strucid Slient Aim Base Script

Dec 21st, 2021
1,498
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.73 KB | None | 0 0
  1. getgenv().Settings = {
  2.     Enabled = true,
  3. }
  4.  
  5.  
  6. local Players = game:GetService("Players")
  7. local LocalPlayer = Players.LocalPlayer
  8. local Mouse = LocalPlayer:GetMouse()
  9. local Camera = game.Workspace.CurrentCamera
  10. local RunService = game:GetService("RunService")
  11. local UserInputService = game:GetService("UserInputService")
  12.  
  13.  
  14.  
  15. function IsAlive()
  16.     if Players.LocalPlayer.PlayerGui:FindFirstChild("MainGui") then
  17.         return true
  18.     end
  19.     return false
  20. end
  21.  
  22.  
  23. function Closest()
  24.     local Distance = math.huge
  25.     local Closest
  26.     if IsAlive() then
  27.         for i,v in pairs(Players:GetPlayers()) do
  28.             if v ~= LocalPlayer then
  29.                 if v.Character and v.Character:FindFirstChild("HumanoidRootPart") then
  30.                     local Pos, OnScreen = Camera:WorldToScreenPoint(v.Character.Head.Position)
  31.                     local RealMouse = UserInputService:GetMouseLocation()
  32.                     local Dist = (Vector2.new(Pos.X, Pos.Y) - Vector2.new(RealMouse.X, RealMouse.Y)).Magnitude
  33.                     if Dist < Distance then
  34.                         Distance = Dist
  35.                         Closest = v
  36.                     end
  37.                 end
  38.             end
  39.         end
  40.     end
  41.     return Closest
  42. end
  43.  
  44. LocalPlayer.PlayerGui.ChildAdded:Connect(function(child)
  45.     if child.Name == "MainGui" then
  46.         local Module = require(child:FindFirstChild("NewLocal").Tools.Tool.Gun)
  47.         local Old = Module.ConeOfFire
  48.         Module.ConeOfFire = function(...)
  49.             local closest = Closest()
  50.             if closest ~= nil and Settings.Enabled then
  51.                 return closest.Character.HumanoidRootPart.CFrame.p
  52.             end
  53.             return Old(...)
  54.         end
  55.     end
  56. end)
  57.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement