scripercory1

Your Bizarre Adventure ITEM AUTO FARM

Mar 28th, 2021
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.47 KB | None | 0 0
  1. _G.DoFarm = true --if you would like the autofarm not to run for a little bit, set _G.DoFarm = false in another script
  2.  
  3. local settings =
  4. {
  5. SellAll = { ["Gold Coin"] = true, ["Diamond"] = true }, --items you want to farm for money, in other words
  6. MaxItems = { ["Rokakaka"] = 25, ["Mysterious Arrow"] = 25, ["Holy Ribcage Corpse"] = 5 }, --the maximum number of these items you want; you can add more and the amounts
  7. Blacklist = { ["Rokakaka"] = false }, --put items you don't want in here, and set their value to true
  8. snipeDropped = true --want to steal items that players dropped? set to true
  9. }
  10.  
  11. local items = loadstring(game:HttpGet "https://paste.jakedacatman.me/raw/_I4RU")()
  12.  
  13. print "LIST OF ITEMS:"
  14. for i, _ in pairs(items) do
  15. print(i)
  16. end
  17.  
  18. local lp = game.Players.LocalPlayer
  19. local plr = game.Workspace.Living[lp.Name]
  20. local items = game.Workspace.Item_Spawns.Items
  21. local ts = game:GetService "TweenService"
  22. local hrp = plr.HumanoidRootPart or plr:WaitForChild "HumanoidRootPart"
  23.  
  24. local function getItemCount(name)
  25. local ct = 0
  26. for i, v in pairs(lp.Backpack:GetChildren()) do
  27. if v.Name == name then
  28. ct = ct + 1
  29. end
  30. end
  31.  
  32. return ct
  33. end
  34.  
  35. local function sellAllItems(name)
  36. plr.Humanoid:EquipTool(lp.Backpack[name])
  37. plr.RemoteEvent:FireServer("EndDialogue", { NPC = "Merchant", Option = "Option2", Dialogue = "Dialogue5" })
  38. end
  39.  
  40. local function doTp(v)
  41. if _G.DoFarm then
  42. if plr:FindFirstChild "RemoteFunction" then --this is the main one for anticheat i believe, but the others may have a role (idk so better safe than sorry!)
  43. plr.RemoteFunction:Destroy()
  44. end
  45. if plr:FindFirstChild "BindableFunction" then
  46. plr.BindableFunction:Destroy()
  47. end
  48. if plr:FindFirstChild "BindableEvent" then
  49. plr.BindableEvent:Destroy()
  50. end
  51.  
  52. local item = v.Parent
  53. local base = item and item:FindFirstChild "Base" or nil
  54. local name = item and item.Name or nil
  55.  
  56. if base and base:IsA "BasePart" and not settings.Blacklist[name] then
  57. if getItemCount(name) < (settings.MaxItems[name] or math.huge) then
  58. local pos = hrp.CFrame
  59.  
  60. local info = TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false)
  61. ts:Create(hrp, info, { CFrame = base.CFrame }):Play()
  62. wait(2)
  63. fireclickdetector(v, 1)
  64. wait(1)
  65. end
  66. end
  67. end
  68. end
  69.  
  70. local detectors = {}
  71. local dropped = {}
  72.  
  73. for i,v in pairs(items:GetDescendants()) do
  74. if v:IsA "ClickDetector" then
  75. table.insert(detectors, v)
  76. end
  77. end
  78.  
  79. items.DescendantAdded:connect(function(v)
  80. if v:IsA "ClickDetector" then
  81. table.insert(detectors, v)
  82. end
  83. end)
  84.  
  85. if settings.snipeDropped then
  86. for i,v in pairs(game.Workspace:GetChildren()) do
  87. if v.Name == "Item" and v:IsA "Model" then
  88. table.insert(dropped, v)
  89. end
  90. end
  91. end
  92.  
  93. if settings.snipeDropped then
  94. game.Workspace.ChildAdded:connect(function(v)
  95. if v.Name == "Item" and v:IsA "Model" then
  96. table.insert(dropped, v)
  97. end
  98. end)
  99. end
  100.  
  101. coroutine.wrap(function()
  102. while wait(1) do
  103. if _G.DoFarm then
  104. local pos = hrp.CFrame
  105.  
  106. for i,v in pairs(detectors) do
  107. pcall(doTp, v)
  108. end
  109.  
  110. hrp.CFrame = pos
  111. end
  112. end
  113. end)()
  114.  
  115. if settings.snipeDropped then
  116. coroutine.wrap(function()
  117. while wait(1) do
  118. if _G.DoFarm then
  119. for i,v in pairs(dropped) do
  120. pcall(function()
  121. local pos = hrp.CFrame
  122. for i,v in pairs(dropped) do
  123. if v and v.Parent == game.Workspace then
  124.  
  125. hrp.CFrame = v.Base.CFrame
  126. wait(.1)
  127. end
  128. end
  129. hrp.CFrame = pos
  130. end)
  131. end
  132. end
  133. end
  134. end)()
  135. end
  136.  
  137. coroutine.wrap(function()
  138. while wait(5) do
  139. if _G.DoFarm then
  140. for i,v in pairs(lp.Backpack:GetChildren()) do
  141. if settings.SellAll[v.Name] then
  142. pcall(sellAllItems, v.Name)
  143. end
  144. end
  145. end
  146. end
  147. end)()
Advertisement
Add Comment
Please, Sign In to add comment