Advertisement
SirMeme

PET SIMULATOR

Aug 13th, 2018
16,280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. --[[
  2. -----------------------------
  3. Controls:
  4.  
  5. f3 to turn on
  6.  
  7. f4 to stop
  8. -----------------------------
  9. Game:
  10. https://www.roblox.com/games/1599679393/New-Area-Pet-Simulator
  11. -----------------------------
  12. Description:
  13. Farms coins and xp for your pets, Make sure you adjust the amount accordingly
  14. -----------------------------
  15. Credit:
  16. Edit: @Verm brianops16
  17. Original: @Verm sunrise
  18. -----------------------------
  19. --]]
  20.  
  21. function code()
  22. --Not created by brianops16 !!!!!!!!!!!
  23.  
  24. local amount = 200 -- experiment with this value, 1000 is maximum and for pets with high levels
  25.  
  26. local coins = game.Workspace:WaitForChild("__REMOTES"):WaitForChild("Coins")
  27. local save = game.Workspace:WaitForChild("__REMOTES"):WaitForChild("Get Other Stats"):InvokeServer()
  28. local plr = game:GetService("Players").LocalPlayer
  29. local petids = {}
  30. local pets = game:GetService("Workspace")["__REMOTES"].Pets
  31. local a = #save[plr.Name]["Save"]["Pets"]
  32. local done = "lol meme"
  33. function random(t)
  34. local keys = {}
  35. for key, value in pairs(t) do
  36. keys[#keys+1] = key
  37. end
  38. index = keys[math.random(1, #keys)]
  39. return t[index]
  40. end
  41. for i=1,a do
  42. if(save[plr.Name]["Save"]["Pets"][a].e == true) and on == 1 then
  43. table.insert(petids, save[plr.Name]["Save"]["Pets"][a].id)
  44. end
  45. a = a - 1
  46. end
  47. function co(b)
  48. local done = b
  49. print("Mining coin: " .. b.Name)
  50. while(b:FindFirstChild"Health" ~= nil and b:FindFirstChild"Health".Value > 0) and on == 1 do
  51. warn(b.Name .. "- Health: " .. b.Health.Value)
  52. wait(0.2)
  53. coins:FireServer("Mine",b.Name, amount, random(petids))
  54. end
  55. end
  56. for _,b in next, workspace.__THINGS.Coins:GetChildren() do
  57. if(done ~= b) and on == 1 then
  58. coroutine.wrap(function()co(b)end)()
  59. end
  60. end
  61. end
  62.  
  63. ----
  64.  
  65. on = 1
  66.  
  67. ----
  68.  
  69. local UIS = game:GetService("UserInputService")
  70. UIS.InputBegan:connect(function(Input)
  71. local KeyCode = Input.KeyCode
  72. if KeyCode == Enum.KeyCode.F3 then
  73. on = 1
  74. wait(.2)
  75. if on == 1 then
  76. game:GetService('RunService').Stepped:wait(0)
  77. local good,bad = pcall(code)
  78. if good and on == 1 then
  79. code()
  80. else
  81. wait()
  82. end
  83. end
  84. end
  85. end)
  86. UIS.InputBegan:connect(function(Input)
  87. local KeyCode = Input.KeyCode
  88. if KeyCode == Enum.KeyCode.F4 then
  89. on = 0
  90. end
  91. end)
  92. --Description and controls at the top
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement