Advertisement
Guest User

Silent aim

a guest
Sep 17th, 2021
6,666
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. -- Gui to Lua
  2. -- Version: 3.2
  3.  
  4. -- Instances:
  5.  
  6. local ScreenGui = Instance.new("ScreenGui")
  7. local Frame = Instance.new("Frame")
  8. local toggle = Instance.new("TextButton")
  9. local TextLabel = Instance.new("TextLabel")
  10.  
  11. --Properties:
  12.  
  13. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  14. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  15.  
  16. Frame.Parent = ScreenGui
  17. Frame.BackgroundColor3 = Color3.fromRGB(187, 244, 255)
  18. Frame.Position = UDim2.new(0, 0, 0.445328146, 0)
  19. Frame.Size = UDim2.new(0, 63, 0, 146)
  20.  
  21. toggle.Name = "toggle"
  22. toggle.Parent = Frame
  23. toggle.BackgroundColor3 = Color3.fromRGB(165, 213, 255)
  24. toggle.Position = UDim2.new(0, 0, 0.328767121, 0)
  25. toggle.Size = UDim2.new(0, 63, 0, 50)
  26. toggle.Font = Enum.Font.SourceSans
  27. toggle.Text = "off"
  28. toggle.TextColor3 = Color3.fromRGB(248, 43, 29)
  29. toggle.TextScaled = true
  30. toggle.TextSize = 14.000
  31. toggle.TextWrapped = true
  32.  
  33. TextLabel.Parent = Frame
  34. TextLabel.BackgroundColor3 = Color3.fromRGB(165, 201, 255)
  35. TextLabel.Size = UDim2.new(0, 63, 0, 33)
  36. TextLabel.Font = Enum.Font.SourceSans
  37. TextLabel.Text = "AimBot"
  38. TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  39. TextLabel.TextScaled = true
  40. TextLabel.TextSize = 14.000
  41. TextLabel.TextWrapped = true
  42.  
  43. -- Scripts:
  44.  
  45. local function TKJCW_fake_script() -- toggle.LocalScript
  46. local script = Instance.new('LocalScript', toggle)
  47.  
  48.  
  49.  
  50. _G.silentaim = false
  51. script.Parent.MouseButton1Click:Connect(function()
  52. if _G.silentaim == false then
  53. _G.silentaim = true
  54. script.Parent.Text = "On"
  55. script.Parent.TextColor3 = Color3.fromRGB(136, 255, 0)
  56. else
  57. _G.silentaim = false
  58. script.Parent.Text = "Off"
  59. script.Parent.TextColor3 = Color3.fromRGB(255, 0, 4)
  60. end
  61. end)
  62.  
  63. local players = game:GetService("Players")
  64. local plr = players.LocalPlayer
  65. local mouse = plr:GetMouse()
  66. local camera = game.Workspace.CurrentCamera
  67. local teamcheck = true
  68.  
  69. local function ClosestPlayerToMouse()
  70. local target = nil
  71. local dist = math.huge
  72. for i,v in pairs(players:GetPlayers()) do
  73. if v.Name ~= plr.Name then
  74. if v.Character and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health ~= 0 and v.Character:FindFirstChild("HumanoidRootPart") and _G.silentaim and teamcheck and v.TeamColor ~= plr.TeamColor then
  75. local screenpoint = camera:WorldToScreenPoint(v.Character.HumanoidRootPart.Position)
  76. local check = (Vector2.new(mouse.X,mouse.Y)-Vector2.new(screenpoint.X,screenpoint.Y)).magnitude
  77.  
  78. if check < dist then
  79. target = v
  80. dist = check
  81. end
  82. end
  83. end
  84. end
  85.  
  86. return target
  87. end
  88.  
  89. local mt = getrawmetatable(game)
  90. local namecall = mt.__namecall
  91. setreadonly(mt,false)
  92.  
  93. mt.__namecall = function(self,...)
  94. local args = {...}
  95. local method = getnamecallmethod()
  96.  
  97. if tostring(self) == "HitPart" and method == "FireServer" then
  98. print("so?")
  99. args[1] = ClosestPlayerToMouse().Character.Head
  100. args[2] = ClosestPlayerToMouse().Character.Head.Position
  101. return self.FireServer(self, unpack(args))
  102. end
  103. return namecall(self,...)
  104. end
  105.  
  106.  
  107.  
  108. end
  109. coroutine.wrap(TKJCW_fake_script)()
  110.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement