MegumuSenpai

War Simulator | Simple AutoFarm

Aug 23rd, 2020 (edited)
24,582
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.36 KB | None | 0 0
  1. -- Globals
  2. num = 0
  3. Terminated = false
  4. Enabled = false
  5. Distance = -25
  6. speed = 100
  7. Equipped = nil
  8.  
  9. -- Variables
  10. local player = game.Players.LocalPlayer
  11.  
  12. -- NoClip
  13. Stepped = game:GetService("RunService").RenderStepped:Connect(function()
  14. if Enabled then
  15. player.Character.Humanoid:ChangeState(11)
  16. end
  17. if Terminated then
  18. Stepped:Disconnect()
  19. end
  20. end)
  21.  
  22. -- Equip
  23. local function equip()
  24. if player.Character and player.Character:FindFirstChildOfClass("Tool") then
  25. local tool = player.Character:FindFirstChildOfClass("Tool")
  26. if Equipped ~= tool.Name then
  27. Equipped = tool.Name
  28. num = 0
  29. end
  30. return tool
  31. elseif player:FindFirstChild("Backpack") and player.Character then
  32. table.foreach(player.Backpack:GetChildren(), function(i,v)
  33. if v:IsA("Tool") and v:FindFirstChild("ToolScript") then
  34. if Equipped ~= v.Name then
  35. Equipped = v.Name
  36. num = 0
  37. end
  38. v.Parent = player.Character
  39. return player.Character:FindFirstChildOfClass("Tool")
  40. end
  41. end)
  42. end
  43. end
  44.  
  45. -- UI Library
  46. local Finity = loadstring(game:HttpGet("http://finity.vip/scripts/finity_lib.lua"))()
  47. local FinityWindow = Finity.new(DarkMode)
  48. FinityWindow.ChangeToggleKey(Enum.KeyCode[Key])
  49.  
  50. -- Categories
  51. local MainFarm = FinityWindow:Category("AutoFarm")
  52. local CreditsCategory = FinityWindow:Category("Credits")
  53.  
  54. -- Credits
  55. local CreditsCreator = CreditsCategory:Sector("Finity Library Creator")
  56. local ScriptCreator = CreditsCategory:Sector("Script Creator")
  57. CreditsCreator:Cheat("Label", "detourious @ v3rmillion.net")
  58. CreditsCreator:Cheat("Label", "deto#7612 @ discord.gg")
  59. ScriptCreator:Cheat("Label", "egg salad @ v3rmillion.net")
  60. ScriptCreator:Cheat("Label", "egg salad#3112 @ discord.gg")
  61. ScriptCreator:Cheat("Label", "Discord Server @ discord.gg/aPg7RQV")
  62.  
  63. -- Main
  64. local MainSec = MainFarm:Sector("Main")
  65. MainSec:Cheat("Checkbox", "Enabled", function(State)
  66. Enabled = State
  67. end)
  68. MainSec:Cheat("Textbox", "Distance", function(Value)
  69. Distance = Value
  70. end)
  71. MainSec:Cheat("Textbox", "Speed", function(Value)
  72. speed = Value
  73. end)
  74. MainSec:Cheat("Button", "Delete GUI", function()
  75. Terminated = true
  76. end,{text="Terminate"})
  77.  
  78. -- Tween Function
  79. function tween(egg, off)
  80. game:GetService("TweenService"):Create(player.Character.HumanoidRootPart, TweenInfo.new(player:DistanceFromCharacter(egg.HumanoidRootPart.Position+Vector3.new(0,off,0))/speed, Enum.EasingStyle.Linear), {CFrame = egg.HumanoidRootPart.CFrame + Vector3.new(0,off,0)}):Play()
  81. wait(player:DistanceFromCharacter(egg.HumanoidRootPart.Position+Vector3.new(0,off,0))/speed)
  82. end
  83.  
  84. -- Get Enemy
  85. function get()
  86. local close
  87. local dist = math.huge
  88. local shid = workspace.MapAreas:GetDescendants()
  89. for i = 1, #shid do local v = shid[i]
  90. if Enabled and not Terminated and v:IsA("Model") and v:FindFirstChild("Humanoid") and v:FindFirstChild("Head") and v:FindFirstChild("HumanoidRootPart") and v.Humanoid.Health > 0 and v:FindFirstChild("data") then
  91. local newDist = player:DistanceFromCharacter(v.HumanoidRootPart.Position)
  92. if newDist < dist then
  93. dist = newDist
  94. close = v
  95. end
  96. end
  97. end
  98. return close
  99. end
  100.  
  101. -- Skeet
  102. while true do
  103. if Enabled and not Terminated then
  104. local v = get()
  105. if not Terminated and Enabled and typeof(v) == "Instance" then
  106. equip()
  107. tween(v, Distance)
  108. repeat
  109. pcall(function()
  110. player.Character.HumanoidRootPart.CFrame = v.HumanoidRootPart.CFrame + Vector3.new(0, Distance, 0)
  111. end)
  112. wait()
  113. pcall(function()
  114. equip():FindFirstChildOfClass("Script"):FindFirstChildOfClass("RemoteEvent"):FireServer(num, "blood", {offset=v.HumanoidRootPart.CFrame,obj=v.Head,damage=v.Humanoid.Health,vectorthing=v.Head.Position,vec2=v.Head.Position,spos=v.Head.Position})
  115. end)
  116. num = num + 1
  117. until Terminated or not Enabled or not v.Parent or v.Humanoid.Health <= 0
  118. end
  119. end
  120. wait(.2)
  121. if Terminated then
  122. game.CoreGui.FinityUI:Destroy()
  123. return
  124. end
  125. end
Add Comment
Please, Sign In to add comment