Advertisement
Fahrezii

Untitled

Oct 20th, 2018
982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. local amount = 25000 -- experiment with this value, 25000 is maximum and for pets with high levels
  2. local coins = game.Workspace:WaitForChild("__REMOTES"):WaitForChild("Coins")
  3. local save = game.Workspace:WaitForChild("__REMOTES"):WaitForChild("Get Other Stats"):InvokeServer()
  4. local plr = game:GetService("Players").LocalPlayer
  5. local petids = {}
  6. local pets = game:GetService("Workspace")["__REMOTES"].Pets
  7. local a = #save[plr.Name]["Save"]["Pets"]
  8. local done = "lol meme"
  9. function random(t)
  10. local keys = {}
  11. for key, value in pairs(t) do
  12. keys[#keys+1] = key
  13. end
  14. index = keys[math.random(1, #keys)]
  15. return t[index]
  16. end
  17. for i=1,a do
  18. if(save[plr.Name]["Save"]["Pets"][a].e == true) then
  19. table.insert(petids, save[plr.Name]["Save"]["Pets"][a].id)
  20. end
  21. a = a - 1
  22. end
  23. function co(b)
  24. local done = b
  25. print("Mining coin: " .. b.Name)
  26. while(b:FindFirstChild"Health" ~= nil and b:FindFirstChild"Health".Value > 0) do
  27. warn(b.Name .. "- Health: " .. b.Health.Value)
  28. wait(0.2)
  29. coins:FireServer("Mine",b.Name, amount, random(petids))
  30. end
  31. end
  32. for _,b in next, workspace.__THINGS.Coins:GetChildren() do
  33. if(done ~= b) then
  34. coroutine.wrap(function()co(b)end)()
  35. end
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement