Advertisement
_Thanh_Thy_Cute_

Zombie attck auto farm

Jul 16th, 2021
1,154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.13 KB | None | 0 0
  1. --NOT MADE BY SCRIPTFINDER!!!!!!!!!!
  2. -- MADE BY EASY GAMER
  3. -- PLEASE SUBSCRIBE
  4. --NOTE ALL SCRIPTS ARE NOT MINE
  5. --CREDIT TO ALL SCRIPT OWNERS
  6. local ScreenGui = Instance.new("ScreenGui")
  7. local OpenF = Instance.new("Frame")
  8. local OpenB = Instance.new("TextButton")
  9. local MainF = Instance.new("Frame")
  10. local Title = Instance.new("TextLabel")
  11. local AutoFarm = Instance.new("TextButton")
  12. local Noclip = Instance.new("TextButton")
  13. local WalkSpeed = Instance.new("TextButton")
  14. local Close = Instance.new("TextButton")
  15. --Properties:
  16. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  17. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  18. ScreenGui.Parent = game.CoreGui
  19.  
  20. OpenF.Name = "OpenF"
  21. OpenF.Parent = ScreenGui
  22. OpenF.Active = true
  23. OpenF.BackgroundColor3 = Color3.new(0, 0, 0)
  24. OpenF.BackgroundTransparency = 0.40000000596046
  25. OpenF.Position = UDim2.new(0.92768085, 0, 0.626178563, 0)
  26. OpenF.Size = UDim2.new(0, 98, 0, 28)
  27.  
  28. OpenB.Name = "OpenB"
  29. OpenB.Parent = OpenF
  30. OpenB.BackgroundColor3 = Color3.new(1, 1, 1)
  31. OpenB.BackgroundTransparency = 1
  32. OpenB.Position = UDim2.new(0.0102040814, 0, 0.0357142873, 0)
  33. OpenB.Size = UDim2.new(0, 103, 0, 25)
  34. OpenB.Font = Enum.Font.Gotham
  35. OpenB.Text = "Open"
  36. OpenB.TextColor3 = Color3.new(1, 1, 1)
  37. OpenB.TextSize = 14
  38. OpenB.MouseButton1Click:connect(function()
  39. OpenF.Visible = false
  40. MainF.Visible = true
  41. end)
  42.  
  43. MainF.Name = "MainF"
  44. MainF.Parent = ScreenGui
  45. MainF.Active = true
  46. MainF.BackgroundColor3 = Color3.new(0, 0, 0)
  47. MainF.BackgroundTransparency = 0.40000000596046
  48. MainF.Position = UDim2.new(0.369627506, 0, 0.30831641, 0)
  49. MainF.Size = UDim2.new(0, 170, 0, 224)
  50. MainF.Draggable = True
  51.  
  52. Title.Name = "Title"
  53. Title.Parent = MainF
  54. Title.Active = true
  55. Title.BackgroundColor3 = Color3.new(0, 0, 0)
  56. Title.BackgroundTransparency = 0.40000000596046
  57. Title.Size = UDim2.new(0, 170, 0, 30)
  58. Title.Font = Enum.Font.GothamBold
  59. Title.Text = "Attack On Zombies"
  60. Title.TextColor3 = Color3.new(1, 1, 1)
  61. Title.TextSize = 14
  62.  
  63. AutoFarm.Name = "AutoFarm"
  64. AutoFarm.Parent = MainF
  65. AutoFarm.BackgroundColor3 = Color3.new(0, 0, 0)
  66. AutoFarm.BackgroundTransparency = 0.40000000596046
  67. AutoFarm.Position = UDim2.new(0.0588235334, 0, 0.214285731, 0)
  68. AutoFarm.Size = UDim2.new(0, 150, 0, 26)
  69. AutoFarm.Font = Enum.Font.Gotham
  70. AutoFarm.Text = "Auto Farm"
  71. AutoFarm.TextColor3 = Color3.new(1, 1, 1)
  72. AutoFarm.TextSize = 14
  73. AutoFarm.MouseButton1Click:connect(function()
  74. local groundDistance = 8
  75. local Player = game:GetService("Players").LocalPlayer
  76. local function getNearest()
  77. local nearest, dist = nil, 99999
  78. for _,v in pairs(game.Workspace.BossFolder:GetChildren()) do
  79. if(v:FindFirstChild("Head")~=nil)then
  80. local m =(Player.Character.Head.Position-v.Head.Position).magnitude
  81. if(m<dist)then
  82. dist = m
  83. nearest = v
  84. end
  85. end
  86. end
  87. for _,v in pairs(game.Workspace.enemies:GetChildren()) do
  88. if(v:FindFirstChild("Head")~=nil)then
  89. local m =(Player.Character.Head.Position-v.Head.Position).magnitude
  90. if(m<dist)then
  91. dist = m
  92. nearest = v
  93. end
  94. end
  95. end
  96. return nearest
  97. end
  98. _G.farm2 = true
  99. Player.Chatted:Connect(function(m)
  100. if(m==";autofarm false")then
  101. _G.farm2 = false
  102. elseif(m==";autofarm true")then
  103. _G.farm2 = true
  104. end
  105. end)
  106. _G.globalTarget = nil
  107. game:GetService("RunService").RenderStepped:Connect(function()
  108. if(_G.farm2==true)then
  109. local target = getNearest()
  110. if(target~=nil)then
  111. game:GetService("Workspace").CurrentCamera.CFrame = CFrame.new(game:GetService("Workspace").CurrentCamera.CFrame.p, target.Head.Position)
  112. Player.Character.HumanoidRootPart.CFrame = (target.HumanoidRootPart.CFrame * CFrame.new(0, groundDistance, 9))
  113. _G.globalTarget = target
  114. end
  115. end
  116. end)
  117. spawn(function()
  118. while wait() do
  119. game.Players.LocalPlayer.Character.HumanoidRootPart.Velocity = Vector3.new(0,0,0)
  120. game.Players.LocalPlayer.Character.Torso.Velocity = Vector3.new(0,0,0)
  121. end
  122. end)
  123. while wait() do
  124. if(_G.farm2==true and _G.globalTarget~=nil and _G.globalTarget:FindFirstChild("Head") and Player.Character:FindFirstChildOfClass("Tool"))then
  125. local target = _G.globalTarget
  126. 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,})
  127. wait()
  128. end
  129. end
  130. end)
  131.  
  132. Noclip.Name = "Noclip"
  133. Noclip.Parent = MainF
  134. Noclip.BackgroundColor3 = Color3.new(0, 0, 0)
  135. Noclip.BackgroundTransparency = 0.40000000596046
  136. Noclip.Position = UDim2.new(0.0588235334, 0, 0.504464269, 0)
  137. Noclip.Size = UDim2.new(0, 150, 0, 26)
  138. Noclip.Font = Enum.Font.Gotham
  139. Noclip.Text = "Noclip [\"n\"]"
  140. Noclip.TextColor3 = Color3.new(1, 1, 1)
  141. Noclip.TextSize = 14
  142. Noclip.MouseButton1Click:connect(function()
  143. local plr = game:service'Players'.LocalPlayer
  144. local char = plr.Character
  145. local hum = char:FindFirstChildOfClass'Humanoid'
  146. local mouse = plr:GetMouse()
  147. on = false
  148.  
  149. mouse.KeyDown:connect(function(key)
  150. if key == "n" then
  151. if not on then
  152. on = true
  153. elseif on then
  154. on = false
  155. end
  156. end
  157. end)
  158.  
  159. while wait() do
  160. if char then
  161. hum = char:FindFirstChildOfClass'Humanoid'
  162. end
  163. if on then
  164. hum:ChangeState(11)
  165. end
  166. end
  167.  
  168. end)
  169.  
  170. WalkSpeed.Name = "WalkSpeed"
  171. WalkSpeed.Parent = MainF
  172. WalkSpeed.BackgroundColor3 = Color3.new(0, 0, 0)
  173. WalkSpeed.BackgroundTransparency = 0.40000000596046
  174. WalkSpeed.Position = UDim2.new(0.0588235334, 0, 0.8125, 0)
  175. WalkSpeed.Size = UDim2.new(0, 150, 0, 26)
  176. WalkSpeed.Font = Enum.Font.Gotham
  177. WalkSpeed.Text = "Walkspeed"
  178. WalkSpeed.TextColor3 = Color3.new(1, 1, 1)
  179. WalkSpeed.TextSize = 14
  180. WalkSpeed.MouseButton1Click:connect(function()
  181. game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 100
  182. end)
  183.  
  184. Close.Name = "Close"
  185. Close.Parent = MainF
  186. Close.BackgroundColor3 = Color3.new(1, 0, 0.0156863)
  187. Close.BackgroundTransparency = 1
  188. Close.Position = UDim2.new(0.841176391, 0, -0.0223214328, 0)
  189. Close.Size = UDim2.new(0, 27, 0, 39)
  190. Close.Font = Enum.Font.SourceSans
  191. Close.Text = "X"
  192. Close.TextColor3 = Color3.new(1, 0, 0.0156863)
  193. Close.TextSize = 48
  194. Close.MouseButton1Click:connect(function()
  195. MainF.Visible = false
  196. OpenF.Visible = true
  197. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement