Advertisement
robloxistoeasy

Bloxburg Script

Dec 27th, 2019
25,751
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.21 KB | None | 0 0
  1. vouch pls
  2. ```
  3. local Players = game.Players
  4. local Player = Players['LocalPlayer']
  5. local Character = Player.Character or Player.CharacterAdded:wait()
  6. local HRP = Character['HumanoidRootPart']
  7. local Stat = workspace.Stats[Player.Name]
  8. local DE = game.ReplicatedStorage.DataEvent
  9. local UE = Player.PlayerGui.MainGUI.Scripts.Inventory.UpdateEvent
  10. local PP = workspace.PizzaPlanet
  11. local Stations = PP['BakerWorkstations']
  12. local Crates = PP['IngredientCrates']
  13. local Working, Stocking = true
  14. Stat.Job:GetPropertyChangedSignal('Value'):Connect(function()
  15. if Stat.Job.Value == 'PizzaPlanetBaker' then Working = false
  16. else Working = true end
  17. end)
  18. if Stat.Job.Value == 'PizzaPlanetBaker' then Working = false end
  19. local Orders = {
  20. Cheese = {true,true,true,false};
  21. Vegetable = {true,true,true,'Vegetable'};
  22. Ham = {true,true,true,'Ham'};
  23. Pepperoni = {true,true,true,'Pepperoni'}
  24. }
  25. local CrateTP = Vector3.new(1163.78955, 13.5, 258.54892)
  26. local Positions = {
  27. Vector3.new(1173.34778, 13.5, 226.585571),
  28. Vector3.new(1172.8501, 13.5, 238.183029),
  29. Vector3.new(1173.20837, 13.5, 250.465881),
  30. Vector3.new(1173.47266, 13.5, 259.170837)
  31. }
  32. local Part1 = coroutine.wrap(function()
  33. while wait() do
  34. for __, station in next, (Stations:GetChildren()) do
  35. if Working then break end
  36. local CT = station:FindFirstChild('CounterTop')
  37. if CT then CT.Parent = nil end
  38. station.InUse.Value = Player
  39.  
  40. local Pos = Positions[__]
  41. Character.Humanoid.WalkToPoint = Pos
  42. repeat wait() until (HRP.Position - Pos).magnitude < 2 or Working
  43. if Working then break end
  44. local NI = station['OrderDisplay']['DisplayMain']:FindFirstChild('NoIngredients',true)
  45. if NI and NI.Visible and not Working then
  46. Stocking = true
  47. local Pos = CrateTP
  48. Character.Humanoid.WalkToPoint = Pos
  49. repeat wait() until (HRP.Position - Pos).magnitude < 2.75 or Working
  50. if Working then break end
  51.  
  52. local Crate = Crates.Crate;
  53. for __, cr in next, (Crates:GetChildren()) do
  54. if (cr.Position - HRP.Position).magnitude < (Crate.Position - HRP.Position).magnitude then
  55. Crate = cr
  56. end
  57. end
  58. Crate.Parent = game.Lighting.TempFolder
  59. wait()
  60. DE:FireServer({
  61. Object = game.Lighting.TempFolder.Crate,
  62. Type = 'TakeIngredientCrate'
  63. })
  64. Crate.Parent = Crates
  65. UE:Fire(Stat.EquippedItem)
  66. wait()
  67. end
  68.  
  69. local Pos = Positions[__]
  70. Character.Humanoid.WalkToPoint = Pos
  71. repeat wait() until (HRP.Position - Pos).magnitude < 2 or Working
  72. if Working then break end
  73. if Stocking then
  74. DE:FireServer({
  75. Workstation = station,
  76. Type = 'RestockIngredients'
  77. })
  78. end
  79. Stocking = false
  80. end
  81. for i = #Positions, 1, -1 do
  82. local station = Stations:GetChildren()[i]
  83. if Working then break end
  84. local CT = station:FindFirstChild('CounterTop')
  85. if CT then CT.Parent = nil end
  86. station.InUse.Value = Player
  87.  
  88. local Pos = Positions[i]
  89. Character.Humanoid.WalkToPoint = Pos
  90. repeat wait() until (HRP.Position - Pos).magnitude < 2 or Working
  91. if Working then break end
  92. local NI = station['OrderDisplay']['DisplayMain']:FindFirstChild('NoIngredients',true)
  93. if NI and NI.Visible and not Working then
  94. Stocking = true
  95. local Pos = CrateTP
  96. Character.Humanoid.WalkToPoint = Pos
  97. repeat wait() until (HRP.Position - Pos).magnitude < 2.75 or Working
  98. if Working then break end
  99.  
  100. local Crate = Crates.Crate;
  101. for __, cr in next, (Crates:GetChildren()) do
  102. if (cr.Position - HRP.Position).magnitude < (Crate.Position - HRP.Position).magnitude then
  103. Crate = cr
  104. end
  105. end
  106. Crate.Parent = game.Lighting.TempFolder
  107. wait()
  108. DE:FireServer({
  109. Object = game.Lighting.TempFolder.Crate,
  110. Type = 'TakeIngredientCrate'
  111. })
  112. Crate.Parent = Crates
  113. UE:Fire(Stat.EquippedItem)
  114. wait()
  115. end
  116.  
  117. local Pos = Positions[i]
  118. Character.Humanoid.WalkToPoint = Pos
  119. repeat wait() until (HRP.Position - Pos).magnitude < 2 or Working
  120. if Working then break end
  121. if Stocking then
  122. DE:FireServer({
  123. Workstation = station,
  124. Type = 'RestockIngredients'
  125. })
  126. end
  127. Stocking = false
  128. end
  129. end
  130. end)
  131. local Part2 = coroutine.wrap(function()
  132. while wait(1) do
  133. for __, station in next, (Stations:GetChildren()) do
  134. if Working or Stocking then break end
  135. local send = Orders[station.Order.Value]
  136. local count = station.Order.IngredientsLeft.Value
  137. DE:FireServer({
  138. Workstation = station,
  139. Type = 'UseWorkstation'
  140. })
  141.  
  142. if Working or Stocking then break end
  143. if count > 2 then count = count - 1 end
  144. for i = 1, count do
  145. DE:FireServer({
  146. Workstation = station,
  147. Type = 'UseWorkstation'
  148. })
  149. end
  150. if Working or Stocking then break end
  151. DE:FireServer({
  152. Order = send,
  153. Workstation = station,
  154. Type = 'FinishOrder'
  155. })
  156. UE:Fire(Stat.Job.ShiftEarnings)
  157. end
  158. end
  159. end)
  160. Part1()
  161. Part2()
  162. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement