Advertisement
Guest User

Untitled

a guest
May 26th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.01 KB | None | 0 0
  1. --Script by Forever4D#5448 :D
  2.  
  3. local Pizza_Baker = Instance.new("ScreenGui")
  4. local Main = Instance.new("Frame")
  5. local txt = Instance.new("TextLabel")
  6. local btn = Instance.new("TextButton")
  7. local main2 = Instance.new("Frame")
  8. local txt_2 = Instance.new("TextLabel")
  9.  
  10. Pizza_Baker.Name = "Pizza_Baker"
  11. Pizza_Baker.Parent = game.Players.LocalPlayer.PlayerGui
  12.  
  13. Main.Name = "Main"
  14. Main.Parent = Pizza_Baker
  15. Main.Active = true
  16. Main.BackgroundColor3 = Color3.new(0.0431373, 0.584314, 1)
  17. Main.BorderColor3 = Color3.new(1, 1, 1)
  18. Main.BorderSizePixel = 2
  19. Main.ClipsDescendants = true
  20. Main.Position = UDim2.new(0.301336586, 0, 0.384387374, 0)
  21. Main.Selectable = true
  22. Main.Size = UDim2.new(0, 235, 0, 117)
  23.  
  24. txt.Name = "txt"
  25. txt.Parent = Main
  26. txt.BackgroundColor3 = Color3.new(1, 1, 1)
  27. txt.BackgroundTransparency = 1
  28. txt.BorderSizePixel = 0
  29. txt.Position = UDim2.new(0.0744680837, 0, 0, 0)
  30. txt.Size = UDim2.new(0, 200, 0, 37)
  31. txt.Font = Enum.Font.Cartoon
  32. txt.Text = "Bloxburg Pizza Baker"
  33. txt.TextColor3 = Color3.new(1, 1, 1)
  34. txt.TextScaled = true
  35. txt.TextSize = 14
  36. txt.TextWrapped = true
  37. txt.TextXAlignment = Enum.TextXAlignment.Left
  38.  
  39. btn.Name = "btn"
  40. btn.Parent = Main
  41. btn.BackgroundColor3 = Color3.new(0.0431373, 0.584314, 1)
  42. btn.BorderColor3 = Color3.new(0.313726, 0.623529, 1)
  43. btn.BorderSizePixel = 2
  44. btn.Position = UDim2.new(0.165957451, 0, 0.498130351, 0)
  45. btn.Size = UDim2.new(0, 156, 0, 25)
  46. btn.Font = Enum.Font.Bodoni
  47. btn.Text = "Auto Pizza Baker"
  48. btn.TextColor3 = Color3.new(1, 1, 1)
  49. btn.TextScaled = true
  50. btn.TextSize = 14
  51. btn.TextWrapped = true
  52.  
  53. main2.Name = "main2"
  54. main2.Parent = Main
  55. main2.BackgroundColor3 = Color3.new(1, 1, 1)
  56. main2.BorderSizePixel = 0
  57. main2.Position = UDim2.new(-0.00425531901, 0, 0.316239327, 0)
  58. main2.Size = UDim2.new(0, 236, 0, 3)
  59.  
  60. txt_2.Name = "txt"
  61. txt_2.Parent = Main
  62. txt_2.BackgroundColor3 = Color3.new(1, 1, 1)
  63. txt_2.BackgroundTransparency = 1
  64. txt_2.BorderSizePixel = 0
  65. txt_2.Position = UDim2.new(0.165957451, 0, 0.829059839, 0)
  66. txt_2.Size = UDim2.new(0, 200, 0, 13)
  67. txt_2.Font = Enum.Font.Cartoon
  68. txt_2.Text = "Script by Forever4D#5448"
  69. txt_2.TextColor3 = Color3.new(1, 1, 1)
  70. txt_2.TextScaled = true
  71. txt_2.TextSize = 14
  72. txt_2.TextWrapped = true
  73. txt_2.TextXAlignment = Enum.TextXAlignment.Left
  74. Main.Draggable = true
  75.  
  76. btn.MouseButton1Click:connect(function()
  77. local Players = game.Players
  78. local Player = Players['LocalPlayer']
  79.  
  80. local Character = Player.Character or Player.CharacterAdded:wait()
  81. local HRP = Character['HumanoidRootPart']
  82. local Stat = workspace.Stats[Player.Name]
  83.  
  84. local DE = game.ReplicatedStorage.DataEvent
  85. local UE = Player.PlayerGui.MainGUI.Scripts.Inventory.UpdateEvent
  86.  
  87. local PP = workspace.PizzaPlanet
  88. local Stations = PP['BakerWorkstations']
  89. local Crates = PP['IngredientCrates']
  90. local Working, Stocking = true
  91.  
  92. Stat.Job:GetPropertyChangedSignal('Value'):Connect(function()
  93. if Stat.Job.Value == 'PizzaPlanetBaker' then Working = false
  94. else Working = true end
  95. end)
  96. if Stat.Job.Value == 'PizzaPlanetBaker' then Working = false end
  97.  
  98. local Orders = {
  99. Cheese = {true,true,true,false};
  100. Vegetable = {true,true,true,'Vegetable'};
  101. Ham = {true,true,true,'Ham'};
  102. Pepperoni = {true,true,true,'Pepperoni'}
  103. }
  104.  
  105. local CrateTP = Vector3.new(1163.78955, 13.5, 258.54892)
  106. local Positions = {
  107. Vector3.new(1173.34778, 13.5, 226.585571),
  108. Vector3.new(1172.8501, 13.5, 238.183029),
  109. Vector3.new(1173.20837, 13.5, 250.465881),
  110. Vector3.new(1173.47266, 13.5, 259.170837)
  111. }
  112.  
  113. local Part1 = coroutine.wrap(function()
  114. while wait() do
  115. for __, station in next, (Stations:GetChildren()) do
  116. if Working then break end
  117. local CT = station:FindFirstChild('CounterTop')
  118. if CT then CT.Parent = nil end
  119. station.InUse.Value = Player
  120.  
  121. local Pos = Positions[__]
  122. Character.Humanoid.WalkToPoint = Pos
  123. repeat wait() until (HRP.Position - Pos).magnitude < 2 or Working
  124. if Working then break end
  125.  
  126. local NI = station['OrderDisplay']['DisplayMain']:FindFirstChild('NoIngredients',true)
  127. if NI and NI.Visible and not Working then
  128. Stocking = true
  129. local Pos = CrateTP
  130. Character.Humanoid.WalkToPoint = Pos
  131. repeat wait() until (HRP.Position - Pos).magnitude < 2.75 or Working
  132. if Working then break end
  133.  
  134. local Crate = Crates.Crate;
  135. for __, cr in next, (Crates:GetChildren()) do
  136. if (cr.Position - HRP.Position).magnitude < (Crate.Position - HRP.Position).magnitude then
  137. Crate = cr
  138. end
  139. end
  140. Crate.Parent = game.Lighting.TempFolder
  141. wait()
  142. DE:FireServer({
  143. Object = game.Lighting.TempFolder.Crate,
  144. Type = 'TakeIngredientCrate'
  145. })
  146. Crate.Parent = Crates
  147. UE:Fire(Stat.EquippedItem)
  148. wait()
  149. end
  150.  
  151. local Pos = Positions[__]
  152. Character.Humanoid.WalkToPoint = Pos
  153. repeat wait() until (HRP.Position - Pos).magnitude < 2 or Working
  154. if Working then break end
  155. if Stocking then
  156. DE:FireServer({
  157. Workstation = station,
  158. Type = 'RestockIngredients'
  159. })
  160. end
  161. Stocking = false
  162. end
  163. for i = #Positions, 1, -1 do
  164. local station = Stations:GetChildren()[i]
  165. if Working then break end
  166. local CT = station:FindFirstChild('CounterTop')
  167. if CT then CT.Parent = nil end
  168. station.InUse.Value = Player
  169.  
  170. local Pos = Positions[i]
  171. Character.Humanoid.WalkToPoint = Pos
  172. repeat wait() until (HRP.Position - Pos).magnitude < 2 or Working
  173. if Working then break end
  174.  
  175. local NI = station['OrderDisplay']['DisplayMain']:FindFirstChild('NoIngredients',true)
  176. if NI and NI.Visible and not Working then
  177. Stocking = true
  178. local Pos = CrateTP
  179. Character.Humanoid.WalkToPoint = Pos
  180. repeat wait() until (HRP.Position - Pos).magnitude < 2.75 or Working
  181. if Working then break end
  182.  
  183. local Crate = Crates.Crate;
  184. for __, cr in next, (Crates:GetChildren()) do
  185. if (cr.Position - HRP.Position).magnitude < (Crate.Position - HRP.Position).magnitude then
  186. Crate = cr
  187. end
  188. end
  189. Crate.Parent = game.Lighting.TempFolder
  190. wait()
  191. DE:FireServer({
  192. Object = game.Lighting.TempFolder.Crate,
  193. Type = 'TakeIngredientCrate'
  194. })
  195. Crate.Parent = Crates
  196. UE:Fire(Stat.EquippedItem)
  197. wait()
  198. end
  199.  
  200. local Pos = Positions[i]
  201. Character.Humanoid.WalkToPoint = Pos
  202. repeat wait() until (HRP.Position - Pos).magnitude < 2 or Working
  203. if Working then break end
  204. if Stocking then
  205. DE:FireServer({
  206. Workstation = station,
  207. Type = 'RestockIngredients'
  208. })
  209. end
  210. Stocking = false
  211. end
  212. end
  213. end)
  214.  
  215. local Part2 = coroutine.wrap(function()
  216. while wait(1) do
  217. for __, station in next, (Stations:GetChildren()) do
  218. if Working or Stocking then break end
  219. local send = Orders[station.Order.Value]
  220. local count = station.Order.IngredientsLeft.Value
  221. DE:FireServer({
  222. Workstation = station,
  223. Type = 'UseWorkstation'
  224. })
  225.  
  226. if Working or Stocking then break end
  227. if count > 2 then count = count - 1 end
  228. for i = 1, count do
  229. DE:FireServer({
  230. Workstation = station,
  231. Type = 'UseWorkstation'
  232. })
  233. end
  234.  
  235. if Working or Stocking then break end
  236.  
  237. DE:FireServer({
  238. Order = send,
  239. Workstation = station,
  240. Type = 'FinishOrder'
  241. })
  242. UE:Fire(Stat.Job.ShiftEarnings)
  243. end
  244. end
  245. end)
  246.  
  247. Part1()
  248. Part2()
  249. end)
  250.  
  251. repeat
  252. for hue = 0, 1, .01 do
  253. Main.BorderColor3 = Color3.fromHSV(hue, 1, 1)
  254. wait()
  255. end
  256. for hue = 1, 0 -.01 do
  257. Main.BorderColor3 = Color3.fromHSV(hue, 1, 1)
  258. wait()
  259. end
  260. until nil
  261.  
  262. repeat
  263. for hue = 0, 1, .01 do
  264. main2.BackgroundColor3 = Color3.fromHSV(hue, 1, 1)
  265. wait()
  266. end
  267. for hue = 1, 0 -.01 do
  268. main2.BackgroundColor3 = Color3.fromHSV(hue, 1, 1)
  269. wait()
  270. end
  271. until nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement