Upscalefanatic3

(Roblox) Fantastic Frontier Script | Auto-Farm

Mar 24th, 2020
4,539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if game.PlaceId == 510411669 then
  2.     print('Currently Playing "'..game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId).Name..'"')
  3. elseif game.PlaceId == 963149987 then
  4.     game.StarterGui:SetCore("SendNotification", {
  5.         Title = "In the tower";
  6.         Text = "This autofarm only works in the main game!";
  7.         Icon = "rbxassetid://1221422603";
  8.         Duration = 5;
  9.     })
  10.     return
  11. else
  12.     return
  13. end
  14.  
  15. repeat wait() until game:FindFirstChild("Players") ~= nil
  16. repeat wait() until game.Players.LocalPlayer ~= nil
  17.  
  18.  
  19. local autofarm = false
  20. teleporting = false
  21. farmdebounce = false
  22. selling = false
  23. shielddebounce = false
  24. savedebounce = false
  25. locations = {
  26.     entrance = Vector3.new(5857.58838, 156.500061, 4899.37354);
  27.     chest = Vector3.new(12546.7705, 251.514069, -2359.01538);
  28.     exit = Vector3.new(12527.498, 251.514069, -2350.37305);
  29.     sell = Vector3.new(712.656, 227.960, -481.461);
  30. }
  31.  
  32. function goto(pos)
  33.     teleporting = true
  34.     if not game.Workspace.HOLE:FindFirstChild("HoleTPEntrance") then
  35.         repeat
  36.             local prevPos = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
  37.             game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(1304,96,-525)
  38.             wait()
  39.             game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = prevPos
  40.             wait(1)
  41.         until game.Workspace.HOLE:FindFirstChild("HoleTPEntrance")
  42.     end
  43.  
  44.     if (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - pos).magnitude < 200 then
  45.         game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(pos)
  46.         wait(0.3)
  47.         teleporting = false
  48.     else
  49.         local hole = game.Workspace.HOLE.HoleTPEntrance
  50.         local oPos = hole.Position
  51.         local oSize = hole.Size
  52.  
  53.         hole.Size = Vector3.new(1,1,1)
  54.         hole.Transparency = 1
  55.         hole.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
  56.         repeat
  57.             hole.Position = game.Players.LocalPlayer.Character.HumanoidRootPart.Position
  58.             wait()
  59.         until (hole.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude < 10
  60.         hole.Position = oPos
  61.         hole.Size = oSize
  62.         repeat wait() until (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - Vector3.new(430,441,102)).magnitude < 10
  63.         for i=1, 4 do
  64.             game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored = true
  65.             game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(pos)
  66.             wait(0.1)
  67.         end
  68.         wait(0.1)
  69.         game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored = false
  70.         teleporting = false
  71.     end
  72. end
  73.  
  74.  
  75. function sell()
  76.     selling = true
  77.     goto(locations.sell)
  78.     wait()
  79.     repeat wait() until teleporting == false
  80.     wait(0.7)
  81.     for i,v in pairs(game.Players.LocalPlayer.Inventory:GetChildren()) do
  82.         if game.ReplicatedStorage.ItemInfo:FindFirstChild(tostring(v.Value)) then
  83.             if game.ReplicatedStorage.ItemInfo:FindFirstChild(tostring(v.Value)).SellValue.Value >= 10000 then
  84.                 game.ReplicatedStorage.Events.SellShop:FireServer(v.Value, Workspace.Shops.Sellers, 1)
  85.             end
  86.         end
  87.     end
  88.     selling = false
  89. end
  90.  
  91. function togglefarm(toggle)
  92.     if autofarm == true and toggle == nil or autofarm == true and toggle == false then
  93.         autofarm = false
  94.         farmdebounce = false
  95.         sell()
  96.         return
  97.     end
  98.     local key = false
  99.     local foundbigitems = false
  100.     for i,v in pairs(game.Players.LocalPlayer.Inventory:GetChildren()) do
  101.         if game.ReplicatedStorage.ItemInfo:FindFirstChild(tostring(v.Value)) then
  102.             if game.ReplicatedStorage.ItemInfo:FindFirstChild(tostring(v.Value)).FullName.Value == "Hidden Key" then
  103.                 key = true
  104.             end
  105.             if game.ReplicatedStorage.ItemInfo:FindFirstChild(tostring(v.Value)).SellValue.Value >= 10000 then
  106.                 foundbigitems = true
  107.             end
  108.         end
  109.     end
  110.     if key == false then
  111.         game.StarterGui:SetCore("SendNotification", {
  112.             Title = "You need a key!";
  113.             Text = "You need a hidden key to use this autofarm (Get it from the democan boss)";
  114.             Icon = "rbxassetid://1221422603";
  115.             Duration = 5;
  116.         })
  117.         return
  118.     elseif foundbigitems == true then
  119.         game.StarterGui:SetCore("SendNotification", {
  120.             Title = "Items worth 10k+";
  121.             Text = "Please sell or store any items you have worth 10k+ gold before using the autofarm (You can use the :sell command to sell items worth 10k+)";
  122.             Icon = "rbxassetid://1221422603";
  123.             Duration = 5;
  124.         })
  125.         return
  126.     end
  127.     if game.Workspace:FindFirstChild("GuttermouthChest") then
  128.         game.Workspace.Guttermouth["GuttermouthRoom4"].ClaimRewards:InvokeServer()
  129.     end
  130.     wait(0.3)
  131.     autofarm = true
  132. end
  133.  
  134.  
  135. game.Players.LocalPlayer.Chatted:Connect(function(msg)
  136.     local lower = string.lower(msg)
  137.     if string.find(lower, ":autofarm") or string.find(lower, "/e autofarm") then
  138.         if string.sub(lower, #lower - 2, -1) == "off" then
  139.             togglefarm(false)
  140.         elseif string.sub(lower, #lower - 2, -1) == " on" then
  141.             togglefarm()
  142.         end
  143.     end
  144.     if lower == ":sell" or lower == "/e sell" or lower == "/e :sell" then
  145.         sell()
  146.     end
  147. end)
  148.        
  149.  
  150. game:GetService("RunService").Stepped:Connect(function()
  151.     if autofarm == true and game.Workspace.Guttermouth.GuttermouthRoom4.Monsters:FindFirstChild("PhantomKnightNPC") and selling == false then
  152.         for _,v in pairs(game.Workspace.Guttermouth.GuttermouthRoom4.Monsters.PhantomKnightNPC:GetChildren()) do
  153.             if (v:IsA("Humanoid")) then
  154.                 v.Health = 0
  155.             end
  156.         end
  157.     end
  158.     if autofarm == true and farmdebounce == false then
  159.         farmdebounce = true
  160.         goto(locations.entrance)
  161.         wait()
  162.         repeat wait() until teleporting == false
  163.         game.Workspace.CurrentCamera.CFrame = CFrame.new(game.Workspace.CurrentCamera.CFrame.p, game.Workspace.Guttermouth["Door_GuttermouthPhantom (Hidden Key)"].DoorBrick.CFrame.p)
  164.         wait(0.7)
  165.         if autofarm == false then
  166.             return
  167.         end
  168.         for i = 1,3 do
  169.             game.Workspace.Guttermouth["Door_GuttermouthPhantom (Hidden Key)"].InteractEvent:FireServer()
  170.         end
  171.         repeat wait() until game.Workspace:FindFirstChild("GuttermouthChest")
  172.         repeat wait() until game.Workspace.GuttermouthChest:FindFirstChild("HeaxgonPart")
  173.         repeat wait() until game.Workspace.GuttermouthChest:FindFirstChild("InteractEvent")
  174.         if autofarm == false then
  175.             return
  176.         end
  177.         goto(locations.chest)
  178.         wait()
  179.         repeat wait() until teleporting == false
  180.         game.Workspace.CurrentCamera.CFrame = CFrame.new(game.Workspace.CurrentCamera.CFrame.p, game.Workspace.GuttermouthChest.HeaxgonPart.CFrame.p)
  181.         wait(0.7)
  182.         for i = 1,3 do
  183.             game.Workspace.GuttermouthChest:FindFirstChild("InteractEvent"):Fire()
  184.         end
  185.         if autofarm == false then
  186.             return
  187.         end
  188.         goto(locations.exit)
  189.         wait()
  190.         repeat wait() until teleporting == false
  191.         game.Workspace.CurrentCamera.CFrame = CFrame.new(game.Workspace.CurrentCamera.CFrame.p, game.Workspace.Guttermouth.GuttermouthRoom4.GutterExit.PP.CFrame.p)
  192.         wait(0.7)
  193.         if autofarm == false then
  194.             return
  195.         end
  196.         for i = 1,3 do
  197.             game.Workspace.Guttermouth.GuttermouthRoom4.GutterExit.InteractEvent:FireServer()
  198.         end
  199.         wait(1)
  200.         if autofarm == false then
  201.             return
  202.         end
  203.         if game.Players.LocalPlayer.Inventory.S20.Value ~= 0 then
  204.             sell()
  205.         end
  206.         farmdebounce = false
  207.     end
  208. end)
  209.  
  210. local shield = Instance.new("Part", game.Workspace)
  211. shield.Position = Vector3.new(431.08197, 356.23465, 102.730209)
  212. shield.Size = Vector3.new(15, 5, 12)
  213. shield.Transparency = 1
  214. shield.Anchored = true
  215. shield.CanCollide = false
  216. shield.Touched:Connect(function(part)
  217.     if shielddebounce == false then
  218.         shielddebounce = true
  219.         local model = part:FindFirstAncestorWhichIsA("Model")
  220.         if not game.Players:FindFirstChild(model.Name) and string.find(string.lower(model.Name), "npc") then
  221.             for i,v in pairs(model:GetDescendants()) do
  222.                 if v:IsA("Humanoid") then
  223.                     v.Health = 0
  224.                 end
  225.             end
  226.         end
  227.         shielddebounce = false
  228.     end
  229. end)
  230.  
  231.  
  232. local save = Instance.new("Part", game.Workspace)
  233. save.Position = Vector3.new(431.08197, 356.23465, 102.730209)
  234. save.Size = Vector3.new(15, 5, 12)
  235. save.Transparency = 0
  236. save.Anchored = true
  237. save.CanCollide = false
  238. save.Touched:Connect(function(part)
  239.     if savedebounce == false then
  240.         savedebounce = true
  241.         if part:FindFirstAncestor(game.Players.LocalPlayer.Name) then
  242.             togglefarm(false)
  243.         end
  244.         wait(3)
  245.         repeat wait() until selling == false
  246.         togglefarm()
  247.         savedebounce = false
  248.     end
  249. end)
  250.  
  251. local creditsdab = Instance.new("ScreenGui")
  252. local Frame = Instance.new("Frame")
  253. local aidez = Instance.new("ImageLabel")
  254. local names = Instance.new("TextLabel")
  255. local scriptmadeby = Instance.new("TextLabel")
  256.  
  257. creditsdab.Name = "creditsdab"
  258. creditsdab.Parent = game.CoreGui
  259.  
  260. Frame.Parent = creditsdab
  261. Frame.BackgroundColor3 = Color3.new(1, 1, 1)
  262. Frame.Position = UDim2.new(0.399554282, 0, 0.241054624, 0)
  263. Frame.Size = UDim2.new(0, 274, 0, 274)
  264.  
  265. aidez.Name = "aidez"
  266. aidez.Parent = Frame
  267. aidez.BackgroundColor3 = Color3.new(1, 1, 1)
  268. aidez.BorderColor3 = Color3.new(0.117647, 0.117647, 0.117647)
  269. aidez.Position = UDim2.new(-0.000740621239, 0, 0.000178694725, 0)
  270. aidez.Size = UDim2.new(0, 274, 0, 274)
  271. aidez.Image = "rbxassetid://0&hash=9c3f6c00707d5ebde710fd2f3efd2b5e"
  272.  
  273. names.Name = "names"
  274. names.Parent = Frame
  275. names.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
  276. names.BackgroundTransparency = 0.30000001192093
  277. names.BorderColor3 = Color3.new(0.117647, 0.117647, 0.117647)
  278. names.Position = UDim2.new(0, 0, 0.897810221, 0)
  279. names.Size = UDim2.new(0, 274, 0, 28)
  280. names.Font = Enum.Font.SourceSans
  281. names.Text = "Vortexturize | aidez moi | Aidez "
  282. names.TextColor3 = Color3.new(1, 1, 1)
  283. names.TextSize = 14
  284.  
  285. scriptmadeby.Name = "scriptmadeby"
  286. scriptmadeby.Parent = Frame
  287. scriptmadeby.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
  288. scriptmadeby.BackgroundTransparency = 0.30000001192093
  289. scriptmadeby.BorderColor3 = Color3.new(0.117647, 0.117647, 0.117647)
  290. scriptmadeby.Position = UDim2.new(0, 0, -0.102189779, 0)
  291. scriptmadeby.Size = UDim2.new(0, 274, 0, 28)
  292. scriptmadeby.Font = Enum.Font.SourceSans
  293. scriptmadeby.Text = "Script made by"
  294. scriptmadeby.TextColor3 = Color3.new(1, 1, 1)
  295. scriptmadeby.TextSize = 14
  296.  
  297. while wait(3) do
  298.     creditsdab:Destroy()
  299.     break
  300. end
  301.  
  302. game.StarterGui:SetCore("SendNotification", {
  303.     Title = "Usage:";
  304.     Text = "Say :autofarm on to turn the farm on. Say :autofarm off to turn it off. (Do /e :autofarm for silent commands)";
  305.     Icon = "rbxassetid://2541869220";
  306.     Duration = 10;
  307. })
  308.  
  309. local VirtualUser = game:GetService("VirtualUser")
  310. game.Players.LocalPlayer.Idled:Connect(function()
  311.     VirtualUser:CaptureController()
  312.     VirtualUser:ClickButton2(Vector2.new())
  313. end)
  314.  
  315. -- say ":autofarm on" to turn the autofarm on
  316. -- say ":autofarm off" to turn the autofarm off
  317. -- say ":sell" to sell all your items worth 10k or more (doesn't include equipped items)
Add Comment
Please, Sign In to add comment