Advertisement
anonmods

Strucid Script

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