sucksuck

Untitled

Aug 24th, 2023
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.24 KB | None | 0 0
  1. --//Lazy code and messy
  2. local KeyBind = Enum.KeyCode.B --//You can edit keybind by replacing "RightShift" with your key
  3.  
  4.  
  5.  
  6. local ScreenGui = Instance.new("ScreenGui") --//Gui on bottem left side of you screen
  7. local Frame = Instance.new("Frame")
  8. local TextLabel = Instance.new("TextLabel")
  9.  
  10. ScreenGui.Parent = (game:GetService("CoreGui") or gethui())
  11. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  12.  
  13. Frame.Parent = ScreenGui
  14. Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  15. Frame.BackgroundTransparency = 1.000
  16. Frame.Position = UDim2.new(0.00698215654, 0, 0.937655866, 0)
  17. Frame.Size = UDim2.new(0, 289, 0, 42)
  18.  
  19. TextLabel.Parent = Frame
  20. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  21. TextLabel.BackgroundTransparency = 1.000
  22. TextLabel.Position = UDim2.new(0.0415224917, 0, 0, 0)
  23. TextLabel.Size = UDim2.new(0, 296, 0, 33)
  24. TextLabel.Font = Enum.Font.SourceSansBold
  25. TextLabel.Text = "AutoAim: false"
  26. TextLabel.TextColor3 = Color3.fromRGB(255, 0, 0)
  27. TextLabel.TextScaled = true
  28. TextLabel.TextSize = 14.000
  29. TextLabel.TextWrapped = true
  30. TextLabel.TextXAlignment = Enum.TextXAlignment.Left
  31.  
  32. local run = function(a,Called)
  33. local Error,Value = pcall(function()
  34. coroutine.wrap(a)(Called)
  35. end)
  36. coroutine.wrap(function()
  37. if Value and Error == false then
  38. warn("Error at: "..tostring(Value))
  39. end
  40. end)()
  41. end
  42. local Menus = {}
  43. local UserInputService = game:GetService("UserInputService")
  44.  
  45.  
  46. local States = {
  47. AutoAim = false,
  48. }
  49.  
  50. --//https://create.roblox.com/docs/reference/engine/classes/UserInputService😂
  51. local UserInputService = game:GetService("UserInputService")
  52.  
  53. local function onInputBegan(input, _gameProcessed)
  54. if input.KeyCode == KeyBind then
  55. States.AutoAim = not States.AutoAim
  56. TextLabel.Text = "AutoAim: "..tostring(States.AutoAim)
  57. if States.AutoAim then
  58. TextLabel.TextColor3 = Color3.new(0.0431373, 1, 0.0431373)
  59. else
  60. TextLabel.TextColor3 = Color3.new(1, 0, 0.0156863)
  61. end
  62. end
  63. end
  64.  
  65. UserInputService.InputBegan:Connect(onInputBegan)
  66.  
  67.  
  68. function GetChars()
  69. local chars = {}
  70. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  71. if v and v ~= game.Players.LocalPlayer then
  72. chars[#chars+1] = v.Character
  73. end
  74. end
  75. return chars
  76. end
  77. function findNearestPlayer(Position)
  78. local List = GetChars()
  79. local Torso = nil
  80. local Distance = 15
  81. local Temp = nil
  82. local Human = nil
  83. local Temp2 = nil
  84. for x = 1, #List do
  85. Temp2 = List[x]
  86. if (Temp2.className == "Model") and (Temp2 ~= script.Parent) then
  87. Temp = Temp2:findFirstChild("HumanoidRootPart")
  88. Human = Temp2:findFirstChild("Humanoid")
  89. if (Temp ~= nil) and (Human ~= nil) and (Human.Health > 0) then
  90. if (Temp.Position - Position).magnitude < Distance then
  91. Torso = Temp
  92. Distance = (Temp.Position - Position).magnitude
  93. end
  94. end
  95. end
  96. end
  97. return Torso
  98. end
  99.  
  100.  
  101.  
  102. local Player = game.Players.LocalPlayer
  103. local Character = Player.Character
  104.  
  105.  
  106. local Mouse = Player:GetMouse()
  107. local RunService = game:GetService("RunService")
  108. local Root = game.Players.LocalPlayer.Character.HumanoidRootPart
  109. local RootPos, MousePos = Root.Position, findNearestPlayer(Root.Position)
  110. game:GetService("Players").LocalPlayer.CharacterAdded:Connect(function(a)
  111. repeat task.wait() until a and a:FindFirstChildOfClass("Humanoid")
  112. Root =game:GetService("Players").LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
  113. RootPos, MousePos = Root.Position, findNearestPlayer(Root.Position)
  114. end)
  115. RunService.RenderStepped:Connect(function()
  116. if States.AutoAim then
  117. RootPos, MousePos = Root.Position, findNearestPlayer(Root.Position)
  118. pcall(function()
  119.  
  120. if MousePos then
  121. Root.CFrame = CFrame.new(RootPos, Vector3.new(MousePos.Position.X, RootPos.Y, MousePos.Position.Z))
  122. end
  123. end)
  124. end
  125. end)
  126. local stop = false
  127. local cd1 = false
  128. local startbypass = false
  129. local changecd = false
  130. task.spawn(function()
  131. while true do
  132. task.wait()
  133. pcall(function()
  134. if States.AutoAim then
  135. if MousePos and RootPos then
  136. if MousePos and States.AutoAim then
  137. Root.CFrame = MousePos.CFrame*CFrame.new(0,0,3)
  138. pcall(function()
  139. game:GetService("Players").LocalPlayer.Character:FindFirstChildOfClass("Tool"):Activate()
  140. end)
  141. end
  142. end
  143. end
  144. end)
  145. end
  146. end)
  147.  
  148.  
Advertisement
Add Comment
Please, Sign In to add comment