1. local plr = game:GetService("Players").LocalPlayer
  2. local event = game:GetService("ReplicatedStorage").Events.RepairItem
  3. local function findTycoon()
  4. for i,v in pairs(workspace.Tycoons:GetChildren()) do
  5. if v.Owner.Value == plr.Name then
  6. return v
  7. end
  8. end
  9. end
  10. local tycoon = findTycoon()
  11. print("tycoon: " .. tycoon.Name)
  12. while true do
  13. for i,v in pairs(tycoon.PlacedContent:GetChildren()) do
  14. local hp = v:WaitForChild("DestroyHP",2)
  15. if hp then
  16. if hp.Value <= 25 then
  17. task.spawn(function()
  18. for i = 1,6 do
  19. event:InvokeServer(v)
  20. wait(0.1)
  21. end
  22. end)
  23. end
  24. end
  25. end
  26. wait()
  27. end