Advertisement
Cizzy

Untitled

Mar 14th, 2021
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. -- // Custom Settings
  2. getgenv().TreasureAutoFarm = {
  3. Enabled = true, -- // Toggle the auto farm on and off
  4. Teleport = 2, -- // How fast between each teleport between the stages and stuff
  5. ClaimGold = 2, -- // How long to wait until it claims the gold after going through all of the stages
  6. }
  7.  
  8. -- // Services
  9. local Players = game:GetService("Players")
  10. local Workspace = game:GetService("Workspace")
  11. local Lighting = game:GetService("Lighting")
  12.  
  13. -- // Vars
  14. local LocalPlayer = Players.LocalPlayer
  15. local ClaimFunction
  16. local InstaLoadFunction = Workspace.InstaLoadFunction
  17.  
  18. -- // Get the claim function
  19. do
  20. local gGC = getgc()
  21. for i = 1, #gGC do
  22. local v = gGC[i]
  23. local fScript = getfenv(v).script
  24.  
  25. if (debug.getinfo(v).name == "claim" and fScript.Parent) then
  26. ClaimFunction = v
  27. end
  28. end
  29. end
  30.  
  31. -- // Create a temp part under you
  32. local createTempPart = function()
  33. local Part = Instance.new("Part", LocalPlayer.Character)
  34. Part.Anchored = true
  35. Part.Position = LocalPlayer.Character.HumanoidRootPart.Position - Vector3.new(0, 3, 0)
  36.  
  37. return Part
  38. end
  39.  
  40. -- // Goes through all of the stages
  41. local walkthrough = function()
  42. -- // Claim gold (if you have any to get)
  43. ClaimFunction()
  44.  
  45. -- // Variables
  46. local Character = LocalPlayer.Character
  47. local NormalStages = Workspace.BoatStages.NormalStages
  48.  
  49. -- // Go to each stage thing
  50. do
  51. local Stages = NormalStages:GetChildren()
  52. for i = 1, #Stages do
  53. local Stage = Stages[i]
  54. local DarknessPart = Stage:FindFirstChild("DarknessPart")
  55.  
  56. if (DarknessPart) then
  57. Character.HumanoidRootPart.CFrame = DarknessPart.CFrame
  58.  
  59. local Part = createTempPart()
  60. wait(getgenv().TreasureAutoFarm.Teleport)
  61. Part:Destroy()
  62. end
  63. end
  64. end
  65.  
  66. -- // Go to end
  67. repeat wait()
  68. Character.HumanoidRootPart.CFrame = NormalStages.TheEnd.GoldenChest.Trigger.CFrame
  69. until Lighting.ClockTime ~= 14
  70.  
  71. -- // Instant Die
  72. wait(getgenv().TreasureAutoFarm.ClaimGold)
  73. InstaLoadFunction:InvokeServer(nil, true)
  74. LocalPlayer.CharacterAdded:Wait()
  75.  
  76. -- // Claim gold (if you have any to get)
  77. ClaimFunction()
  78. end
  79.  
  80. -- // Whilst the autofarm is enable, constantly do it
  81. while wait() do
  82. if (getgenv().TreasureAutoFarm.Enabled) then
  83. walkthrough()
  84. end
  85. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement