Advertisement
Kbane

Work at a Pizza Place Auto *FIXED*

Dec 15th, 2019
1,116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.70 KB | None | 0 0
  1. --https://v3rmillion.net/showthread.php?tid=723696
  2. game.StarterGui:SetCore("SendNotification",{Title="Unpatched",Text="UNPATCHED BY KBANE ;)",Duration=20,Button1="OK"})
  3. getupvalues = getupvalues or debug.getupvalues
  4. setupvalue = setupvalue or debug.setupvalue
  5. if not (getrawmetatable and getupvalues and setupvalue and (getreg or debug.getregistry)) then
  6. local h = Instance.new("Hint",workspace)
  7. h.Text = "Incompatible exploit."
  8. wait(3)
  9. h:Destroy()
  10. return
  11. end
  12. local settings = {refill_at=50, refill_end=97, stay_in_kitchen=true}
  13. local doCashier,doBoxer,doCook,doSupplier,doDelivery = true,true,true,true,true
  14. if readfile then
  15. pcall(function()
  16. local new = game:GetService("HttpService"):JSONDecode(readfile("PizzaFarm.txt"))
  17. --corruption?
  18. local doOverwrite=false
  19. for k,v in pairs(new) do
  20. if settings[k]==nil then
  21. doOverwrite=true
  22. new[k]=nil
  23. end
  24. end
  25. for k,v in pairs(settings) do
  26. if new[k]==nil then
  27. doOverwrite=true
  28. new[k]=v
  29. end
  30. end
  31. --use input
  32. if doOverwrite then
  33. warn("Settings overwritten")
  34. writefile("PizzaFarm.txt",game:GetService("HttpService"):JSONEncode(new))
  35. end
  36. settings = new
  37. end)
  38. end
  39.  
  40. local player = game:GetService("Players").LocalPlayer
  41. local ffc = game.FindFirstChild
  42. local RNG = Random.new()
  43. local remoteKey
  44. local character,root
  45. do
  46. local reg = (getreg or debug.getregistry)()
  47. remoteKey = (function()
  48. for i=1,#reg do
  49. local f = reg[i]
  50. if type(f)=="function" and tostring(getfenv(f).script)=="WorkTool" then
  51. local num = 0
  52. for _,v in next,getupvalues(getfenv(f).onMove) do
  53. if type(v) == "number" then
  54. num = v
  55. end
  56. end
  57. return num
  58. end
  59. end
  60. end)()
  61. for i=1,#reg do
  62. local f = reg[i]
  63. if type(f)=="function" and tostring(getfenv(f).script)=="Paycheck" then
  64. for k,v in next,getupvalues(f) do
  65. if tostring(v) == "CashOut" then
  66. setupvalue(f,k,{MouseButton1Click={wait=function()end,Wait=function()end}})
  67. break
  68. end
  69. end
  70. end
  71. end
  72. local mt=getrawmetatable(game)
  73. if setreadonly then
  74. setreadonly(mt,false)
  75. elseif make_writeable then
  76. make_writeable(mt)
  77. end
  78. local old__newindex=mt.__newindex
  79. if newcclosure then
  80. mt.__newindex=newcclosure(function(t,k,v)
  81. if t~=workspace.CurrentCamera or tostring(getfenv(2).script)~="LocalMain" then
  82. return old__newindex(t,k,v)
  83. end
  84. end)
  85. else
  86. mt.__newindex=function(t,k,v)
  87. if t~=workspace.CurrentCamera or tostring(getfenv(2).script)~="LocalMain" then
  88. return old__newindex(t,k,v)
  89. end
  90. end
  91. end
  92. workspace.Main.RealignCamera.RealignCamera:Destroy()
  93. Instance.new("BindableEvent",workspace.Main.RealignCamera).Name="RealignCamera"
  94. end
  95. assert(remoteKey,"failed to find remoteKey")
  96. --//gui
  97. Create = function(class,parent,props)
  98. local new = Instance.new(class)
  99. for k,v in next,props do
  100. new[k]=v
  101. end
  102. new.Parent = parent
  103. return new
  104. end
  105. gui=Create("ScreenGui",game.CoreGui,{Name="Farm", ZIndexBehavior="Sibling"})
  106. main=Create("Frame",gui,{Name="main", Draggable=true, Active=true, Size=UDim2.new(0,350,0,100), Position=UDim2.new(.335,0,0.02,0), BackgroundColor3=Color3.new(0.098,0.098,0.098)})
  107. topbar=Create("Frame",main,{Name="topbar", Size=UDim2.new(1,0,0.15,0), BackgroundColor3=Color3.new(0.255,0.255,0.255)})
  108. closeBtn=Create("TextButton",topbar,{Name="closeBtn", TextWrapped=true, Size=UDim2.new(0.03,0,1,0), TextColor3=Color3.new(1,1,1), Text="X", BackgroundTransparency=1,
  109. Font="GothamSemibold", Position=UDim2.new(0.96,0,0,0), TextSize=14, TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  110. titleLbl=Create("TextLabel",topbar,{Name="titleLbl", TextWrapped=true, Size=UDim2.new(0.5,0,1,0), Text="Pizza Factory", TextSize=14, Font="GothamSemibold",
  111. BackgroundTransparency=1, Position=UDim2.new(0.25,0,0,0), TextColor3=Color3.new(1,1,1), BackgroundColor3=Color3.new(1,1,1)})
  112. saveBtn=Create("ImageButton",topbar,{Name="saveBtn", Image="rbxassetid://55687833", Size=UDim2.new(0.05,0,1,0), Position=UDim2.new(0.01,0,0,0), BackgroundTransparency=1, BackgroundColor3=Color3.new(), Visible=writefile~=nil})
  113. settings_1=Create("Frame",main,{Name="settings", BackgroundTransparency=1, Size=UDim2.new(0.97,0,0.75,0), Position=UDim2.new(0.025,0,0.2,0), BackgroundColor3=Color3.new(1,1,1)})
  114. Layout=Create("UIGridLayout",settings_1,{VerticalAlignment="Center", SortOrder="LayoutOrder", HorizontalAlignment="Center", CellPadding=UDim2.new(0.01,0,0.1,0), CellSize=UDim2.new(0.325,0,0.26,0)})
  115. cashier=Create("Frame",settings_1,{Name="cashier", LayoutOrder=4, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  116. Label=Create("TextLabel",cashier,{TextWrapped=true, Size=UDim2.new(0.6,0,1,0), Text="Cashier", TextSize=14, TextXAlignment="Left", Font="SourceSans",
  117. BackgroundTransparency=1, Position=UDim2.new(0.4,0,0,0), TextColor3=Color3.new(1,1,1), TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  118. cashierBtn=Create("ImageButton",cashier,{Name="cashierBtn", ImageTransparency=1, BorderSizePixel=0, Size=UDim2.new(0.38,0,1,0), BackgroundColor3=Color3.new(0.392,0.392,0.392)})
  119. cashierSlider=Create("Frame",cashierBtn,{Name="slider", Size=UDim2.new(0.5,-4,1,-4), Position=UDim2.new(doCashier and 0.5 or 0,2,0,2), BorderSizePixel=0, BackgroundColor3=Color3.new(0.784,0.784,0.784)})
  120. kitchen=Create("Frame",settings_1,{Name="kitchen", LayoutOrder=9, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  121. Label_2=Create("TextLabel",kitchen,{TextWrapped=true, Size=UDim2.new(0.6,0,1,0), Text="[redacted]:", TextSize=14, TextXAlignment="Right", Font="SourceSans",
  122. BackgroundTransparency=1, TextColor3=Color3.new(1,1,1), TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  123. kitchenBtn=Create("TextButton",kitchen,{Name="kitchenBtn", TextWrapped=true, Size=UDim2.new(0.25,0,1,0), TextColor3=Color3.new(), Text=settings.stay_in_kitchen and "X" or "", Font="GothamBold",
  124. Position=UDim2.new(0.62,0,0,0), TextSize=35, TextScaled=true, BackgroundColor3=Color3.new(0.784,0.784,0.784)})
  125. refillEnd=Create("Frame",settings_1,{Name="refillEnd", LayoutOrder=8, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  126. refillEndBox=Create("TextBox",refillEnd,{Name="refillEndBox", TextWrapped=true, Size=UDim2.new(0.25,0,1,0), Text=tostring(settings.refill_end), TextSize=50, TextColor3=Color3.new(),
  127. Font="Code", Position=UDim2.new(0.62,0,0,0), TextScaled=true, BackgroundColor3=Color3.new(0.784,0.784,0.784)})
  128. Label_3=Create("TextLabel",refillEnd,{TextWrapped=true, Size=UDim2.new(0.6,0,1,0), Text="Refill End:", TextSize=14, TextXAlignment="Right", Font="SourceSans",
  129. BackgroundTransparency=1, TextColor3=Color3.new(1,1,1), TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  130. refillAt=Create("Frame",settings_1,{Name="refillAt", LayoutOrder=7, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  131. Label_4=Create("TextLabel",refillAt,{TextWrapped=true, Size=UDim2.new(0.5,0,1,0), Text="Refill At:", TextSize=14, TextXAlignment="Right", Font="SourceSans",
  132. BackgroundTransparency=1, TextColor3=Color3.new(1,1,1), TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  133. refillAtBox=Create("TextBox",refillAt,{Name="refillAtBox", TextWrapped=true, Size=UDim2.new(0.25,0,1,0), Text=tostring(settings.refill_at), TextSize=50, TextColor3=Color3.new(),
  134. Font="Code", Position=UDim2.new(0.52,0,0,0), TextScaled=true, BackgroundColor3=Color3.new(0.784,0.784,0.784)})
  135. supplier=Create("Frame",settings_1,{Name="supplier", LayoutOrder=6, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  136. Label_5=Create("TextLabel",supplier,{TextWrapped=true, Size=UDim2.new(0.6,0,1,0), Text="Supplier", TextSize=14, TextXAlignment="Left", Font="SourceSans",
  137. BackgroundTransparency=1, Position=UDim2.new(0.4,0,0,0), TextColor3=Color3.new(1,1,1), TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  138. supplierBtn=Create("ImageButton",supplier,{Name="supplierBtn", ImageTransparency=1, BorderSizePixel=0, Size=UDim2.new(0.38,0,1,0), BackgroundColor3=Color3.new(0.392,0.392,0.392)})
  139. supplierSlider=Create("Frame",supplierBtn,{Name="slider", Size=UDim2.new(0.5,-4,1,-4), Position=UDim2.new(doSupplier and 0.5 or 0,2,0,2), BorderSizePixel=0, BackgroundColor3=Color3.new(0.784,0.784,0.784)})
  140. delivery=Create("Frame",settings_1,{Name="delivery", LayoutOrder=5, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  141. Label_6=Create("TextLabel",delivery,{TextWrapped=true, Size=UDim2.new(0.6,0,1,0), Text="Delivery", TextSize=14, TextXAlignment="Left", Font="SourceSans",
  142. BackgroundTransparency=1, Position=UDim2.new(0.4,0,0,0), TextColor3=Color3.new(1,1,1), TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  143. deliveryBtn=Create("ImageButton",delivery,{Name="deliveryBtn", ImageTransparency=1, BorderSizePixel=0, Size=UDim2.new(0.38,0,1,0), BackgroundColor3=Color3.new(0.392,0.392,0.392)})
  144. deliverySlider=Create("Frame",deliveryBtn,{Name="slider", Size=UDim2.new(0.5,-4,1,-4), Position=UDim2.new(doDelivery and 0.5 or 0,2,0,2), BorderSizePixel=0, BackgroundColor3=Color3.new(0.784,0.784,0.784)})
  145. boxer=Create("Frame",settings_1,{Name="boxer", LayoutOrder=2, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  146. boxerLbl=Create("TextLabel",boxer,{TextWrapped=true, Size=UDim2.new(0.6,0,1,0), Text="Boxer", TextSize=14, TextXAlignment="Left", Font="SourceSans",
  147. BackgroundTransparency=1, Position=UDim2.new(0.4,0,0,0), TextColor3=Color3.new(1,1,1), TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  148. boxerBtn=Create("ImageButton",boxer,{Name="boxerBtn", ImageTransparency=1, BorderSizePixel=0, Size=UDim2.new(0.38,0,1,0), BackgroundColor3=Color3.new(0.392,0.392,0.392)})
  149. boxerSlider=Create("Frame",boxerBtn,{Name="slider", Size=UDim2.new(0.5,-4,1,-4), Position=UDim2.new(doBoxer and 0.5 or 0,2,0,2), BorderSizePixel=0, BackgroundColor3=Color3.new(0.784,0.784,0.784)})
  150. cook=Create("Frame",settings_1,{Name="cook", LayoutOrder=3, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  151. cookLbl=Create("TextLabel",cook,{TextWrapped=true, Size=UDim2.new(0.6,0,1,0), Text="Cook", TextSize=14, TextXAlignment="Left", Font="SourceSans",
  152. BackgroundTransparency=1, Position=UDim2.new(0.4,0,0,0), TextColor3=Color3.new(1,1,1), TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  153. cookBtn=Create("ImageButton",cook,{Name="cookBtn", ImageTransparency=1, BorderSizePixel=0, Size=UDim2.new(0.38,0,1,0), BackgroundColor3=Color3.new(0.392,0.392,0.392)})
  154. cookSlider=Create("Frame",cookBtn,{Name="slider", Size=UDim2.new(0.5,-4,1,-4), Position=UDim2.new(doCook and 0.5 or 0,2,0,2), BorderSizePixel=0, BackgroundColor3=Color3.new(0.784,0.784,0.784)})
  155. toggleAll=Create("Frame",settings_1,{Name="toggleAll", LayoutOrder=1, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  156. switch=Create("Frame",toggleAll,{Name="switch", BackgroundTransparency=1, Size=UDim2.new(0.75,0,1,0), BackgroundColor3=Color3.new(1,1,1)})
  157. allOffBtn=Create("ImageButton",switch,{Name="allOffBtn", ImageTransparency=1, BorderSizePixel=0, Size=UDim2.new(0.5,0,1,0), BackgroundColor3=Color3.new(0.235,0.235,0.235)})
  158. allOnBtn=Create("ImageButton",switch,{Name="allOnBtn", ImageTransparency=1, BorderSizePixel=0, Size=UDim2.new(0.5,0,1,0), Position=UDim2.new(0.5,0,0,0), BackgroundColor3=Color3.new(0.333,0.333,0.333)})
  159. toggleAllSlider=Create("Frame",switch,{Name="slider", Size=UDim2.new(0.1,0,1,4), Position=UDim2.new(0.45,0,0,-2), BorderSizePixel=0, BackgroundColor3=Color3.new(0.784,0.784,0.784)})
  160. messageLbl=Create("TextLabel",topbar,{Name="messageLbl", Size=UDim2.new(0.5,0,1,0), Text="Saved.", TextSize=14, Font="GothamSemibold", BackgroundTransparency=1,
  161. Position=UDim2.new(0.07,0,0,0), TextColor3=Color3.new(1,1,1), Visible=false, TextXAlignment="Left"})
  162. camframe=Create("Frame",gui,{Name="camframe", BackgroundTransparency=1, Size=UDim2.new(0,120,0,40), Position=UDim2.new(0.5,-320,0,-38), BackgroundColor3=Color3.new(0.118,0.118,0.118)})
  163. rightCamBtn=Create("ImageButton",camframe,{Name="rightCamBtn", Image="rbxassetid://144168163", Size=UDim2.new(0.333,0,1,0), Rotation=180, Position=UDim2.new(0.666,0,0,0), BackgroundTransparency=1,
  164. BackgroundColor3=Color3.new(1,1,1)})
  165. leftCamBtn=Create("ImageButton",camframe,{Name="leftCamBtn", Image="rbxassetid://144168163", Size=UDim2.new(0.333,0,1,0), BackgroundTransparency=1, BackgroundColor3=Color3.new(1,1,1)})
  166. centerCamBtn=Create("ImageButton",camframe,{Name="centerCamBtn", Image="rbxassetid://58282192", Size=UDim2.new(0.333,0,1,0), Position=UDim2.new(0.333,0,0,0), BackgroundTransparency=1, BackgroundColor3=Color3.new(1,1,1)})
  167. creditLbl=Create("TextLabel",main,{Position=UDim2.new(0,0,1,5),Size=UDim2.new(0,100,0,15),BackgroundTransparency=1,TextColor3=Color3.new(1,1,1),Text="by Kbane",TextScaled=true,TextStrokeTransparency=.8})
  168.  
  169. local function toggleCashier(bool)
  170. if bool~=nil then
  171. doCashier=bool
  172. else
  173. doCashier = not doCashier
  174. end
  175. cashierSlider:TweenPosition(UDim2.new(doCashier and 0.5 or 0,2,0,2),nil,"Sine",0.1,true)
  176. end
  177. local function toggleCook(bool)
  178. if bool~=nil then
  179. doCook=bool
  180. else
  181. doCook = not doCook
  182. end
  183. cookSlider:TweenPosition(UDim2.new(doCook and 0.5 or 0,2,0,2),nil,"Sine",0.1,true)
  184. end
  185. local function toggleBoxer(bool)
  186. if bool~=nil then
  187. doBoxer=bool
  188. else
  189. doBoxer = not doBoxer
  190. end
  191. boxerSlider:TweenPosition(UDim2.new(doBoxer and 0.5 or 0,2,0,2),nil,"Sine",0.1,true)
  192. end
  193. local function toggleDelivery(bool)
  194. if bool~=nil then
  195. doDelivery=bool
  196. else
  197. doDelivery = not doDelivery
  198. end
  199. deliverySlider:TweenPosition(UDim2.new(doDelivery and 0.5 or 0,2,0,2),nil,"Sine",0.1,true)
  200. end
  201. local function toggleSupplier(bool)
  202. if bool~=nil then
  203. doSupplier=bool
  204. else
  205. doSupplier = not doSupplier
  206. end
  207. supplierSlider:TweenPosition(UDim2.new(doSupplier and 0.5 or 0,2,0,2),nil,"Sine",0.1,true)
  208. end
  209. cashierBtn.MouseButton1Click:Connect(toggleCashier)
  210. cookBtn.MouseButton1Click:Connect(toggleCook)
  211. boxerBtn.MouseButton1Click:Connect(toggleBoxer)
  212. deliveryBtn.MouseButton1Click:Connect(toggleDelivery)
  213. supplierBtn.MouseButton1Click:Connect(toggleSupplier)
  214. allOffBtn.InputBegan:Connect(function()
  215. if game:GetService("UserInputService"):IsMouseButtonPressed(Enum.UserInputType.MouseButton1) then
  216. toggleCashier(false)
  217. toggleCook(false)
  218. toggleBoxer(false)
  219. toggleDelivery(false)
  220. toggleSupplier(false)
  221. toggleAllSlider:TweenPosition(UDim2.new(0,0,0,-2),nil,"Sine",0.1,true)
  222. wait(1)
  223. if toggleAllSlider.Position.X.Scale<.01 then
  224. toggleAllSlider:TweenPosition(UDim2.new(0.45,0,0,-2),nil,"Sine",0.1,true)
  225. end
  226. end
  227. end)
  228. allOnBtn.InputBegan:Connect(function()
  229. if game:GetService("UserInputService"):IsMouseButtonPressed(Enum.UserInputType.MouseButton1) then
  230. toggleCashier(true)
  231. toggleCook(true)
  232. toggleBoxer(true)
  233. toggleDelivery(true)
  234. toggleSupplier(true)
  235. toggleAllSlider:TweenPosition(UDim2.new(0.9,0,0,-2),nil,"Sine",0.1,true)
  236. wait(1)
  237. if toggleAllSlider.Position.X.Scale>.88 then
  238. toggleAllSlider:TweenPosition(UDim2.new(0.45,0,0,-2),nil,"Sine",0.1,true)
  239. end
  240. end
  241. end)
  242. kitchenBtn.MouseButton1Click:Connect(function()
  243. settings.stay_in_kitchen = not settings.stay_in_kitchen
  244. kitchenBtn.Text = settings.stay_in_kitchen and "X" or ""
  245. end)
  246. local oldRefillAt=refillAtBox.Text
  247. refillAtBox:GetPropertyChangedSignal("Text"):Connect(function()
  248. if #refillAtBox.Text>2 or refillAtBox.Text:match("%D") then
  249. refillAtBox.Text = oldRefillAt
  250. end
  251. oldRefillAt = refillAtBox.Text
  252. end)
  253. refillAtBox.FocusLost:Connect(function()
  254. if tonumber(refillAtBox.Text) then
  255. settings.refill_at=tonumber(refillAtBox.Text)
  256. end
  257. refillAtBox.Text=tostring(settings.refill_at)
  258. end)
  259. local oldRefillEnd=refillEndBox.Text
  260. refillEndBox:GetPropertyChangedSignal("Text"):Connect(function()
  261. if #refillEndBox.Text>2 or refillEndBox.Text:match("%D") then
  262. refillEndBox.Text = oldRefillEnd
  263. end
  264. oldRefillEnd = refillEndBox.Text
  265. end)
  266. refillEndBox.FocusLost:Connect(function()
  267. if tonumber(refillEndBox.Text) then
  268. settings.refill_end=tonumber(refillEndBox.Text)
  269. end
  270. refillEndBox.Text=tostring(settings.refill_end)
  271. end)
  272. closeBtn.MouseButton1Click:Connect(function() gui:Destroy() end)
  273. closeBtn.MouseEnter:Connect(function() closeBtn.TextColor3=Color3.new(.9,0,0) end)
  274. closeBtn.MouseLeave:Connect(function() closeBtn.TextColor3=Color3.new(1,1,1) end)
  275. saveBtn.MouseButton1Click:Connect(function()
  276. if writefile and messageLbl.Visible==false then
  277. writefile("PizzaFarm.txt",game:GetService("HttpService"):JSONEncode(settings))
  278. messageLbl.Visible=true
  279. wait(2)
  280. messageLbl.Visible=false
  281. end
  282. end)
  283. local cameraArray = {CFrame.new(23,14,65,0.629,0.386,-0.674,-0,0.867,0.497,0.777,-0.313,0.545),CFrame.new(39,15,83,-0.571,0.392,-0.720,-0,0.878,0.478,0.820,0.273,-0.502),CFrame.new(40,20,-38,-0.801,-0.229,0.552,-0,0.923,0.384,-0.598,0.307,-0.739),CFrame.new(51,15,-25,-0.707,0.338,-0.620,0,0.878,0.478,0.707,0.338,-0.620),CFrame.new(47,12,21,0.026,0.323,-0.945,-0,0.946,0.323,0.999,-0.008,0.024)}
  284. local cameraIndex = 0
  285. centerCamBtn.MouseButton1Click:Connect(function()
  286. cameraIndex = 0
  287. workspace.CurrentCamera.CameraType = "Custom"
  288. end)
  289. leftCamBtn.MouseButton1Click:Connect(function()
  290. cameraIndex = cameraIndex - 1
  291. if cameraIndex < 0 then
  292. cameraIndex = #cameraArray
  293. end
  294. if cameraIndex == 0 then
  295. workspace.CurrentCamera.CameraType="Custom"
  296. else
  297. local cf = cameraArray[cameraIndex]
  298. workspace.CurrentCamera.CameraType="Scriptable"
  299. workspace.CurrentCamera:Interpolate(cf,cf+cf.lookVector*10,0.5)
  300. end
  301. end)
  302. rightCamBtn.MouseButton1Click:Connect(function()
  303. cameraIndex = cameraIndex + 1
  304. if cameraIndex > #cameraArray then
  305. cameraIndex = 0
  306. workspace.CurrentCamera.CameraType="Custom"
  307. else
  308. local cf = cameraArray[cameraIndex]
  309. workspace.CurrentCamera.CameraType="Scriptable"
  310. workspace.CurrentCamera:Interpolate(cf,cf+cf.lookVector*10,0.5)
  311. end
  312. end)
  313.  
  314. --//subroutines
  315. local supplyCounts = {TomatoSauce=99,Cheese=99,Sausage=99,Pepperoni=99,Dough=99,Box=99,Dew=99}
  316. for name in pairs(supplyCounts) do
  317. local lbl = workspace.SupplyCounters[name=="Dew" and "CounterMountainDew" or "Counter"..name].a.SG.Counter
  318. supplyCounts[name]=tonumber(lbl.Text)
  319. lbl.Changed:Connect(function()
  320. supplyCounts[name]=tonumber(lbl.Text)
  321. end)
  322. end
  323.  
  324. local function FindFirstCustomer()
  325. local children = workspace.Customers:GetChildren()
  326. for i=1,#children do
  327. local c = children[i]
  328. if ffc(c,"Head") and ffc(c,"Humanoid") and c.Head.CFrame.Z<102 and (ffc(c.Head,"ChatBubble")==nil or ffc(c.Head.ChatBubble,"Bubble")==nil) and ((c.Humanoid.SeatPart and c.Humanoid.SeatPart.Anchored) or (c.Humanoid.SeatPart==nil and (c.Head.Velocity.Z^2)^.5<.0001)) then
  329. return c
  330. end
  331. end
  332. end
  333.  
  334. local boxPtick=0
  335. local boxDtick=0
  336. local function FindBoxes()
  337. local c,o,f
  338. local children = workspace.AllBox:GetChildren()
  339. for i=1,#children do
  340. local b = children[i]
  341. if ffc(b,"HasPizzaInside") or ffc(b,"Pizza") then
  342. if c==nil and b.Name=="BoxClosed" and b.Anchored==false and not b.HasPizzaInside.Value then
  343. c=b
  344. elseif o==nil and b.Name=="BoxOpen" and b.Anchored==false and not b.Pizza.Value then
  345. o=b
  346. elseif f==nil and (b.Name=="BoxOpen" and b.Pizza.Value) or (b.Name=="BoxClosed" and b.HasPizzaInside.Value) then
  347. f=b
  348. end
  349. if c and o and f then
  350. return c,o,f
  351. end
  352. end
  353. end
  354. return c,o,f
  355. end
  356. local function FindBoxingFoods()
  357. local p,d
  358. local children = workspace.BoxingRoom:GetChildren()
  359. for i=1,#children do
  360. local f = children[i]
  361. if not f.Anchored then
  362. if p==nil and f.Name=="Pizza" then
  363. p=f
  364. elseif d==nil and f.Name=="Dew" then
  365. d=f
  366. end
  367. if p and d then
  368. return p,d
  369. end
  370. end
  371. end
  372. return p,d
  373. end
  374.  
  375. local orderDict={["3540529228"]="Cheese",["3540530535"]="Sausage",["3540529917"]="Pepperoni",["2512571151"]="Dew",["2512441325"]="Dew"}
  376. local cookingDict = {Cheese=0,Sausage=0,Pepperoni=0,Dew=0}
  377. local cookPtick=0
  378. local cookDtick=0
  379. local cookWarned=false
  380. local boxerWarned=false
  381. local function getOrders()
  382. local orders={}
  383. local tempCookingDict = {}
  384. for i,v in pairs(cookingDict) do tempCookingDict[i]=v end
  385. local children = workspace.Orders:GetChildren()
  386. for i=1,#children do
  387. local o = orderDict[children[i].SG.ImageLabel.Image:match("%d+$")]
  388. if o then
  389. if tempCookingDict[o]>0 then
  390. --ignores oven pizzas, so new orders are priority
  391. tempCookingDict[o]=tempCookingDict[o]-1
  392. elseif (o=="Dew" and #workspace.AllMountainDew:GetChildren()>0) or (supplyCounts[o]>0 and supplyCounts.TomatoSauce>0 and supplyCounts.Cheese>0) then
  393. --need supplies
  394. orders[#orders+1]=o
  395. end
  396. end
  397. end
  398. return orders
  399. end
  400. local function FindFirstDew()
  401. local children = workspace.AllMountainDew:GetChildren()
  402. for i=1,#children do
  403. if not children[i].Anchored then
  404. return children[i]
  405. end
  406. end
  407. end
  408. local function FindDoughAndWithout(str)
  409. local goodraw,p,raw,trash
  410. local children = workspace.AllDough:GetChildren()
  411. for i = #children, 2, -1 do --shuffle
  412. local j = RNG:NextInteger(1, i)
  413. children[j], children[i] = children[i], children[j]
  414. end
  415. for i=1,#children do
  416. local d = children[i]
  417. if d.Anchored==false and #d:GetChildren()>9 then
  418. if d.IsBurned.Value or d.HasBugs.Value or d.Cold.Value or (d.BrickColor.Name=="Bright orange" and ffc(d,"XBillboard")) then
  419. if trash==nil and d.Position.Y > 0 then
  420. trash=d
  421. end
  422. elseif p==nil and d.BrickColor.Name=="Bright orange" then
  423. p=d
  424. elseif goodraw==nil and d.Position.X<55 and d.BrickColor.Name=="Brick yellow" and ((str and not ffc(d.SG.Frame,str)) or (str==nil and ffc(d.SG.Frame,"Sausage")==nil and ffc(d.SG.Frame,"Pepperoni")==nil)) then
  425. --prefers flat
  426. if d.Mesh.Scale.Y<1.1 then
  427. goodraw=d
  428. else
  429. raw=d
  430. end
  431. end
  432. if goodraw and p and trash then
  433. return goodraw,p,trash
  434. end
  435. end
  436. end
  437. return goodraw or raw,p,trash
  438. end
  439. local function getOvenNear(pos)
  440. local children = workspace.Ovens:GetChildren()
  441. for i=1,#children do
  442. if (children[i].Bottom.Position-pos).magnitude < 1.5 then
  443. return children[i]
  444. end
  445. end
  446. end
  447. local function getDoughNear(pos)
  448. local children = workspace.AllDough:GetChildren()
  449. for i=1,#children do
  450. if (children[i].Position-pos).magnitude < 1.5 then
  451. return children[i]
  452. end
  453. end
  454. end
  455. local function isFullyOpen(oven)
  456. return oven.IsOpen.Value==true and (oven.Door.Meter.RotVelocity.Z^2)^.5<.0001
  457. end
  458.  
  459. local bcolorToSupply = {["Dark orange"]="Sausage",["Bright blue"]="Pepperoni",["Bright yellow"]="Cheese",["Bright red"]="TomatoSauce",["Dark green"]="Dew",["Brick yellow"]="Dough",["Light stone grey"]="Box",["Really black"]="Dew"}
  460. local supplyButtons = {}
  461. for _,button in ipairs(workspace.SupplyButtons:GetChildren()) do
  462. supplyButtons[bcolorToSupply[button.Unpressed.BrickColor.Name]] = button.Unpressed
  463. end
  464.  
  465. local delTool
  466. local function FindFirstDeliveryTool()
  467. local t
  468. local children = workspace:GetChildren()
  469. for i=1,#children do
  470. local v = children[i]
  471. if v.ClassName=="Tool" and v.Name:match("^%u%d$") and ffc(v,"House") and ffc(v,"Handle") and ffc(v,"Order") and v.Order.Value:match("%a") then
  472. if ffc(v.Handle,"X10") then
  473. return v
  474. end
  475. t = v
  476. end
  477. end
  478. return t
  479. end
  480. local function getHousePart(address)
  481. local houses = workspace.Houses:GetChildren()
  482. for i=1,#houses do
  483. local h = houses[i]
  484. if ffc(h,"Address") and h.Address.Value==address and ffc(h,"Upgrades") and h.Upgrades:GetChildren()[1] and ffc(h.Upgrades:GetChildren()[1],"GivePizza") then
  485. return h.Upgrades:GetChildren()[1].GivePizza
  486. end
  487. end
  488. end
  489. local delTouched=false
  490. local function forgetDeliveryTool()
  491. if delTool then
  492. if delTool.Parent==player.Backpack then
  493. delTool.Parent = character
  494. end
  495. if delTool.Parent==character then
  496. wait(0.1)
  497. delTool.Parent = workspace
  498. wait(0.1)
  499. end
  500. end
  501. delTool=nil
  502. delTouched=false
  503. if ffc(character,"RightHand") and ffc(character.RightHand,"RightGrip") then
  504. character.RightHand.RightGrip:Destroy()
  505. end
  506. end
  507.  
  508. local function onCharacterAdded(char)
  509. if not char then return end
  510. character=char
  511. root = character:WaitForChild("HumanoidRootPart")
  512. character:WaitForChild("Humanoid"):GetPropertyChangedSignal("WalkSpeed"):Connect(function()
  513. if delTool then
  514. character.Humanoid.WalkSpeed=16
  515. end
  516. end)
  517. end
  518. onCharacterAdded(player.Character or player.CharacterAdded:Wait())
  519. player.CharacterAdded:Connect(onCharacterAdded)
  520.  
  521. local function simTouch(part)
  522. local oldcc = part.CanCollide
  523. local oldcf = part.CFrame
  524. part.CanCollide = false
  525. part.CFrame = root.CFrame
  526. delay(0.01,function()
  527. part.CFrame = oldcf
  528. part.CanCollide = oldcc
  529. end)
  530. end
  531. --//main loop
  532. while gui.Parent do
  533. wait(0.3)
  534. if doCashier then
  535. local c = FindFirstCustomer()
  536. if c then
  537. local rootMoved = false
  538. if (root.Position-Vector3.new(46.34, 3.80, 82.02)).magnitude>9 then rootMoved = true root.CFrame = CFrame.new(46.34, 3.80, 82.02) wait(.1) end
  539. workspace.GameService.OrderCompleted:FireServer(c, false, workspace.Register3)
  540. if rootMoved then wait(.1) end
  541. end
  542. end
  543. if doCook then
  544. local order = getOrders()[1]
  545. local topping
  546. if order=="Pepperoni" or order=="Sausage" then topping=order end
  547. local cookD = FindFirstDew()
  548. local raw,cookP,trash
  549. if topping then
  550. --pepperoni order avoids sausage dough and vice verca
  551. raw,cookP,trash = FindDoughAndWithout(topping=="Pepperoni" and "Sausage" or "Pepperoni")
  552. else
  553. raw,cookP,trash = FindDoughAndWithout()
  554. end
  555. local rootMoved = false
  556. local ovens = workspace.Ovens:GetChildren()
  557. for i = #ovens, 2, -1 do --shuffle
  558. local j = RNG:NextInteger(1, i)
  559. ovens[j], ovens[i] = ovens[i], ovens[j]
  560. end
  561. --move final pizza
  562. if cookP and tick()-cookPtick>0.8 then
  563. local oven = getOvenNear(cookP.Position)
  564. if oven==nil or oven.IsOpen.Value then
  565. cookPtick=tick()
  566. if (root.Position-Vector3.new(44.63, 6.60, 45.20)).magnitude>9 then rootMoved = true root.CFrame = CFrame.new(44.63, 6.60, 45.20) wait(.1) end
  567. workspace.GameService.UpdateObjectProperty:FireServer(true, cookP, "CFrame", CFrame.new(56,4.1,38), remoteKey)
  568. end
  569. end
  570. if order then
  571. if order=="Dew" and cookD and tick()-cookDtick>0.8 then
  572. --move dew if ordered
  573. cookDtick=tick()
  574. if (root.Position-Vector3.new(44.63, 6.60, 45.20)).magnitude>9 then rootMoved = true root.CFrame = CFrame.new(44.63, 6.60, 45.20) wait(.1) end
  575. workspace.GameService.UpdateObjectProperty:FireServer(true, cookD, "CFrame", CFrame.new(53,4.68,36.5), remoteKey)
  576. elseif order~="Dew" and raw and raw.Parent and supplyCounts[order]>0 and supplyCounts.TomatoSauce>0 and supplyCounts.Cheese>0 then
  577. --make pizza
  578. if raw.Mesh.Scale.Y>1.5 then
  579. if (root.Position-Vector3.new(44.63, 6.60, 45.20)).magnitude>9 then rootMoved = true root.CFrame = CFrame.new(44.63, 6.60, 45.20) wait(.1) end
  580. workspace.GameService.UpdateObjectProperty:FireServer(true, raw, "CFrame", CFrame.new(RNG:NextNumber(29.6,44.6),3.7,RNG:NextNumber(42.5,48.5)), remoteKey)
  581. wait()
  582. workspace.GameService.SquishDough:FireServer(raw)
  583. else
  584. --make sure it will have an oven
  585. local oven
  586. for _,o in ipairs(ovens) do
  587. if isFullyOpen(o) then
  588. local other = getDoughNear(o.Bottom.Position)
  589. if other==nil or not (other.BrickColor.Name=="Bright orange" and ffc(other.SG.Frame,"TomatoSauce") and ffc(other.SG.Frame,"MeltedCheese")) then
  590. if other then
  591. --replace mistaken dough
  592. if (root.Position-Vector3.new(44.63, 6.60, 45.20)).magnitude>9 then rootMoved = true root.CFrame = CFrame.new(44.63, 6.60, 45.20) wait(.1) end
  593. workspace.GameService.UpdateObjectProperty:FireServer(true, other, "CFrame", CFrame.new(RNG:NextNumber(29.6,44.6),3.7,RNG:NextNumber(42.5,48.5)), remoteKey)
  594. wait()
  595. end
  596. oven=o
  597. break
  598. end
  599. end
  600. end
  601. if oven and raw.Parent==workspace.AllDough then
  602. --make
  603. if (root.Position-Vector3.new(44.63, 6.60, 45.20)).magnitude>9 then rootMoved = true root.CFrame = CFrame.new(44.63, 6.60, 45.20) wait(.1) end
  604. workspace.GameService.AddIngredientToPizza:FireServer(raw,"TomatoSauce")
  605. workspace.GameService.AddIngredientToPizza:FireServer(raw,"Cheese")
  606. workspace.GameService.AddIngredientToPizza:FireServer(raw,topping)
  607. workspace.GameService.UpdateObjectProperty:FireServer(true, raw, "CFrame", oven.Bottom.CFrame+Vector3.new(0,0.7,0), remoteKey)
  608. oven.Door.ClickDetector.Detector:FireServer()
  609. --mark as cooking
  610. cookingDict[order]=cookingDict[order]+1
  611. local revoked=false
  612. spawn(function()
  613. raw.AncestryChanged:Wait()
  614. if not revoked then
  615. cookingDict[order]=cookingDict[order]-1
  616. revoked=true
  617. end
  618. end)
  619. delay(40, function()
  620. if not revoked then
  621. cookingDict[order]=cookingDict[order]-1
  622. revoked=true
  623. end
  624. end)
  625. end
  626. end
  627. end
  628. end
  629. --open unnecessarily closed ovens
  630. for _,o in ipairs(ovens) do
  631. local bar = o.Door.Meter.SurfaceGui.ProgressBar.Bar
  632. if o.IsOpen.Value==false and (o.IsCooking.Value==false or (Vector3.new(bar.ImageColor3.r,bar.ImageColor3.g,bar.ImageColor3.b)-Vector3.new(.871,.518,.224)).magnitude>.1) then
  633. if (root.Position-Vector3.new(44.63, 6.60, 45.20)).magnitude>9 then rootMoved = true root.CFrame = CFrame.new(44.63, 6.60, 45.20) wait(.1) end
  634. o.Door.ClickDetector.Detector:FireServer()
  635. break
  636. end
  637. end
  638. --trash
  639. if trash and (trash.IsBurned.Value==false or getOvenNear(trash.Position)==nil or getOvenNear(trash.Position).IsOpen.Value) then
  640. --closed oven breaks if you take burnt out of it
  641. if (root.Position-Vector3.new(44.63, 6.60, 45.20)).magnitude>9 then rootMoved = true root.CFrame = CFrame.new(44.63, 6.60, 45.20) wait(.1) end
  642. workspace.GameService.UpdateObjectProperty:FireServer(true, trash, "CFrame", CFrame.new(47.9,RNG:NextNumber(-10,-30),72.5), remoteKey)
  643. end
  644. if rootMoved then wait(.1) end
  645. end
  646. if doBoxer then
  647. local boxP,boxD = FindBoxingFoods()
  648. local closedBox,openBox,fullBox = FindBoxes()
  649. local rootMoved = false
  650. if boxD and tick()-boxDtick>0.8 then
  651. boxDtick=tick()
  652. if (root.Position-Vector3.new(54.09, 3.80, 23.150)).magnitude>9 then rootMoved = true root.CFrame = CFrame.new(54.09, 3.80, 23.15) wait(.1) end
  653. workspace.GameService.UpdateObjectProperty:FireServer(true, boxD, "CFrame", CFrame.new(63,4.9,-1,-1,0,0,0,1,0,0,0,-1), remoteKey)
  654. end
  655. if fullBox then
  656. if fullBox.Name=="BoxOpen" then
  657. if (root.Position-Vector3.new(54.09, 3.80, 23.150)).magnitude>9 then rootMoved = true root.CFrame = CFrame.new(54.09, 3.80, 23.15) wait(.1) end
  658. workspace.GameService.CloseBox:FireServer(fullBox)
  659. --will be moved next loop
  660. elseif tick()-boxPtick>0.8 then
  661. if (root.Position-Vector3.new(54.09, 3.80, 23.150)).magnitude>9 then rootMoved = true root.CFrame = CFrame.new(54.09, 3.80, 23.15) wait(.1) end
  662. workspace.GameService.UpdateObjectProperty:FireServer(true, fullBox, "CFrame", CFrame.new(68.2,4.4,-1,-1,0,0,0,1,0,0,0,-1), remoteKey)
  663. boxPtick=tick()
  664. end
  665. end
  666. if closedBox and not openBox then
  667. if (root.Position-Vector3.new(54.09, 3.80, 23.150)).magnitude>9 then rootMoved = true root.CFrame = CFrame.new(54.09, 3.80, 23.15) wait(.1) end
  668. workspace.GameService.UpdateObjectProperty:FireServer(true, closedBox, "CFrame", CFrame.new(RNG:NextNumber(62.5,70.5),3.5,RNG:NextNumber(11,25)), remoteKey)
  669. wait()
  670. workspace.GameService.OpenBox:FireServer(closedBox)
  671. end
  672. if openBox and boxP then
  673. if (root.Position-Vector3.new(54.09, 3.80, 23.150)).magnitude>9 then rootMoved = true root.CFrame = CFrame.new(54.09, 3.80, 23.15) wait(.1) end
  674. workspace.GameService.UpdateObjectProperty:FireServer(true, boxP, "Anchored", true, remoteKey)
  675. workspace.GameService.UpdateObjectProperty:FireServer(true, openBox, "Anchored", true, remoteKey)
  676. wait()
  677. workspace.GameService.UpdateObjectProperty:FireServer(true, boxP, "CFrame", openBox.CFrame+Vector3.new(0,-2,0), remoteKey)
  678. wait()
  679. workspace.GameService.AssignPizzaToBox:FireServer(openBox, boxP)
  680. end
  681. if rootMoved then wait(.1) end
  682. end
  683. if doSupplier then
  684. local refill=false
  685. for s,c in pairs(supplyCounts) do
  686. if c <= settings.refill_at then
  687. refill=true
  688. break
  689. end
  690. end
  691. if refill then
  692. local oldcf = root.CFrame
  693. local alt=0
  694. local waiting = false
  695. local waitingTick = 0
  696. local lastBox
  697. while doSupplier do
  698. --check if refill is done otherwise hit buttons
  699. local fulfilled=true
  700. local boxes = workspace.AllSupplyBoxes:GetChildren()
  701. for s,c in pairs(supplyCounts) do
  702. if c<settings.refill_end then
  703. fulfilled=false
  704. local count = 0
  705. if #boxes > 30 then
  706. for i=1,#boxes do
  707. local box = boxes[i]
  708. if bcolorToSupply[box.BrickColor.Name]==s and box.Anchored==false and box.Position.Z < -740 then
  709. count=count+1
  710. end
  711. end
  712. end
  713. if count < 2 then
  714. simTouch(supplyButtons[s])
  715. end
  716. end
  717. end
  718. if fulfilled then
  719. break
  720. end
  721. wait(1.5)
  722. --check if can finish waiting for boxes to move
  723. if waiting and (lastBox.Position.X>42 or tick()-waitingTick>5) then
  724. waiting=false
  725. if lastBox.Position.X<42 then
  726. --clear boxes if stuck
  727. root.CFrame=CFrame.new(20.5,8,-35)
  728. wait(0.1)
  729. local boxes = workspace.AllSupplyBoxes:GetChildren()
  730. for i=1,#boxes do
  731. local box = boxes[i]
  732. if box.Anchored==false and box.Position.Z>-55 then
  733. workspace.GameService.UpdateObjectProperty:FireServer(true, box, "CFrame", CFrame.new(RNG:NextNumber(0,40),RNG:NextNumber(-10,-30),-70), remoteKey)
  734. wait()
  735. end
  736. end
  737. wait(0.1)
  738. end
  739. end
  740. if not waiting then
  741. --move boxes
  742. root.CFrame=CFrame.new(7, 13, -1025)
  743. wait(0.1)
  744. alt=1-alt
  745. lastBox=nil
  746. local j=0
  747. local boxes = workspace.AllSupplyBoxes:GetChildren()
  748. for i=1,#boxes do
  749. local box = boxes[i]
  750. if box.Anchored==false and box.Position.Z < -740 and bcolorToSupply[box.BrickColor.Name] and supplyCounts[bcolorToSupply[box.BrickColor.Name]]<settings.refill_end then
  751. box.CFrame = CFrame.new(38-4*j,5,-7-5*alt)
  752. workspace.GameService.UpdateObjectProperty:FireServer(true, box, "CFrame", box.CFrame, remoteKey)
  753. lastBox=box
  754. j=j+1
  755. if j>8 then break end
  756. end
  757. end
  758. if alt==0 and lastBox then
  759. waiting=true
  760. waitingTick=tick()
  761. end
  762. end
  763. end
  764. root.CFrame=oldcf
  765. end
  766. end
  767. if doDelivery then
  768. local del = FindFirstDeliveryTool()
  769. if delTool==nil and del then
  770. --get tool
  771. delTool=del
  772. delTool.Handle.CanCollide=false
  773. delTool.Handle.CFrame = root.CFrame
  774. delay(6,forgetDeliveryTool)
  775. elseif delTool and delTool.Parent==character and delTouched==false then
  776. --deliver to house
  777. local housePart = getHousePart(delTool.Name)
  778. if housePart then
  779. delTouched=true
  780. root.CFrame = housePart.CFrame
  781. end
  782. end
  783. end
  784. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement