Advertisement
skymissblueboy

Untitled

Apr 12th, 2023
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/xHeptc/Kavo-UI-Library/main/source.lua"))()
  2. local Window = Library.CreateLib("Busy Business!", "Ocean")
  3. local Tab = Window:NewTab("Main")
  4. local Section = Tab:NewSection("Main stuff")
  5. Section:NewButton("Autofarm", "relax and upgrade stuff", function()
  6. local currentPlot;
  7. for i, v in pairs(workspace.Plots:GetChildren()) do
  8. if v:FindFirstChild("Owner") and v.Owner.Value == game.Players.LocalPlayer then
  9. currentPlot = v
  10. end
  11. end
  12.  
  13. local useMachine = game:GetService("ReplicatedStorage").Communication.UseMachine
  14. local orderCustomer = game:GetService("ReplicatedStorage").Communication.CustomerOrder
  15. local serveCustomer = game:GetService("ReplicatedStorage").Communication.ServeCustomer
  16. local ServerScriptService = game:GetService("ServerScriptService")
  17. task.spawn(function()
  18. while task.wait(1) do
  19. for i, v in pairs(currentPlot.Customers:GetChildren()) do
  20. if not v:GetAttribute("OrderTaken") then
  21. orderCustomer:FireServer(v)
  22. end
  23. end
  24. end
  25. end)
  26.  
  27. function getItem(Item)
  28. local vStation;
  29. for i, v in pairs(currentPlot.Objects:GetChildren()) do
  30. if v:FindFirstChild("Item") and v.Item.Value == Item then
  31. vStation = v
  32. end
  33. end
  34.  
  35. useMachine:FireServer(vStation, false)
  36. useMachine:FireServer(vStation, true)
  37. end
  38.  
  39.  
  40. task.spawn(function()
  41. while task.wait(1) do
  42. for i, v in pairs(currentPlot.Customers:GetChildren()) do
  43. if not (v:GetAttribute("Count") == 0) and v:GetAttribute("Count") and tonumber(v:GetAttribute("Count")) >= 1 then
  44. local customerItem = v:GetAttribute("Item")
  45. if not customerItem then continue end
  46. for i = 1, v:GetAttribute("Count") do
  47. getItem(customerItem)
  48. serveCustomer:FireServer(v)
  49. end
  50. end
  51. end
  52. end
  53. end)
  54. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement