Advertisement
MILAtje20

KRNL

Feb 7th, 2021
2,605
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. Workstations = game.Workspace.PizzaPlanet.BakerWorkstations
  3.  
  4. --Rename--
  5. for i, v in pairs(Workstations:GetChildren()) do
  6. if v.Name == "Workstation" then
  7. v.Name = v.Name..i
  8. end
  9. end
  10. --End-- We will only use Workstaion 4... it will make it so much easier
  11.  
  12. --Idendify Remotes--
  13. number = 0
  14. for i, v in pairs(game.ReplicatedStorage.Modules.DataManager:GetChildren()) do
  15. if v:IsA("RemoteEvent") then
  16. number = number + 1
  17. if number == 10 then
  18. FO = v--Finish Order
  19. elseif number == 17 then
  20. GC = v--Get Crate
  21. elseif number == 18 then
  22. RF = v--Refill
  23. end
  24. end
  25. end
  26. --End--
  27.  
  28. --Positions--
  29. pos = {{1158.62, 17, 265.31}, {1168.72, 14, 262.29}, {1177.12, 17, 259.78}}
  30. --Done Positions--
  31.  
  32. --Function For Teleporting--
  33. function teleport(posi)
  34. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(posi[1], posi[2], posi[3])
  35. end
  36. --Finish For Teleporting--
  37.  
  38. --Function Take Crate--
  39. function TC()
  40. Crate = {["Object"] = game.Workspace.PizzaPlanet.IngredientCrates.Crate}
  41. GC:FireServer(Crate)
  42. end
  43. --End Of Function
  44.  
  45. --Function Refill Station--
  46. function RS(S)
  47. Station = {["Workstation"] = Workstations[S]}
  48. RF:FireServer(Station)
  49. end
  50. --End Of Function--
  51.  
  52. --Function Finish Order
  53. function Finish(Tp, S)
  54. --Get Type--
  55. if Tp == "Cheese Pizza" then
  56. tpy = false
  57. elseif Tp == "Pepperoni Pizza" then
  58. tpy = "Pepperoni"
  59. elseif Tp == "Vegetable Pizza" then
  60. tpy = "Vegetable"
  61. elseif Tp == "Ham Pizza" then
  62. tpy = "Ham"
  63. end
  64. wait()
  65. --End Of Types--
  66. StationOrder = {["Order"] = {[1] = true, [2] = true, [3] = true, [4] = tpy}, ["Workstation"] = Workstations[S]}
  67. FO:FireServer(StationOrder)
  68. end
  69. --End--
  70.  
  71. game.Players.LocalPlayer.Chatted:connect(function(msg)
  72. if msg == "Stop" then
  73. a = false
  74. elseif msg == "Start" then
  75. start()
  76. end
  77. end)
  78.  
  79. function start()
  80. a = true
  81. repeat
  82. wait(wt)
  83. teleport(pos[1])
  84. wait(wt)
  85. TC()
  86. wait(wt)
  87. teleport(pos[2])
  88. wait(wt)
  89. teleport(pos[3])
  90. wait(wt)
  91. RS("Workstation4")
  92. wait(wt)
  93. for i = 1, 10 do
  94. Finish(Workstations["Workstation4"].OrderDisplay.DisplayMain.BakerGUI.Frame.TitleLabel.Text, "Workstation4")
  95. wait(wt + 0.2)
  96. end
  97. teleport(pos[2])
  98. until a == false
  99. end
  100. start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement