Advertisement
Upscalefanatic3

(Roblox) Fantastic Frontier Duplication Farm script

Jun 29th, 2020 (edited)
531
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local Max = 6
  2. local Laggy = true
  3. local SellFireflies = false
  4. local Dupes = 50
  5. local FireflyNum = 1313
  6. local Events = game.ReplicatedStorage.Events
  7. local Player = game.Players.LocalPlayer
  8. local Inventory = Player:WaitForChild('Inventory')
  9.  
  10. local function goto(pos)
  11. local active = true
  12. if not game.Workspace.HOLE:FindFirstChild("HoleTPEntrance") then
  13. repeat
  14. local prevPos = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
  15. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(1304, 96, -525)
  16. wait()
  17. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = prevPos
  18. wait(1)
  19. until game.Workspace.HOLE:FindFirstChild("HoleTPEntrance")
  20. end
  21.  
  22. if (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - pos).magnitude < 200 then
  23. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(pos)
  24. wait(0.3)
  25. active = false
  26. else
  27. local hole = game.Workspace.HOLE.HoleTPEntrance
  28. local oPos = hole.Position
  29. local oSize = hole.Size
  30.  
  31. hole.Size = Vector3.new(1, 1, 1)
  32. hole.Transparency = 1
  33. hole.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
  34.  
  35. repeat
  36. hole.Position = game.Players.LocalPlayer.Character.HumanoidRootPart.Position
  37. wait()
  38. until (hole.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude < 10
  39.  
  40. hole.Position = oPos
  41. hole.Size = oSize
  42.  
  43. repeat wait() until (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - Vector3.new(430, 441, 102)).magnitude < 10
  44.  
  45. for i = 1, 4 do
  46. game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored = true
  47. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(pos)
  48. wait(0.1)
  49. end
  50.  
  51. wait(0.1)
  52. game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored = false
  53. active = false
  54. end
  55. end
  56.  
  57. local function GetItems()
  58. local n = 0
  59. for _, x in ipairs(workspace:GetChildren()) do
  60. if x.Name == 'ItemDrop' then
  61. n = n + 1
  62. end
  63. end
  64. return n
  65. end
  66.  
  67. local function GetQuantity()
  68. local Quantity = 0
  69. for _, x in ipairs(Inventory:GetChildren()) do
  70. if x.Value == FireflyNum then
  71. Quantity = x.Quantity.Value
  72. break
  73. end
  74. end
  75. return Quantity
  76. end
  77.  
  78. local function ToSell()
  79. local t = {}
  80. for _, x in ipairs(Inventory:GetChildren()) do
  81. if x.Value ~= FireflyNum then
  82. t[x.Value] = x.Quantity.Value
  83. end
  84. end
  85. return t
  86. end
  87.  
  88. local function PickupAll()
  89. for _, x in ipairs(workspace:GetChildren()) do
  90. if x.Name == 'ItemDrop' then
  91. Events.PickupItem:FireServer(x)
  92. end
  93. end
  94. end
  95.  
  96. local function Dupe(x)
  97. local oldQ = GetQuantity()
  98. warn(('Started dupe!\nOld Fireflies: %s'):format(oldQ))
  99.  
  100. for i = 1, x do
  101. local q = GetQuantity()
  102. local m = q < 100 and 100 or q * 1.2 + 1
  103.  
  104. for i = 1, math.max(m, Max) do
  105. Events.DropItem:FireServer(FireflyNum, 3/2, Player.Character.PrimaryPart.Position + Vector3.new(100, 100, 100))
  106. if not Laggy then
  107. game:GetService('RunService').Stepped:Wait()
  108. end
  109. end
  110.  
  111. local i
  112. repeat
  113. wait()
  114. i = GetItems()
  115. PickupAll()
  116. until i <= 0
  117.  
  118. wait(1)
  119. print(('Dupe %s'):format(i + 1))
  120. end
  121.  
  122. wait()
  123. local i, n
  124. repeat
  125. wait()
  126. i = GetItems()
  127. n = GetQuantity()
  128. PickupAll()
  129. until i <= 0 and n >= Max
  130.  
  131. warn('Successfully duped!')
  132. wait(0.5)
  133.  
  134. local newQ = GetQuantity()
  135. local diff = newQ - oldQ
  136. warn(('New Fireflies: %s\nDifference: %s'):format(GetQuantity(), diff))
  137. end
  138.  
  139. local Stick = game:GetService("Workspace").PassiveNPCs.NPC_Stick
  140.  
  141. local function Redeem()
  142. Stick.Dialog1.D.D1.D1.C2.D1.E.RE2:FireServer()
  143. end
  144.  
  145. local function getSell()
  146. local Sellers = workspace.Shops.Sellers
  147. local Sellers2 = workspace.Shops.SellersTwo
  148.  
  149. if #Sellers:GetChildren() >= 1 then
  150. return Sellers
  151. end
  152.  
  153. if #Sellers2:GetChildren() >= 1 then
  154. return Sellers
  155. end
  156. end
  157.  
  158. local function SellItems()
  159. local at = getSell()
  160. if not at then
  161. return
  162. end
  163.  
  164. goto(at.SellBrick.Position)
  165. wait(0.1)
  166. local Sellable = ToSell()
  167. for i = 1, 3 do
  168. for id, n in pairs(Sellable) do
  169. Events.SellShop:FireServer(id, at, n)
  170. wait()
  171. end
  172. wait(1)
  173. end
  174.  
  175. return warn('Sold items!')
  176. end
  177.  
  178. local function SpendStuff()
  179. local q = GetQuantity()
  180. local t = math.floor(q / 200)
  181.  
  182. if q - t * 200 >= 2 then
  183. if not Stick.PrimaryPart then
  184. return warn('Stick was not found!')
  185. end
  186.  
  187. warn('Redeeming and selling items now...')
  188. delay(0.2, function()
  189. spawn(function()
  190. Player.Character.Humanoid:MoveTo(Vector3.new(100, 0, 100))
  191. for i = 1, 3 do
  192. Player.Character.Humanoid.Jump = true
  193. wait(0.5)
  194. end
  195. end)
  196. end)
  197.  
  198. for i = 1, 3 do
  199. goto(Stick.PrimaryPart.Position)
  200. wait(1)
  201. end
  202.  
  203. for i = 1, t do
  204. Redeem()
  205. wait()
  206. end
  207.  
  208. wait(0.5)
  209. SellItems()
  210. return
  211. end
  212.  
  213. return warn('Could not sell/redeem items...')
  214. end
  215.  
  216. local function WaitForNoItems()
  217. local i
  218. repeat
  219. wait(1)
  220. i = GetItems()
  221. PickupAll()
  222. until i <= 0
  223. end
  224.  
  225. -- Main Execution
  226. Dupe(Dupes)
  227.  
  228. local sellLocation = getSell()
  229. if SellFireflies and GetQuantity() >= Max / 2 then
  230. SpendStuff()
  231. end
  232.  
  233. WaitForNoItems()
  234.  
Advertisement
Comments
  • nyansheep42
    243 days
    # text 0.12 KB | 0 0
    1. idk if its not working properly or if it got patched but when i do it, it just gets rid of all the fireflies in my inventory
Add Comment
Please, Sign In to add comment
Advertisement