Ma7mooD-JJSploit

minion sim

Apr 21st, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. local function getclosest(zone)
  2. local distance = math.huge
  3. local closest
  4. local minethings = game:GetService("Workspace").Storage.Clickables[zone]:GetChildren()
  5. for i=1,#minethings do
  6. local v = minethings[i]
  7. if v:IsA("Model") and v.PrimaryPart and game.Players.LocalPlayer:DistanceFromCharacter(v.PrimaryPart.Position)<distance then
  8. distance = game.Players.LocalPlayer:DistanceFromCharacter(v.PrimaryPart.Position)
  9. closest = v
  10. end
  11. end
  12. return closest
  13. end
  14.  
  15. local petids = {}
  16.  
  17. spawn(function()
  18. while wait()do
  19. local pets = game:GetService("Workspace").Storage.Pets.Garbage[game.Players.LocalPlayer.Name]:GetChildren()
  20. local zone
  21. for i=1,#pets do
  22. local v = pets[i]
  23. if v:FindFirstChild("PetClientModule") then
  24. local a = require(v.PetClientModule)
  25. if a.MiningZone ~= nil then
  26. zone = a.MiningZone
  27. end
  28. if not table.find(petids,v) then
  29. table.insert(petids,v)
  30. end
  31. end
  32. end
  33. if zone then
  34. for i=1,#petids do
  35. local v = petids[i]
  36. game:GetService("ReplicatedStorage").Events.PartUpdateEvent:FireServer({
  37. ["PartName"] = getclosest(zone).Name,
  38. ["PetId"] = v.Name,
  39. ["UpdateType"] = "StartMining",
  40. ["Zone"] = zone,
  41. })
  42. end
  43. end
  44. end
  45. end)
  46.  
  47. game:GetService("Workspace").Storage.Pets.Garbage[game.Players.LocalPlayer.Name].ChildRemoved:Connect(function(a)
  48. local b = a
  49. for i=1,#petids do
  50. local v = petids[i]
  51. if tostring(v) == tostring(b) then
  52. table.remove(petids,i)
  53. end
  54. end
  55. end)
Add Comment
Please, Sign In to add comment