Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. --> piterleopards <--
  2. local onoffkey = "j"
  3. local coins = game.Workspace:WaitForChild("__REMOTES"):WaitForChild("Coins")
  4. local save = game.Workspace:WaitForChild("__REMOTES"):WaitForChild("Get Other Stats"):InvokeServer()
  5. local plr = game:GetService("Players").LocalPlayer
  6. local petids = {}
  7. local petba = {}
  8. local petstotal = #save[plr.Name]["Save"]["Pets"]
  9. local CoinList = {"8 Small Chest","8 Chest","8 Good Chest","9 Chest","9 Small Chest","9 Small Coin","10 Chest"}
  10.  
  11. local VirtualUser=game:service'VirtualUser' --Anti AFK credit to : cxx
  12. game:service'Players'.LocalPlayer.Idled:connect(function()
  13. VirtualUser:CaptureController()
  14. VirtualUser:ClickButton2(Vector2.new())
  15. end)
  16.  
  17. local onoff = false
  18. local plr = game:GetService("Players").LocalPlayer
  19. local mouse = plr:GetMouse()
  20. mouse.KeyDown:connect(function(key)
  21. if key:lower() == onoffkey then
  22. onoff = not onoff
  23. print(tostring(onoff))
  24. end
  25. end)
  26.  
  27. local function has_value (tab, val)
  28. for index, value in ipairs(tab) do
  29. if value == val then
  30. return true
  31. end
  32. end
  33. return false
  34. end
  35.  
  36. for i=1,petstotal do
  37. if(save[plr.Name]["Save"]["Pets"][petstotal].e == true) then
  38. table.insert(petids, save[plr.Name]["Save"]["Pets"][petstotal].id)
  39. table.insert(petba, save[plr.Name]["Save"]["Pets"][petstotal].ba)
  40. end
  41. petstotal = petstotal - 1
  42. end
  43.  
  44. while wait() do
  45. if onoff then
  46. for __,iCoins in next, workspace.__THINGS.Coins:GetChildren() do
  47. if iCoins:FindFirstChild("CoinName") ~= nil and has_value(CoinList,iCoins:FindFirstChild("CoinName").Value) and onoff then
  48. if (iCoins:FindFirstChild("Health") ~= nil and iCoins:FindFirstChild("Health").Value > 0) and onoff then
  49. repeat wait(0.1)
  50. for i=1,#petids do
  51. coins:FireServer("Mine",iCoins.Name, petba[i]*4-1, petids[i])
  52. end
  53. until iCoins:FindFirstChild("Health") == nil or iCoins:FindFirstChild("Health").Value <= 0 or not onoff
  54. end
  55. end
  56. end
  57. end
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement