JacobRoblox

Untitled

Jan 15th, 2021
59,272
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.45 KB | None | 1 0
  1. --// Clone Detection
  2. for i, v in pairs(game:GetService("CoreGui"):GetChildren()) do
  3. if v.Name == "ScreenGui" then
  4. v:Destroy()
  5. end
  6. end
  7.  
  8. repeat
  9. wait()
  10. until game:GetService("Players").LocalPlayer ~= nil
  11.  
  12. if not game:GetService("Players").LocalPlayer.Character then
  13. game:GetService("Players").LocalPlayer.CharacterAdded:Wait()
  14. end
  15.  
  16.  
  17.  
  18. --/ Variables & Da Hood Gui Clones Deletion
  19.  
  20. local LocalPlayer = game:GetService("Players").LocalPlayer
  21. local Character = LocalPlayer.Character
  22. local Workspace = game:GetService("Workspace")
  23. local CoreGui = game:GetService("CoreGui")
  24.  
  25. local LockedPlayer = nil
  26. local Aimlock = nil
  27.  
  28. for i, v in pairs(game:GetService("CoreGui"):GetChildren()) do
  29. if v.Name == "dhgui" then
  30. v:Destroy()
  31. end
  32. end
  33.  
  34. local mt = getrawmetatable(game)
  35. local namecall = mt.__namecall
  36. setreadonly(mt, false)
  37.  
  38. if getrawmetatable then
  39. local mt = getrawmetatable(game)
  40. local namecall = mt.__namecall
  41. setreadonly(mt, false)
  42.  
  43. mt.__namecall = newcclosure(function(table, ...)
  44. local args = {...}
  45. local method = getnamecallmethod()
  46. if method == "FireServer" and args[1] and args[1] == "UpdateMousePos" then
  47. if not (args[3] and args[3] == "Aimlock") then
  48. return nil
  49. end
  50. end
  51. return namecall(table, ...)
  52. end)
  53. end
  54.  
  55. local function FindPlrOnMouse()
  56. for i, v in pairs(game.Workspace:FindPartsInRegion3(Region3.new(LocalPlayer:GetMouse().Hit.Position, LocalPlayer:GetMouse().Hit.Position))) do
  57. local plr = game.Players:GetPlayerFromCharacter(v.Parent)
  58. if plr ~= nil and plr ~= LocalPlayer then
  59. return plr
  60. end
  61. end
  62. return nil
  63. end
  64.  
  65. -- // Gui
  66. local ScreenGui = Instance.new("ScreenGui")
  67. local Frame = Instance.new("Frame")
  68. local TextButton = Instance.new("TextButton")
  69. local TextButton_2 = Instance.new("TextButton")
  70. local TextBox = Instance.new("TextBox")
  71.  
  72.  
  73. --// Gui Making
  74.  
  75. ScreenGui.Parent = game.CoreGui
  76. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  77.  
  78. Frame.Parent = ScreenGui
  79. Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  80. Frame.Position = UDim2.new(0.30297032, 0, 0.475625843, 0)
  81. Frame.Size = UDim2.new(0, 397, 0, 211)
  82. Frame.Active = true
  83. Frame.Draggable = true
  84.  
  85.  
  86.  
  87. TextButton.Parent = Frame
  88. TextButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  89. TextButton.Position = UDim2.new(0.0554156154, 0, 0.60189575, 0)
  90. TextButton.Size = UDim2.new(0, 136, 0, 50)
  91. TextButton.Font = Enum.Font.Cartoon
  92. TextButton.Text = "Aimlock Tool"
  93. TextButton.TextColor3 = Color3.fromRGB(0, 0, 0)
  94. TextButton.TextSize = 14.000
  95.  
  96.  
  97. TextButton_2.Parent = Frame
  98. TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  99. TextButton_2.Position = UDim2.new(0.570553482, 0, 0.60189575, 0)
  100. TextButton_2.Size = UDim2.new(0, 136, 0, 50)
  101. TextButton_2.Font = Enum.Font.Cartoon
  102. TextButton_2.Text = ""
  103. TextButton_2.TextColor3 = Color3.fromRGB(0, 0, 0)
  104. TextButton_2.TextSize = 14.000
  105.  
  106.  
  107.  
  108. TextBox.Parent = Frame
  109. TextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  110. TextBox.Position = UDim2.new(0.246851385, 0, 0.218009472, 0)
  111. TextBox.Size = UDim2.new(0, 200, 0, 50)
  112. TextBox.Font = Enum.Font.Cartoon
  113. TextBox.PlaceholderColor3 = Color3.fromRGB(178, 178, 178)
  114. TextBox.Text = ""
  115. TextBox.TextColor3 = Color3.fromRGB(0, 0, 0)
  116. TextBox.TextSize = 14.000
  117.  
  118.  
  119. TextButton.MouseButton1Click:connect(function()
  120. Aimlock = nil
  121.  
  122. for i, v in pairs(LocalPlayer.Backpack:GetChildren()) do
  123. if v.ClassName == "Tool" and v.Name == "Aimlock Tool" then
  124. v:Destroy()
  125. end
  126. end
  127. for i, v in pairs(LocalPlayer.Character:GetChildren()) do
  128. if v.ClassName == "Tool" and v.Name == "Aimlock Tool" then
  129. v:Destroy()
  130. elseif v.ClassName == "Tool" then
  131. v.Parent = LocalPlayer.Backpack
  132. end
  133. end
  134.  
  135. local AimlockTool = Instance.new("Tool")
  136. AimlockTool.Name = "Aimlock Tool"
  137. AimlockTool.Parent = LocalPlayer.Backpack
  138. AimlockTool.RequiresHandle = false
  139. AimlockTool.TextureId = "rbxasset://1532350639"
  140.  
  141. AimlockTool.Activated:Connect(function()
  142. local Plr = FindPlrOnMouse()
  143.  
  144. if Plr ~= nil and Plr.Character and Plr.Character:FindFirstChild("Head") and Plr.Character:FindFirstChild("UpperTorso") then
  145. Aimlock = Plr
  146.  
  147. game:GetService("StarterGui"):SetCore("SendNotification",{
  148. Title = "AIMLOCK | Corpse";
  149. Text = "Aimlocking towards: " .. Plr.Name .. ", use any gun and shoot anywhere";
  150. Button1 = "Ok";
  151. Duration = 2.5;
  152. })
  153. else
  154. Aimlock = nil
  155.  
  156. game:GetService("StarterGui"):SetCore("SendNotification",{
  157. Title = "AIMLOCK | Corpse";
  158. Text = "No player clicked on, aimlocking towards mouse as normal";
  159. Button1 = "Ok";
  160. Duration = 2.5;
  161. })
  162. end
  163. end)
  164. end)
  165.  
  166. if getrawmetatable then
  167. game:GetService("RunService").Heartbeat:Connect(function()
  168. if Aimlock ~= nil and Aimlock.Character and Aimlock.Character:FindFirstChild("Head") then
  169. game.ReplicatedStorage.MainEvent:FireServer("UpdateMousePos", Aimlock.Character.Head.Position, "Aimlock")
  170. elseif Aimlock ~= nil and Aimlock.Character and Aimlock.Character:FindFirstChildOfClass("Part") then
  171. game.ReplicatedStorage.MainEvent:FireServer("UpdateMousePos", Aimlock.Character:FindFirstChildOfClass("Part").Position, "Aimlock")
  172. elseif Aimlock == nil then
  173. game.ReplicatedStorage.MainEvent:FireServer("UpdateMousePos", game:GetService("Players").LocalPlayer:GetMouse().Hit.Position, "Aimlock")
  174. end
  175. end)
  176. else
  177. for i = 1, 10 do
  178. game:GetService("RunService").Heartbeat:Connect(function()
  179. if Aimlock ~= nil and Aimlock.Character and Aimlock.Character:FindFirstChild("Head") then
  180. game.ReplicatedStorage.MainEvent:FireServer("UpdateMousePos", Aimlock.Character.Head.Position)
  181. elseif Aimlock ~= nil and Aimlock.Character and Aimlock.Character:FindFirstChildOfClass("Part") then
  182. game.ReplicatedStorage.MainEvent:FireServer("UpdateMousePos", Aimlock.Character:FindFirstChildOfClass("Part").Position)
  183. end
  184. end)
  185. game:GetService("RunService").RenderStepped:Connect(function()
  186. if Aimlock ~= nil and Aimlock.Character and Aimlock.Character:FindFirstChild("Head") then
  187. game.ReplicatedStorage.MainEvent:FireServer("UpdateMousePos", Aimlock.Character.Head.Position)
  188. elseif Aimlock ~= nil and Aimlock.Character and Aimlock.Character:FindFirstChildOfClass("Part") then
  189. game.ReplicatedStorage.MainEvent:FireServer("UpdateMousePos", Aimlock.Character:FindFirstChildOfClass("Part").Position)
  190. end
  191. end)
  192. game:GetService("RunService").Stepped:Connect(function()
  193. if Aimlock ~= nil and Aimlock.Character and Aimlock.Character:FindFirstChild("Head") then
  194. game.ReplicatedStorage.MainEvent:FireServer("UpdateMousePos", Aimlock.Character.Head.Position)
  195. elseif Aimlock ~= nil and Aimlock.Character and Aimlock.Character:FindFirstChildOfClass("Part") then
  196. game.ReplicatedStorage.MainEvent:FireServer("UpdateMousePos", Aimlock.Character:FindFirstChildOfClass("Part").Position)
  197. end
  198. end)
  199. end
  200. end
  201.  
Advertisement
Add Comment
Please, Sign In to add comment