Advertisement
Graizy

Lounrt

Dec 13th, 2021
1,312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. local VirtualUser = game:service("VirtualUser")
  2. game:service('Players').LocalPlayer.Idled:connect(function()
  3. VirtualUser:CaptureController()
  4. VirtualUser:ClickButton2(Vector2.new())
  5. end)
  6.  
  7. local owned_plot = game.Players.LocalPlayer.NonSaveVars.OwnsPlot
  8. while owned_plot.Value == nil do
  9. wait(1)
  10. end
  11.  
  12. while wait(0.01) do
  13.  
  14. game.Players.LocalPlayer.Gamepasses.NitroSpeed.Value = true
  15.  
  16. local basket_status = game.Players.LocalPlayer.NonSaveVars.BasketStatus
  17. local backpack_amount = game.Players.LocalPlayer.NonSaveVars.BackpackAmount
  18. local washing_machine_capacity = game.Players.LocalPlayer.NonSaveVars.TotalWashingMachineCapacity
  19. local basket_size = game.Players.LocalPlayer.NonSaveVars.BasketSize
  20. local remaining_basket = math.min(basket_size.Value - backpack_amount.Value, washing_machine_capacity.Value - backpack_amount.Value)
  21.  
  22. if basket_status.Value == "Dirty" or backpack_amount.Value == 0 then
  23. while remaining_basket > 0 do
  24. remaining_basket = math.min(basket_size.Value - backpack_amount.Value, washing_machine_capacity.Value - backpack_amount.Value)
  25.  
  26. local clothes_array = game.Workspace.Debris.Clothing:GetChildren()
  27.  
  28. local count_clothes = #clothes_array
  29. for i = 1, #clothes_array do
  30. if clothes_array[i].Name == "Magnet" then
  31. count_clothes -= 1
  32. end
  33. end
  34.  
  35. if count_clothes == 0 then
  36. break
  37. end
  38.  
  39. local index = 1
  40. local closest_cloth = nil
  41. while closest_cloth == nil do
  42. if index > #clothes_array then
  43. index = 1
  44. end
  45. closest_cloth = clothes_array[index]
  46. index += 1
  47. wait(0.01)
  48. end
  49.  
  50. local humanoid_root_part = game.Players.LocalPlayer.Character.HumanoidRootPart
  51. local temp = (closest_cloth.Position - humanoid_root_part.Position).Magnitude
  52.  
  53. for i in ipairs(clothes_array) do
  54. local magnitude = (clothes_array[i].Position - humanoid_root_part.Position).Magnitude
  55. if (magnitude < temp or clothes_array[i]:FindFirstChild("SpecialTag")) and clothes_array[i].Name ~= "Magnet" then
  56. temp = magnitude
  57. closest_cloth = clothes_array[i]
  58. end
  59. end
  60.  
  61. game.ReplicatedStorage.Events.GrabClothing:FireServer(closest_cloth)
  62. wait(0.01)
  63. end
  64.  
  65. local washing_machines = owned_plot.Value.WashingMachines:GetChildren()
  66. for i in ipairs(washing_machines) do
  67. if washing_machines[i].Config.CycleFinished.Value then
  68. game.ReplicatedStorage.Events.UnloadWashingMachine:FireServer(washing_machines[i])
  69. game.ReplicatedStorage.Events.DropClothesInChute:FireServer()
  70. else
  71. local temp = washing_machines[i].Config.Capacity.Value
  72. for j = 1, backpack_amount.Value do
  73. game.ReplicatedStorage.Events.LoadWashingMachine:FireServer(washing_machines[i])
  74. if temp >= washing_machines[i].Config.Capacity.Value then
  75. break
  76. end
  77. end
  78. end
  79. end
  80. end
  81. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement