Advertisement
Holiwarm

Pet Simulator (NEW)

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