Advertisement
FurkingBoi

Robloxian Highschool Retail Store AutoFarm [By LeviTheOtaku]

Oct 2nd, 2019
8,476
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. spawn(function()
  2. while true do
  3. wait()
  4. if game.ReplicatedStorage.Data.PlayerData[game.Players.LocalPlayer.Name].Jobs.Working.Value == false then
  5. game.ReplicatedStorage.Systems.JobService['BeginJob']:InvokeServer("RetailStore")
  6. end
  7. end
  8. end)
  9.  
  10.  
  11. spawn(function()
  12. while true do
  13. wait()
  14. pcall(function()
  15. function getItem(item)
  16. local shelves = workspace.Jobs.RetailStore.Shelves:getChildren()
  17. for i=1,#shelves do
  18. if shelves[i].Item.Value == item then
  19. game.ReplicatedStorage.Modules.Jobs.RetailStore['PutItemInBasket']:FireServer(shelves[i])
  20. break
  21. end
  22. end
  23. local fridges = workspace.Jobs.RetailStore.Fridges:getChildren()
  24. for i=1,#fridges do
  25. if fridges[i].Item.Value == item then
  26. game.ReplicatedStorage.Modules.Jobs.RetailStore['PutItemInBasket']:FireServer(fridges[i])
  27. break
  28. end
  29. end
  30. end
  31. local jobNpcs = workspace.Jobs.RetailStore.NPCs:getChildren()
  32. for i=1,#jobNpcs do
  33. if jobNpcs[i]:findFirstChild("OrderBillboard") then
  34. if tostring(jobNpcs[i].Order.Player.Value) == game.Players.LocalPlayer.Name then
  35. if jobNpcs[i].Order.NumberOfItems.Value == 1 then
  36. getItem(jobNpcs[i].Order.ItemA.Value)
  37. end
  38. if jobNpcs[i].Order.NumberOfItems.Value == 2 then
  39. getItem(jobNpcs[i].Order.ItemA.Value)
  40. getItem(jobNpcs[i].Order.ItemB.Value)
  41. end
  42. if jobNpcs[i].Order.NumberOfItems.Value == 3 then
  43. getItem(jobNpcs[i].Order.ItemA.Value)
  44. getItem(jobNpcs[i].Order.ItemB.Value)
  45. getItem(jobNpcs[i].Order.ItemC.Value)
  46. end
  47. repeat
  48. wait()
  49. until jobNpcs[i].Order.Ready.Value == true
  50. game.ReplicatedStorage.Modules.Jobs.RetailStore['GiveBasket']:InvokeServer(jobNpcs[i])
  51. jobNpcs[i]:remove()
  52. end
  53. end
  54. end
  55. end)
  56. end
  57. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement