Guest User

Zombie attack autofarm etc

a guest
Jan 24th, 2025
2,672
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 17.53 KB | Gaming | 1 0
  1. -- Made by ibrahim Dew --
  2. -- Discord: xi7z#0112 --
  3.  
  4. local ZombieAttackGUI = Instance.new("ScreenGui")
  5. local Main = Instance.new("Frame")
  6. local TextLabel = Instance.new("TextLabel")
  7. local TextLabel_2 = Instance.new("TextLabel")
  8. local Frame = Instance.new("Frame")
  9. local TextLabel_3 = Instance.new("TextLabel")
  10. local ConsoleFrame = Instance.new("Frame")
  11. local Console = Instance.new("TextLabel")
  12. local Frame_2 = Instance.new("Frame")
  13. local TextLabel_4 = Instance.new("TextLabel")
  14. local Frame_3 = Instance.new("Frame")
  15. local TextLabel_5 = Instance.new("TextLabel")
  16. local Frame_4 = Instance.new("Frame")
  17. local TextLabel_6 = Instance.new("TextLabel")
  18. local KillPlatform = Instance.new("TextButton")
  19. local StealKills = Instance.new("TextButton")
  20. local AutoFarm = Instance.new("TextButton")
  21. local NoRecoil = Instance.new("TextButton")
  22. local Guns = Instance.new("TextButton")
  23. local Knifes = Instance.new("TextButton")
  24. local Fly = Instance.new("TextButton")
  25. local Noclip = Instance.new("TextButton")
  26. local Gravity = Instance.new("TextButton")
  27. local Speed = Instance.new("TextButton")
  28. local Jump = Instance.new("TextButton")
  29. local Btools = Instance.new("TextButton")
  30.  
  31. ZombieAttackGUI.Name = "Zombie Attack GUI"
  32. ZombieAttackGUI.Parent = game.CoreGui
  33. ZombieAttackGUI.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  34.  
  35. Main.Name = "Main"
  36. Main.Parent = ZombieAttackGUI
  37. Main.BackgroundColor3 = Color3.new(0.247059, 0, 0.372549)
  38. Main.BackgroundTransparency = 0.15000000596046
  39. Main.BorderSizePixel = 0
  40. Main.Position = UDim2.new(0.794708014, 0, 0, 0)
  41. Main.Size = UDim2.new(0.191605836, 0, 1, 0)
  42.  
  43. TextLabel.Parent = Main
  44. TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  45. TextLabel.BackgroundTransparency = 1
  46. TextLabel.BorderSizePixel = 0
  47. TextLabel.Position = UDim2.new(0.0768115819, 0, 0.068296887, 0)
  48. TextLabel.Size = UDim2.new(0.842857122, 0, 0.0322580636, 0)
  49. TextLabel.Font = Enum.Font.SourceSansSemibold
  50. TextLabel.Text = "Made by ibrahim Dew"
  51. TextLabel.TextColor3 = Color3.new(1, 1, 1)
  52. TextLabel.TextScaled = true
  53. TextLabel.TextSize = 14
  54. TextLabel.TextWrapped = true
  55.  
  56. TextLabel_2.Parent = Main
  57. TextLabel_2.BackgroundColor3 = Color3.new(1, 1, 1)
  58. TextLabel_2.BackgroundTransparency = 1
  59. TextLabel_2.BorderSizePixel = 0
  60. TextLabel_2.Position = UDim2.new(0.0434782468, 0, 0.0118953418, 0)
  61. TextLabel_2.Size = UDim2.new(0.90476191, 0, 0.0569259971, 0)
  62. TextLabel_2.Font = Enum.Font.SourceSansSemibold
  63. TextLabel_2.Text = "Zombie Attack Menu"
  64. TextLabel_2.TextColor3 = Color3.new(1, 1, 1)
  65. TextLabel_2.TextScaled = true
  66. TextLabel_2.TextSize = 14
  67. TextLabel_2.TextWrapped = true
  68.  
  69. Frame.Parent = Main
  70. Frame.BackgroundColor3 = Color3.new(0.0156863, 0.0156863, 0.0156863)
  71. Frame.BackgroundTransparency = 0.5
  72. Frame.BorderSizePixel = 0
  73. Frame.Position = UDim2.new(0, 0, 0.111954458, 0)
  74. Frame.Size = UDim2.new(1, 0, 0.0417457297, 0)
  75.  
  76. TextLabel_3.Parent = Frame
  77. TextLabel_3.BackgroundColor3 = Color3.new(1, 1, 1)
  78. TextLabel_3.BackgroundTransparency = 1
  79. TextLabel_3.BorderSizePixel = 0
  80. TextLabel_3.Position = UDim2.new(0.0434782468, 0, 0.181818187, 0)
  81. TextLabel_3.Size = UDim2.new(0.90476191, 0, 0.590909064, 0)
  82. TextLabel_3.Font = Enum.Font.SourceSansSemibold
  83. TextLabel_3.Text = "Console"
  84. TextLabel_3.TextColor3 = Color3.new(1, 1, 1)
  85. TextLabel_3.TextScaled = true
  86. TextLabel_3.TextSize = 14
  87. TextLabel_3.TextWrapped = true
  88. TextLabel_3.TextXAlignment = Enum.TextXAlignment.Left
  89.  
  90. ConsoleFrame.Name = "ConsoleFrame"
  91. ConsoleFrame.Parent = Main
  92. ConsoleFrame.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  93. ConsoleFrame.BackgroundTransparency = 0.5
  94. ConsoleFrame.BorderSizePixel = 0
  95. ConsoleFrame.Position = UDim2.new(0, 0, 0.153700188, 0)
  96. ConsoleFrame.Size = UDim2.new(1, 0, 0.0967741907, 0)
  97.  
  98. Console.Name = "Console"
  99. Console.Parent = ConsoleFrame
  100. Console.BackgroundColor3 = Color3.new(1, 1, 1)
  101. Console.BackgroundTransparency = 1
  102. Console.BorderSizePixel = 0
  103. Console.Position = UDim2.new(0.0387163423, 0, 0.117647059, 0)
  104. Console.Size = UDim2.new(0.909523785, 0, 0.764705896, 0)
  105. Console.Font = Enum.Font.SourceSans
  106. Console.Text = "Status: Ready to use\n\n"
  107. Console.TextColor3 = Color3.new(0.333333, 1, 0)
  108. Console.TextScaled = true
  109. Console.TextSize = 14
  110. Console.TextWrapped = true
  111. Console.TextXAlignment = Enum.TextXAlignment.Left
  112. Console.TextYAlignment = Enum.TextYAlignment.Top
  113.  
  114. Frame_2.Parent = Main
  115. Frame_2.BackgroundColor3 = Color3.new(0.0156863, 0.0156863, 0.0156863)
  116. Frame_2.BackgroundTransparency = 0.5
  117. Frame_2.BorderSizePixel = 0
  118. Frame_2.Position = UDim2.new(0, 0, 0.250474393, 0)
  119. Frame_2.Size = UDim2.new(0.995238066, 0, 0.0417457297, 0)
  120.  
  121. TextLabel_4.Parent = Frame_2
  122. TextLabel_4.BackgroundColor3 = Color3.new(1, 1, 1)
  123. TextLabel_4.BackgroundTransparency = 1
  124. TextLabel_4.BorderSizePixel = 0
  125. TextLabel_4.Position = UDim2.new(0.0482401513, 0, 0.181818187, 0)
  126. TextLabel_4.Size = UDim2.new(0.904306233, 0, 0.590909064, 0)
  127. TextLabel_4.Font = Enum.Font.SourceSansSemibold
  128. TextLabel_4.Text = "Main Mods"
  129. TextLabel_4.TextColor3 = Color3.new(1, 1, 1)
  130. TextLabel_4.TextScaled = true
  131. TextLabel_4.TextSize = 14
  132. TextLabel_4.TextWrapped = true
  133. TextLabel_4.TextXAlignment = Enum.TextXAlignment.Left
  134.  
  135. Frame_3.Parent = Main
  136. Frame_3.BackgroundColor3 = Color3.new(0.0156863, 0.0156863, 0.0156863)
  137. Frame_3.BackgroundTransparency = 0.5
  138. Frame_3.BorderSizePixel = 0
  139. Frame_3.Position = UDim2.new(0, 0, 0.455407977, 0)
  140. Frame_3.Size = UDim2.new(1, 0, 0.0417457297, 0)
  141.  
  142. TextLabel_5.Parent = Frame_3
  143. TextLabel_5.BackgroundColor3 = Color3.new(1, 1, 1)
  144. TextLabel_5.BackgroundTransparency = 1
  145. TextLabel_5.BorderSizePixel = 0
  146. TextLabel_5.Position = UDim2.new(0.0434782468, 0, 0.181818187, 0)
  147. TextLabel_5.Size = UDim2.new(0.90476191, 0, 0.590909064, 0)
  148. TextLabel_5.Font = Enum.Font.SourceSansSemibold
  149. TextLabel_5.Text = "Weapon Mods"
  150. TextLabel_5.TextColor3 = Color3.new(1, 1, 1)
  151. TextLabel_5.TextScaled = true
  152. TextLabel_5.TextSize = 14
  153. TextLabel_5.TextWrapped = true
  154. TextLabel_5.TextXAlignment = Enum.TextXAlignment.Left
  155.  
  156. Frame_4.Parent = Main
  157. Frame_4.BackgroundColor3 = Color3.new(0.0156863, 0.0156863, 0.0156863)
  158. Frame_4.BackgroundTransparency = 0.5
  159. Frame_4.BorderSizePixel = 0
  160. Frame_4.Position = UDim2.new(0, 0, 0.65464896, 0)
  161. Frame_4.Size = UDim2.new(0.995238066, 0, 0.0417457297, 0)
  162.  
  163. TextLabel_6.Parent = Frame_4
  164. TextLabel_6.BackgroundColor3 = Color3.new(1, 1, 1)
  165. TextLabel_6.BackgroundTransparency = 1
  166. TextLabel_6.BorderSizePixel = 0
  167. TextLabel_6.Position = UDim2.new(0.0482401513, 0, 0.18181771, 0)
  168. TextLabel_6.Size = UDim2.new(0.909090936, 0, 0.590909064, 0)
  169. TextLabel_6.Font = Enum.Font.SourceSansSemibold
  170. TextLabel_6.Text = "Local Player Mods"
  171. TextLabel_6.TextColor3 = Color3.new(1, 1, 1)
  172. TextLabel_6.TextScaled = true
  173. TextLabel_6.TextSize = 14
  174. TextLabel_6.TextWrapped = true
  175. TextLabel_6.TextXAlignment = Enum.TextXAlignment.Left
  176.  
  177. KillPlatform.Name = "KillPlatform"
  178. KillPlatform.Parent = Main
  179. KillPlatform.BackgroundColor3 = Color3.new(1, 1, 1)
  180. KillPlatform.BackgroundTransparency = 1
  181. KillPlatform.Position = UDim2.new(0.0434782468, 0, 0.309297919, 0)
  182. KillPlatform.Size = UDim2.new(0.90476191, 0, 0.034155596, 0)
  183. KillPlatform.Font = Enum.Font.SourceSansSemibold
  184. KillPlatform.Text = "Kill Platform "
  185. KillPlatform.TextColor3 = Color3.new(1, 1, 1)
  186. KillPlatform.TextScaled = true
  187. KillPlatform.TextSize = 14
  188. KillPlatform.TextWrapped = true
  189. KillPlatform.TextXAlignment = Enum.TextXAlignment.Left
  190.  
  191. StealKills.Name = "StealKills"
  192. StealKills.Parent = Main
  193. StealKills.BackgroundColor3 = Color3.new(1, 1, 1)
  194. StealKills.BackgroundTransparency = 1
  195. StealKills.Position = UDim2.new(0.0434782468, 0, 0.354838729, 0)
  196. StealKills.Size = UDim2.new(0.90476191, 0, 0.034155596, 0)
  197. StealKills.Font = Enum.Font.SourceSansSemibold
  198. StealKills.Text = "Steal Kills"
  199. StealKills.TextColor3 = Color3.new(1, 1, 1)
  200. StealKills.TextScaled = true
  201. StealKills.TextSize = 14
  202. StealKills.TextWrapped = true
  203. StealKills.TextXAlignment = Enum.TextXAlignment.Left
  204.  
  205. AutoFarm.Name = "AutoFarm"
  206. AutoFarm.Parent = Main
  207. AutoFarm.BackgroundColor3 = Color3.new(1, 1, 1)
  208. AutoFarm.BackgroundTransparency = 1
  209. AutoFarm.Position = UDim2.new(0.0434782468, 0, 0.400379539, 0)
  210. AutoFarm.Size = UDim2.new(0.90476191, 0, 0.034155596, 0)
  211. AutoFarm.Font = Enum.Font.SourceSansSemibold
  212. AutoFarm.Text = "Auto Farm"
  213. AutoFarm.TextColor3 = Color3.new(1, 1, 1)
  214. AutoFarm.TextScaled = true
  215. AutoFarm.TextSize = 14
  216. AutoFarm.TextWrapped = true
  217. AutoFarm.TextXAlignment = Enum.TextXAlignment.Left
  218.  
  219. NoRecoil.Name = "NoRecoil"
  220. NoRecoil.Parent = Main
  221. NoRecoil.BackgroundColor3 = Color3.new(1, 1, 1)
  222. NoRecoil.BackgroundTransparency = 1
  223. NoRecoil.Position = UDim2.new(0.0434782468, 0, 0.510436416, 0)
  224. NoRecoil.Size = UDim2.new(0.90476191, 0, 0.034155596, 0)
  225. NoRecoil.Font = Enum.Font.SourceSansSemibold
  226. NoRecoil.Text = "No Recoil"
  227. NoRecoil.TextColor3 = Color3.new(1, 1, 1)
  228. NoRecoil.TextScaled = true
  229. NoRecoil.TextSize = 14
  230. NoRecoil.TextWrapped = true
  231. NoRecoil.TextXAlignment = Enum.TextXAlignment.Left
  232.  
  233. Guns.Name = "Guns"
  234. Guns.Parent = Main
  235. Guns.BackgroundColor3 = Color3.new(1, 1, 1)
  236. Guns.BackgroundTransparency = 1
  237. Guns.Position = UDim2.new(0.0434782468, 0, 0.555977225, 0)
  238. Guns.Size = UDim2.new(0.90476191, 0, 0.034155596, 0)
  239. Guns.Font = Enum.Font.SourceSansSemibold
  240. Guns.Text = "Equip All Guns"
  241. Guns.TextColor3 = Color3.new(1, 1, 1)
  242. Guns.TextScaled = true
  243. Guns.TextSize = 14
  244. Guns.TextWrapped = true
  245. Guns.TextXAlignment = Enum.TextXAlignment.Left
  246.  
  247. Knifes.Name = "Knifes"
  248. Knifes.Parent = Main
  249. Knifes.BackgroundColor3 = Color3.new(1, 1, 1)
  250. Knifes.BackgroundTransparency = 1
  251. Knifes.Position = UDim2.new(0.0434782468, 0, 0.603415549, 0)
  252. Knifes.Size = UDim2.new(0.90476191, 0, 0.034155596, 0)
  253. Knifes.Font = Enum.Font.SourceSansSemibold
  254. Knifes.Text = "Equip All Knifes "
  255. Knifes.TextColor3 = Color3.new(1, 1, 1)
  256. Knifes.TextScaled = true
  257. Knifes.TextSize = 14
  258. Knifes.TextWrapped = true
  259. Knifes.TextXAlignment = Enum.TextXAlignment.Left
  260.  
  261. Fly.Name = "Fly"
  262. Fly.Parent = Main
  263. Fly.BackgroundColor3 = Color3.new(1, 1, 1)
  264. Fly.BackgroundTransparency = 1
  265. Fly.Position = UDim2.new(0.0434782468, 0, 0.709677398, 0)
  266. Fly.Size = UDim2.new(0.90476191, 0, 0.034155596, 0)
  267. Fly.Font = Enum.Font.SourceSansSemibold
  268. Fly.Text = "Toggle Flying Mode"
  269. Fly.TextColor3 = Color3.new(1, 1, 1)
  270. Fly.TextScaled = true
  271. Fly.TextSize = 14
  272. Fly.TextWrapped = true
  273. Fly.TextXAlignment = Enum.TextXAlignment.Left
  274.  
  275. Noclip.Name = "Noclip"
  276. Noclip.Parent = Main
  277. Noclip.BackgroundColor3 = Color3.new(1, 1, 1)
  278. Noclip.BackgroundTransparency = 1
  279. Noclip.Position = UDim2.new(0.0434782468, 0, 0.755218208, 0)
  280. Noclip.Size = UDim2.new(0.90476191, 0, 0.034155596, 0)
  281. Noclip.Font = Enum.Font.SourceSansSemibold
  282. Noclip.Text = "Toggle NoClip"
  283. Noclip.TextColor3 = Color3.new(1, 1, 1)
  284. Noclip.TextScaled = true
  285. Noclip.TextSize = 14
  286. Noclip.TextWrapped = true
  287. Noclip.TextXAlignment = Enum.TextXAlignment.Left
  288.  
  289. Gravity.Name = "Gravity"
  290. Gravity.Parent = Main
  291. Gravity.BackgroundColor3 = Color3.new(1, 1, 1)
  292. Gravity.BackgroundTransparency = 1
  293. Gravity.Position = UDim2.new(0.0387163423, 0, 0.802656531, 0)
  294. Gravity.Size = UDim2.new(0.90476191, 0, 0.034155596, 0)
  295. Gravity.Font = Enum.Font.SourceSansSemibold
  296. Gravity.Text = "Low Gravity"
  297. Gravity.TextColor3 = Color3.new(1, 1, 1)
  298. Gravity.TextScaled = true
  299. Gravity.TextSize = 14
  300. Gravity.TextWrapped = true
  301. Gravity.TextXAlignment = Enum.TextXAlignment.Left
  302.  
  303. Speed.Name = "Speed"
  304. Speed.Parent = Main
  305. Speed.BackgroundColor3 = Color3.new(1, 1, 1)
  306. Speed.BackgroundTransparency = 1
  307. Speed.Position = UDim2.new(0.0387163423, 0, 0.851992369, 0)
  308. Speed.Size = UDim2.new(0.90476191, 0, 0.034155596, 0)
  309. Speed.Font = Enum.Font.SourceSansSemibold
  310. Speed.Text = "Super Speed"
  311. Speed.TextColor3 = Color3.new(1, 1, 1)
  312. Speed.TextScaled = true
  313. Speed.TextSize = 14
  314. Speed.TextWrapped = true
  315. Speed.TextXAlignment = Enum.TextXAlignment.Left
  316.  
  317. Jump.Name = "Jump"
  318. Jump.Parent = Main
  319. Jump.BackgroundColor3 = Color3.new(1, 1, 1)
  320. Jump.BackgroundTransparency = 1
  321. Jump.Position = UDim2.new(0.0434782468, 0, 0.899430692, 0)
  322. Jump.Size = UDim2.new(0.90476191, 0, 0.034155596, 0)
  323. Jump.Font = Enum.Font.SourceSansSemibold
  324. Jump.Text = "Super Jump"
  325. Jump.TextColor3 = Color3.new(1, 1, 1)
  326. Jump.TextScaled = true
  327. Jump.TextSize = 14
  328. Jump.TextWrapped = true
  329. Jump.TextXAlignment = Enum.TextXAlignment.Left
  330.  
  331. Btools.Name = "Btools"
  332. Btools.Parent = Main
  333. Btools.BackgroundColor3 = Color3.new(1, 1, 1)
  334. Btools.BackgroundTransparency = 1
  335. Btools.Position = UDim2.new(0.0434782468, 0, 0.946869016, 0)
  336. Btools.Size = UDim2.new(0.90476191, 0, 0.034155596, 0)
  337. Btools.Font = Enum.Font.SourceSansSemibold
  338. Btools.Text = "B-Tools"
  339. Btools.TextColor3 = Color3.new(1, 1, 1)
  340. Btools.TextScaled = true
  341. Btools.TextSize = 14
  342. Btools.TextWrapped = true
  343. Btools.TextXAlignment = Enum.TextXAlignment.Left
  344. -- scripts
  345. Fly.MouseButton1Click:Connect(function()
  346. Console.Text = ("Press E to activate and deactivate flying mode\n\n ")
  347. wait(0.2)
  348. loadstring(game:HttpGet(('https://pastebin.com/raw/7rXZ9VNc'),true))()
  349. wait(5)
  350. Console.Text = ("Status: Ready To Use\n\n")
  351. end)
  352.  
  353. Noclip.MouseButton1Click:connect(function()
  354. if Console.Text == "Toggle NoClip" then
  355. noclip = true
  356. Console.Text = "Toggle NoClip: On"
  357.         Console.TextColor3 = Color3.new(0,185,0)
  358. game:GetService('RunService').Stepped:connect(function()
  359. if noclip then
  360. game.Players.LocalPlayer.Character.Humanoid:ChangeState(11)
  361.                  end
  362.         end)
  363.     elseif Console.Text == "Toggle NoClip: On" then
  364.         noclip = false
  365.         Console.Text = "Toggle NoClip: Off"
  366.         Console.TextColor3 = Color3.new(170,0,0)
  367. elseif Console.Text == "Toggle NoClip: On" then
  368.     noclip = true
  369. Console.Text = "Toggle NoClip: On"
  370.         Console.TextColor3 = Color3.new(0,185,0)
  371.     end
  372. end)
  373.  
  374. Knifes.MouseButton1Click:connect(function()
  375.     for _,Thing in pairs(game.ReplicatedStorage.Knives:GetChildren()) do
  376. if Thing:IsA("Tool") then
  377. Thing.Parent = game.Players.LocalPlayer.Backpack
  378. end
  379. end
  380. end)
  381.  
  382. Guns.MouseButton1Click:connect(function()
  383.     for _,Thing in pairs(game.ReplicatedStorage.Guns:GetChildren()) do
  384. if Thing:IsA("Tool") then
  385. Thing.Parent = game.Players.LocalPlayer.Backpack
  386. end
  387. end
  388. end)
  389.  
  390. KillPlatform.MouseButton1Click:connect(function()
  391.     plr = game:service'Players'.LocalPlayer
  392. char = plr.Character
  393. root = char.HumanoidRootPart
  394. iszombie = false
  395.  
  396. platform = Instance.new('Part', workspace)
  397. platform.Size = Vector3.new(100,0,100)
  398. platform.Anchored = true
  399. platform.Position = Vector3.new(555,555,555)
  400. root.CFrame = platform.CFrame * CFrame.new(0,4,0)
  401.  
  402. if workspace:FindFirstChild(plr.Name) then
  403.    iszombie = false
  404.    warn'You are not a zombie!'
  405. else
  406.    iszombie = true
  407.    warn'You are a zombie!'
  408. end
  409.  
  410. wait(.5)
  411.  
  412. if not iszombie then
  413.    for _, a in pairs(workspace.enemies:children()) do
  414.        for _, b in pairs(a:children()) do
  415.            if b:IsA'Part' then
  416.                b.Anchored = true
  417.                b.CFrame = root.CFrame * CFrame.new(2,0,2)
  418.            end
  419.        end
  420.    end
  421. elseif iszombie then
  422.    for _, a in pairs(game:service'Players':GetPlayers()) do
  423.        if a.Character then
  424.            for _, b in pairs(a.Character:children()) do
  425.                if b:IsA'Part' and a.Name ~= plr.Name then
  426.                    b.Anchored = true
  427.                    b.CFrame =  root.CFrame * CFrame.new(2,0,2)
  428.                end
  429.            end
  430.        end
  431.    end
  432. end
  433. end)
  434.  
  435. Speed.MouseButton1Click:connect(function()
  436.     plr = game:service'Players'.LocalPlayer
  437. char = plr.Character
  438. hum = char:FindFirstChildOfClass'Humanoid'
  439.  
  440. hum.WalkSpeed = 60
  441.    
  442. end)
  443.  
  444. Jump.MouseButton1Click:connect(function()
  445.     plr = game:service'Players'.LocalPlayer
  446. char = plr.Character
  447. hum = char:FindFirstChildOfClass'Humanoid'
  448.  
  449. hum.JumpPower = 100
  450. end)
  451.  
  452. AutoFarm.MouseButton1Click:connect(function()
  453.     local groundDistance = 8
  454. local Player = game:GetService("Players").LocalPlayer
  455. local function getNearest()
  456. local nearest, dist = nil, 99999
  457. for _,v in pairs(game.Workspace.BossFolder:GetChildren()) do
  458. if(v:FindFirstChild("Head")~=nil)then
  459. local m =(Player.Character.Head.Position-v.Head.Position).magnitude
  460. if(m<dist)then
  461. dist = m
  462. nearest = v
  463. end
  464. end
  465. end
  466. for _,v in pairs(game.Workspace.enemies:GetChildren()) do
  467. if(v:FindFirstChild("Head")~=nil)then
  468. local m =(Player.Character.Head.Position-v.Head.Position).magnitude
  469. if(m<dist)then
  470. dist = m
  471. nearest = v
  472. end
  473. end
  474. end
  475. return nearest
  476. end
  477. _G.farm2 = true
  478. Player.Chatted:Connect(function(m)
  479. if(m==";autofarm false")then
  480. _G.farm2 = false
  481. elseif(m==";autofarm true")then
  482. _G.farm2 = true
  483. end
  484. end)
  485. _G.globalTarget = nil
  486. game:GetService("RunService").RenderStepped:Connect(function()
  487. if(_G.farm2==true)then
  488. local target = getNearest()
  489. if(target~=nil)then
  490. game:GetService("Workspace").CurrentCamera.CFrame = CFrame.new(game:GetService("Workspace").CurrentCamera.CFrame.p, target.Head.Position)
  491. Player.Character.HumanoidRootPart.CFrame = (target.HumanoidRootPart.CFrame * CFrame.new(0, groundDistance, 9))
  492. _G.globalTarget = target
  493. end
  494. end
  495. end)
  496. spawn(function()
  497. while wait() do
  498. game.Players.LocalPlayer.Character.HumanoidRootPart.Velocity = Vector3.new(0,0,0)
  499. game.Players.LocalPlayer.Character.Torso.Velocity = Vector3.new(0,0,0)
  500. end
  501. end)
  502. while wait() do
  503. if(_G.farm2==true and _G.globalTarget~=nil and _G.globalTarget:FindFirstChild("Head") and Player.Character:FindFirstChildOfClass("Tool"))then
  504. local target = _G.globalTarget
  505. game.ReplicatedStorage.Gun:FireServer({["Normal"] = Vector3.new(0, 0, 0), ["Direction"] = target.Head.Position, ["Name"] = Player.Character:FindFirstChildOfClass("Tool").Name, ["Hit"] = target.Head, ["Origin"] = target.Head.Position, ["Pos"] = target.Head.Position,})
  506. wait()
  507. end
  508. end
  509. end)
  510.  
  511. Btools.MouseButton1Click:connect(function()
  512.     loadstring(game:HttpGet("https://pastebin.com/raw/T0qaXjAR", true))()
  513. end)
  514.  
  515. Gravity.MouseButton1Click:connect(function()
  516.     game.Workspace.Gravity = 5
  517. end)
Advertisement
Add Comment
Please, Sign In to add comment