Honansik

Energy Assault Script [AIM]

Nov 29th, 2021
1,634
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local Run = game:GetService("RunService")
  2. local Players = game:GetService("Players")
  3.  
  4. local LPlr = Players.LocalPlayer
  5. local Mouse,Cam = LPlr:GetMouse(),workspace.CurrentCamera
  6.  
  7. local CPlr = function()
  8.    local Plr;
  9.    local Shearch = math.huge
  10.  
  11.    for I,V in pairs(Players:GetChildren()) do
  12.        if V ~= LPlr and V.Character and V.Character:FindFirstChild("HumanoidRootPart") then
  13.            local Vec,On = Cam:WorldToViewportPoint(V.Character.HumanoidRootPart.Position)
  14.            local Difference = (Vector2.new(Mouse.X,Mouse.Y) - Vector2.new(Vec.X,Vec.Y)).Magnitude
  15.  
  16.            if On and Difference < Shearch then
  17.                Shearch = Difference
  18.                Plr = V
  19.            end
  20.        end
  21.    end
  22.    return Plr
  23. end
  24.  
  25. local Update = function()
  26. local GunEnv = getsenv(LPlr.PlayerGui.gunls)
  27. repeat wait() until GunEnv.randomunitvector
  28. local RandVec = GunEnv.randomunitvector
  29.  
  30. GunEnv.randomunitvector = function(...)
  31. local Args = {...}
  32. local Plr = CPlr()
  33.  
  34. if Plr then
  35. return (Plr.Character.Head.Position - Cam.CFrame.Position).Unit
  36. end
  37.  
  38. return RandVec(unpack(Args))
  39. end
  40. end
  41.  
  42.  
  43.  
  44. if LPlr.PlayerGui:FindFirstChild("gunls") then
  45. Update()
  46. end
  47.  
  48. LPlr.PlayerGui.ChildAdded:Connect(function(Ins)
  49. if Ins.Name == "gunls" then
  50. wait(2)
  51. Update()
  52. end
  53. end)
RAW Paste Data