Advertisement
INeverDevelop

LOLSkidded1

Nov 24th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.66 KB | None | 0 0
  1. game.Players.LocalPlayer.Chatted:connect(function(msg) --msg is the thing that the player says.
  2. if msg == "/aimbot" then
  3.  
  4. game:GetService("StarterGui"):SetCore("SendNotification", {
  5. Title = "Aimbot For RedWoodPrison",
  6. Text = "By ArsenalBackstaber"
  7. })
  8. if msg == "/aimbot" then
  9. game:GetService("StarterGui"):SetCore("SendNotification", {
  10. Title = "INFO",
  11. Text = "Q for AIMLOCK"
  12. })
  13. if msg == "/aimbot" then
  14. game:GetService("StarterGui"):SetCore("SendNotification", {
  15. Title = "INFO",
  16. Text = "E for ESP"
  17. })
  18. local plrs = game:GetService("Players")
  19. local TeamBased = true ; local teambasedswitch = "o"
  20. local presskeytoaim = true; local aimkey = "q"
  21. local raycast = false
  22.  
  23. local espupdatetime = 5; autoesp = false
  24.  
  25.  
  26.  
  27. local lockaim = true; local lockangle = 5
  28.  
  29.  
  30.  
  31. --function findwat(folder, what)
  32. -- for i, smth in pairs(folder:GetChildren()) do
  33. -- if string.find(string.lower(tostring(smth)), string.lower(what)) then
  34. -- return smth
  35. -- end
  36. -- end
  37. --end
  38. --
  39. --local plrs = findwat(game, "Players")
  40.  
  41.  
  42. local plrsforaim = {}
  43.  
  44. local lplr = game:GetService("Players").LocalPlayer
  45.  
  46. f = {}
  47. local espforlder
  48.  
  49. f.addesp = function()
  50. --print("ESP ran")
  51. if espforlder then
  52. else
  53. espforlder = Instance.new("Folder")
  54. espforlder.Parent = game.Workspace.CurrentCamera
  55. end
  56. for i, v in pairs(espforlder:GetChildren()) do
  57. v:Destroy()
  58. end
  59. for _, plr in pairs(plrs:GetChildren()) do
  60. if plr.Character and plr.Character.Humanoid.Health > 0 and plr.Name ~= lplr.Name then
  61. if TeamBased == true then
  62. if plr.Team.Name ~= plrs.LocalPlayer.Team.Name then
  63. local e = espforlder:FindFirstChild(plr.Name)
  64. if not e then
  65. --print("Added esp for team based")
  66. local bill = Instance.new("BillboardGui", espforlder)
  67. bill.Name = plr.Name
  68. bill.AlwaysOnTop = true
  69. bill.Size = UDim2.new(1,0,1,0)
  70. bill.Adornee = plr.Character.Head
  71. local Frame = Instance.new('Frame',bill)
  72. Frame.Active = true
  73. Frame.BackgroundColor3 = Color3.new(255, 0, 0)
  74. Frame.BackgroundTransparency = 0
  75. Frame.BorderSizePixel = 0
  76. Frame.AnchorPoint = Vector2.new(.5, .5)
  77. Frame.Position = UDim2.new (0.5,0,0.5,0)
  78. Frame.Size = UDim2.new (1,0,1,0)
  79. Frame.Rotation = 0
  80. plr.Character.Humanoid.Died:Connect(function()
  81. bill:Destroy()
  82. end)
  83. end
  84. end
  85. else
  86. local e = espforlder:FindFirstChild(plr.Name)
  87. if not e then
  88. --print("Added esp")
  89. local bill = Instance.new("BillboardGui", espforlder)
  90. bill.Name = plr.Name
  91. bill.AlwaysOnTop = true
  92. bill.Size = UDim2.new(1,0,1,0)
  93. bill.Adornee = plr.Character.Head
  94. local Frame = Instance.new('Frame',bill)
  95. Frame.Active = true
  96. Frame.BackgroundColor3 = Color3.new(255, 0, 0)
  97. Frame.BackgroundTransparency = 0
  98. Frame.BorderSizePixel = 0
  99. Frame.AnchorPoint = Vector2.new(.5, .5)
  100. Frame.Position = UDim2.new (0.5,0,0.5,0)
  101. Frame.Size = UDim2.new (1,0,1,0)
  102. Frame.Rotation = 0
  103. plr.Character.Humanoid.Died:Connect(function()
  104. bill:Destroy()
  105. end)
  106. end
  107. end
  108.  
  109.  
  110. end
  111. end
  112. end
  113. local cam = game.Workspace.CurrentCamera
  114.  
  115. local mouse = lplr:GetMouse()
  116. local switch = false
  117. local key = "k"
  118. local aimatpart = nil
  119. mouse.KeyDown:Connect(function(a)
  120. if a == "e" then
  121. print("worked1")
  122. f.addesp()
  123. elseif a == "u" then
  124. if raycast == true then
  125. raycast = false
  126. else
  127. raycast = true
  128. end
  129. elseif a == "l" then
  130. if autoesp == false then
  131. autoesp = true
  132. else
  133. autoesp = false
  134. end
  135. end
  136. if a == "j" then
  137. if mouse.Target then
  138. mouse.Target:Destroy()
  139. end
  140. end
  141. if a == key then
  142. if switch == false then
  143. switch = true
  144. else
  145. switch = false
  146. if aimatpart ~= nil then
  147. aimatpart = nil
  148. end
  149. end
  150. elseif a == teambasedswitch then
  151. if TeamBased == true then
  152. TeamBased = false
  153. teambasedstatus.Text = tostring(TeamBased)
  154. else
  155. TeamBased = true
  156. teambasedstatus.Text = tostring(TeamBased)
  157. end
  158. elseif a == aimkey then
  159. if not aimatpart then
  160. local maxangle = math.rad(20)
  161. for i, plr in pairs(plrs:GetChildren()) do
  162. if plr.Name ~= lplr.Name and plr.Character and plr.Character.Head and plr.Character.Humanoid and plr.Character.Humanoid.Health > 1 then
  163. if TeamBased == true then
  164. if plr.Team.Name ~= lplr.Team.Name then
  165. local an = checkfov(plr.Character.Head)
  166. if an < maxangle then
  167. maxangle = an
  168. aimatpart = plr.Character.Head
  169. end
  170. end
  171. else
  172. local an = checkfov(plr.Character.Head)
  173. if an < maxangle then
  174. maxangle = an
  175. aimatpart = plr.Character.Head
  176. end
  177. print(plr)
  178. end
  179. plr.Character.Humanoid.Died:Connect(function()
  180. if aimatpart.Parent == plr.Character or aimatpart == nil then
  181. aimatpart = nil
  182. end
  183. end)
  184. end
  185. end
  186. else
  187. aimatpart = nil
  188. end
  189. end
  190. end)
  191.  
  192. function getfovxyz (p0, p1, deg)
  193. local x1, y1, z1 = p0:ToOrientation()
  194. local cf = CFrame.new(p0.p, p1.p)
  195. local x2, y2, z2 = cf:ToOrientation()
  196. --local d = math.deg
  197. if deg then
  198. --return Vector3.new(d(x1-x2), d(y1-y2), d(z1-z2))
  199. else
  200. return Vector3.new((x1-x2), (y1-y2), (z1-z2))
  201. end
  202. end
  203.  
  204. function getaimbotplrs()
  205. plrsforaim = {}
  206. for i, plr in pairs(plrs:GetChildren()) do
  207. if plr.Character and plr.Character.Humanoid and plr.Character.Humanoid.Health > 0 and plr.Name ~= lplr.Name and plr.Character.Head then
  208.  
  209. if TeamBased == true then
  210. if plr.Team.Name ~= lplr.Team.Name then
  211. local cf = CFrame.new(game.Workspace.CurrentCamera.CFrame.p, plr.Character.Head.CFrame.p)
  212. local r = Ray.new(cf, cf.LookVector * 10000)
  213. local ign = {}
  214. for i, v in pairs(plrs.LocalPlayer.Character:GetChildren()) do
  215. if v:IsA("BasePart") then
  216. table.insert(ign , v)
  217. end
  218. end
  219. local obj = game.Workspace:FindPartOnRayWithIgnoreList(r, ign)
  220. if obj.Parent == plr.Character and obj.Parent ~= lplr.Character then
  221. table.insert(plrsforaim, obj)
  222. end
  223. end
  224. else
  225. local cf = CFrame.new(game.Workspace.CurrentCamera.CFrame.p, plr.Character.Head.CFrame.p)
  226. local r = Ray.new(cf, cf.LookVector * 10000)
  227. local ign = {}
  228. for i, v in pairs(plrs.LocalPlayer.Character:GetChildren()) do
  229. if v:IsA("BasePart") then
  230. table.insert(ign , v)
  231. end
  232. end
  233. local obj = game.Workspace:FindPartOnRayWithIgnoreList(r, ign)
  234. if obj.Parent == plr.Character and obj.Parent ~= lplr.Character then
  235. table.insert(plrsforaim, obj)
  236. end
  237. end
  238.  
  239.  
  240. end
  241. end
  242. end
  243.  
  244. function aimat(part)
  245. cam.CFrame = CFrame.new(cam.CFrame.p, part.CFrame.p)
  246. end
  247. function checkfov (part)
  248. local fov = getfovxyz(game.Workspace.CurrentCamera.CFrame, part.CFrame)
  249. local angle = math.abs(fov.X) + math.abs(fov.Y)
  250. return angle
  251. end
  252.  
  253. game:GetService("RunService").RenderStepped:Connect(function()
  254. if aimatpart then
  255. aimat(aimatpart)
  256. if aimatpart.Parent == plrs.LocalPlayer.Character then
  257. aimatpart = nil
  258. end
  259. end
  260.  
  261.  
  262. -- if switch == true then
  263. -- local maxangle = 99999
  264. --
  265. -- --print("Loop")
  266. -- if true and raycast == false then
  267. -- for i, plr in pairs(plrs:GetChildren()) do
  268. -- if plr.Name ~= lplr.Name and plr.Character and plr.Character.Head and plr.Character.Humanoid and plr.Character.Humanoid.Health > 1 then
  269. -- if TeamBased then
  270. -- if plr.Team.Name ~= lplr.Team.Name or plr.Team. ~= lplr.Team. then
  271. -- local an = checkfov(plr.Character.Hea
  272. -- if an < maxangle then
  273. -- maxangle = an
  274. -- aimatpart = plr.Character.Head
  275. -- if an < lockangle then
  276. -- break
  277. -- end
  278. -- end
  279. -- end
  280. -- else
  281. -- local an = checkfov(plr.Character.Head)
  282. -- if an < maxangle then
  283. -- maxangle = an
  284. -- aimatpart = plr.Character.Head
  285. -- if an < lockangle then
  286. -- break
  287. -- end
  288. -- end
  289. -- end
  290. --
  291. --
  292. --
  293. --
  294. -- end
  295. -- end
  296. -- elseif raycast == true then
  297. --
  298. -- end
  299.  
  300. if raycast == true and switch == false and not aimatpart then
  301. getaimbotplrs()
  302. aimatpart = nil
  303. local maxangle = 999
  304. for i, v in ipairs(plrsforaim) do
  305. if v.Parent ~= lplr.Character then
  306. local an = checkfov(v)
  307. if an < maxangle and v ~= lplr.Character.Head then
  308. maxangle = an
  309. aimatpart = v
  310. print(v:GetFullName())
  311. v.Parent.Humanoid.Died:connect(function()
  312. aimatpart = nil
  313. end)
  314. end
  315. end
  316. end
  317.  
  318. end
  319. end)
  320. delay(0, function()
  321. while wait(espupdatetime) do
  322. if autoesp == true then
  323. pcall(function()
  324. f.addesp()
  325. end)
  326. end
  327. end
  328. end)
  329. warn("loaded")
  330. end
  331. end
  332. end
  333. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement