Upscalefanatic3

(Roblox) Fantastic Frontier Duplication Farm script

Jun 29th, 2020
290
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Made by BrokeIndian--
  2. --Copy the things below not this message--
  3. --enjoy!--
  4.  
  5. local Max = 101; -- how many fireflies it dupes (or double???)
  6. local Laggy = true; -- set to true if u want it to be faster
  7. local Sell = true; -- want to sell other items but fireflies?
  8. local Dupes = 50; -- 1 recommended
  9.  
  10. local FireflyNum = 1313;
  11. local Events = game.ReplicatedStorage.Events;
  12. local Player = game.Players.LocalPlayer;
  13. local Inventory = Player:WaitForChild'Inventory'
  14.  
  15. Player.Character.PrimaryPart.Anchored = false;
  16. local function GetItems()
  17. local n = 0;
  18. for _, x in next, workspace:GetChildren() do
  19. if x.Name == 'ItemDrop' then
  20. n = n + 1;
  21. end;
  22. end;
  23. return n;
  24. end;
  25.  
  26. local function GetQuantity()
  27. local Quantity;
  28. for _, x in next, Inventory:GetChildren() do
  29. if x.Value == FireflyNum then
  30. Quantity = x.Quantity.Value;
  31. break;
  32. end;
  33. end;
  34. return Quantity;
  35. end;
  36.  
  37. local function ToSell()
  38. local t = {};
  39. for _, x in next, Inventory:GetChildren() do
  40. if x.Value ~= FireflyNum then
  41. t[x.Value]=x.Quantity.Value;
  42. end;
  43. end;
  44. return t;
  45. end;
  46.  
  47. workspace.ChildAdded:Connect(function(x)
  48. if x.Name == 'ItemDrop' then
  49. delay(.2, function()
  50. Events.PickupItem:FireServer(x)
  51. end)
  52. end;
  53. end);
  54.  
  55. local function PickupAll()
  56. for _, x in next, workspace:GetChildren() do
  57. if x.Name == 'ItemDrop' then
  58. Events.PickupItem:FireServer(x)
  59. end;
  60. end;
  61. end;
  62.  
  63. local function Dupe(x)
  64. local oldQ = GetQuantity()
  65. warn(('Started dupe!\nOld Fireflies: %s'):format(oldQ))
  66. for i = 1, x do
  67. local q = GetQuantity();
  68. local m = q<100 and 100 or q*1.2+1
  69. for i = 1, m>Max and Max or m do
  70. Events.DropItem:FireServer(FireflyNum,3/2,Player.Character.PrimaryPart.Position+Vector3.new(100*100,100*100,100*100))
  71. if not Laggy then
  72. game:GetService'RunService'.Stepped:Wait();
  73. end;
  74. end;
  75. local i repeat wait() i = GetItems() PickupAll() until i <= 0
  76. wait(1); print(('Dupe n%s'):format(i+1))
  77. end;
  78. wait();
  79. local i, n repeat wait() i = GetItems() n = GetQuantity() PickupAll() until i <= 0 and n >= Max
  80. warn'Succesfully duped!'
  81. wait(1/2)
  82. local newQ = GetQuantity();
  83. local diff = newQ-oldQ;
  84. warn(('New Fireflies: %s\nDifference: %s'):format(GetQuantity(), diff))
  85. end;
  86.  
  87. Dupe(Dupes);
  88.  
  89. local Hole = workspace.HOLE;
  90. local Root = Player.Character.PrimaryPart;
  91.  
  92. local function checkTP()
  93. if not Hole:FindFirstChild("HoleTPEntrance") then
  94. repeat
  95. local prevPos = Root.CFrame
  96. Root.CFrame = CFrame.new(1304,96,-525)
  97. wait()
  98. Root.CFrame = prevPos
  99. wait(.1)
  100. until Hole:FindFirstChild("HoleTPEntrance")
  101. end
  102. end
  103.  
  104. local function Teleport(Location)
  105. checkTP()
  106. local hole = Hole.HoleTPEntrance
  107. hole.Size = Vector3.new(1,1,1)
  108. hole.Transparency = 1
  109. hole.CFrame = Root.CFrame
  110. repeat hole.Position = Root.Position wait() until (hole.Position - Root.Position).magnitude < 15
  111. hole.Position = Vector3.new(1318,85,-527)
  112. hole.Size = Vector3.new(14,5,17)
  113. repeat wait() until (Root.Position - Vector3.new(430,441,102)).magnitude < 15
  114. for i = 1, 3 do
  115. Root.Anchored = true
  116. Root.CFrame = CFrame.new(Location + Vector3.new(0,3,0))
  117. wait(.1)
  118. end
  119. Root.Anchored = false
  120. end;
  121.  
  122.  
  123. local Stick = workspace.PassiveNPCs.NPC_Stick;
  124. local function Redeem()
  125. Stick.Dialog1.D.D1.D1.C2.D1.E.RE2:FireServer();
  126. end;
  127.  
  128. local function getSell()
  129. local Sellers = workspace.Shops.Sellers
  130. local Sellers2 = workspace.Shops.SellersTwo
  131.  
  132. if #Sellers:GetChildren() >= 1 then
  133. return Sellers
  134. end
  135. if #Sellers2:GetChildren() >= 1 then
  136. return Sellers
  137. end;
  138. end;
  139.  
  140. local function Sell()
  141. local at = getSell()
  142. if not at then
  143. return
  144. end;
  145. Teleport(at.SellBrick.Position)
  146. wait(.1)
  147. local Sellable = ToSell();
  148. for i = 1, 3 do
  149. for id, n in next, Sellable do
  150. Events.SellShop:FireServer(id, at, n)
  151. wait();
  152. end;
  153. wait(1)
  154. end;
  155. return warn'Sold stuff!'
  156. end;
  157.  
  158. local function SpendStuff()
  159. local q = GetQuantity();
  160. local t = math.floor(q/200);
  161. if q-t*200>=2 then
  162. if not Stick.PrimaryPart then
  163. return warn'Stick wasnt found!'
  164. end;
  165. warn'Redeeming stuff now ...'
  166. delay(.2, function()
  167. spawn(function()
  168. Player.Character.Humanoid:MoveTo(Vector3.new(100,0,100))
  169. for i = 1, 3 do
  170. Player.Character.Humanoid.Jump = true;
  171. wait(1/2);
  172. end;
  173. end);
  174. end);
  175. for i = 1, 3 do
  176. Teleport(Stick.PrimaryPart.Position);
  177. wait(1)
  178. end;
  179. for i = 1, t do
  180. Redeem();
  181. wait();
  182. end;
  183. wait(1/2);
  184. warn'Selling stuff now ...'
  185. Sell();
  186. return;
  187. end;
  188. return warn'Couldnt sell/redeem stuff..'
  189. end;
  190.  
  191. local i repeat wait(1) i = GetItems() PickupAll() until i <= 0;
  192. if Sell and GetQuantity()>=Max/2 then
  193. SpendStuff();
  194. end;
RAW Paste Data