Advertisement
meldrednyx

my Gui

Dec 12th, 2020
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.50 KB | None | 0 0
  1. -- Script Gui
  2. -- Made by: Meldrednyx
  3.  
  4. -- TestGui
  5.  
  6. local ScreenGui = Instance.new("ScreenGui")
  7. local OpenFrame = Instance.new("Frame")
  8. local Open = Instance.new("TextButton")
  9. local Main = Instance.new("Frame")
  10. local TopFrame = Instance.new("Frame")
  11. local TextButton = Instance.new("TextLabel")
  12. local AntiOB = Instance.new("TextButton")
  13. local AntiAFK = Instance.new("TextButton")
  14. local AutoFarm = Instance.new("TextButton")
  15. local FurnitureMod = Instance.new("TextButton")
  16. local Close = Instance.new("TextButton")
  17.  
  18. --Properties:
  19.  
  20. ScreenGui.Parent = game.CoreGui
  21. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  22.  
  23. OpenFrame.Name = "OpenFrame"
  24. OpenFrame.Parent = ScreenGui
  25. OpenFrame.Active = true
  26. OpenFrame.BackgroundColor3 = Color3.fromRGB(8, 8, 8)
  27. OpenFrame.Position = UDim2.new(-0.0104408357, 0, 0.522776544, 0)
  28. OpenFrame.Size = UDim2.new(0, 96, 0, 57)
  29.  
  30. Open.Name = "Open"
  31. Open.Parent = OpenFrame
  32. Open.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  33. Open.Position = UDim2.new(0.127499983, 0, 0.0991227031, 0)
  34. Open.Size = UDim2.new(0, 77, 0, 45)
  35. Open.Font = Enum.Font.SciFi
  36. Open.Text = "Open"
  37. Open.TextColor3 = Color3.fromRGB(200, 200, 200)
  38. Open.TextSize = 22.000
  39. Open.MouseButton1Down:connect(function()
  40. Main.Visible = true
  41. OpenFrame.Visible = false
  42. end)
  43.  
  44.  
  45. Main.Name = "Main"
  46. Main.Parent = ScreenGui
  47. Main.Active = true
  48. Main.BackgroundColor3 = Color3.fromRGB(7, 7, 7)
  49. Main.Position = UDim2.new(0.100928076, 0, 0.522776544, 0)
  50. Main.Size = UDim2.new(0, 270, 0, 140)
  51. Main.Visible = false
  52. Main.Draggable = true
  53.  
  54.  
  55. TopFrame.Name = "TopFrame"
  56. TopFrame.Parent = Main
  57. TopFrame.Active = true
  58. TopFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  59. TopFrame.Size = UDim2.new(0, 270, 0, 29)
  60.  
  61. TextButton.Name = "TextButton"
  62. TextButton.Parent = Main
  63. TextButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  64. TextButton.Position = UDim2.new(0.24444443, 0, 0, 0)
  65. TextButton.Size = UDim2.new(0, 138, 0, 29)
  66. TextButton.Font = Enum.Font.SourceSans
  67. TextButton.Text = "Made by: Meldrednyx"
  68. TextButton.TextColor3 = Color3.fromRGB(249, 249, 249)
  69. TextButton.TextSize = 14.000
  70.  
  71. AntiOB.Name = "Anti OB"
  72. AntiOB.Parent = Main
  73. AntiOB.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  74. AntiOB.Position = UDim2.new(0.0259259827, 0, 0.271428585, 0)
  75. AntiOB.Size = UDim2.new(0, 117, 0, 42)
  76. AntiOB.Font = Enum.Font.SourceSans
  77. AntiOB.Text = "Anti OB"
  78. AntiOB.TextColor3 = Color3.fromRGB(234, 234, 234)
  79. AntiOB.TextSize = 14.000
  80. AntiOB.MouseButton1Down:connect(function()
  81. while true do
  82. wait()
  83. local ohString1 = "ChangeJob"
  84. local ohString2 = "Cashier"
  85.  
  86. game:GetService("ReplicatedStorage").PlayerChannel:FireServer(ohString1, ohString2)
  87. end
  88. end)
  89.  
  90. AntiAFK.Name = "Anti AFK"
  91. AntiAFK.Parent = Main
  92. AntiAFK.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  93. AntiAFK.Position = UDim2.new(0.0259259827, 0, 0.628571451, 0)
  94. AntiAFK.Size = UDim2.new(0, 117, 0, 42)
  95. AntiAFK.Font = Enum.Font.SourceSans
  96. AntiAFK.Text = "Anti AFK"
  97. AntiAFK.TextColor3 = Color3.fromRGB(234, 234, 234)
  98. AntiAFK.TextSize = 14.000
  99. AntiAFK.MouseButton1Down:connect(function()
  100. local VirtualUser=game:service'VirtualUser'
  101. game:service'Players'.LocalPlayer.Idled:connect(function()
  102. VirtualUser:CaptureController()
  103. VirtualUser:ClickButton2(Vector2.new())
  104. end)
  105. end)
  106.  
  107. AutoFarm.Name = "Auto Farm"
  108. AutoFarm.Parent = Main
  109. AutoFarm.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  110. AutoFarm.Position = UDim2.new(0.540740788, 0, 0.271428585, 0)
  111. AutoFarm.Size = UDim2.new(0, 117, 0, 42)
  112. AutoFarm.Font = Enum.Font.SourceSans
  113. AutoFarm.Text = "Auto Farm"
  114. AutoFarm.TextColor3 = Color3.fromRGB(234, 234, 234)
  115. AutoFarm.TextSize = 14.000
  116. AutoFarm.MouseButton1Down:connect(function()
  117. --https://v3rmillion.net/showthread.php?tid=723696
  118. getupvalues = getupvalues or debug.getupvalues
  119. setupvalue = setupvalue or debug.setupvalue
  120. if not (getrawmetatable and getupvalues and setupvalue and (getreg or debug.getregistry)) then
  121. local h = Instance.new("Hint",workspace)
  122. h.Text = "Incompatible exploit."
  123. wait(3)
  124. h:Destroy()
  125. return
  126. end
  127. local settings = {refill_at=50, refill_end=97, stay_in_kitchen=true}
  128. local doCashier,doBoxer,doCook,doSupplier,doDelivery = true,true,true,true,true
  129. if readfile then
  130. pcall(function()
  131. local new = game:GetService("HttpService"):JSONDecode(readfile("PizzaFarm.txt"))
  132. --corruption?
  133. local doOverwrite=false
  134. for k,v in pairs(new) do
  135. if settings[k]==nil then
  136. doOverwrite=true
  137. new[k]=nil
  138. end
  139. end
  140. for k,v in pairs(settings) do
  141. if new[k]==nil then
  142. doOverwrite=true
  143. new[k]=v
  144. end
  145. end
  146. --use input
  147. if doOverwrite then
  148. warn("Settings overwritten")
  149. writefile("PizzaFarm.txt",game:GetService("HttpService"):JSONEncode(new))
  150. end
  151. settings = new
  152. end)
  153. end
  154.  
  155. local player = game:GetService("Players").LocalPlayer
  156. local ffc = game.FindFirstChild
  157. local RNG = Random.new()
  158. local remoteKey
  159. local character,root
  160. do
  161. local reg = (getreg or debug.getregistry)()
  162. remoteKey = (function()
  163. for i=1,#reg do
  164. local f = reg[i]
  165. if type(f)=="function" and tostring(getfenv(f).script)=="WorkTool" then
  166. local num = 0
  167. for _,v in next,getupvalues(getfenv(f).onMove) do
  168. if type(v) == "number" then
  169. num = v
  170. end
  171. end
  172. return num
  173. end
  174. end
  175. end)()
  176. for i=1,#reg do
  177. local f = reg[i]
  178. if type(f)=="function" and tostring(getfenv(f).script)=="Paycheck" then
  179. for k,v in next,getupvalues(f) do
  180. if tostring(v) == "CashOut" then
  181. setupvalue(f,k,{MouseButton1Click={wait=function()end,Wait=function()end}})
  182. break
  183. end
  184. end
  185. end
  186. end
  187. local mt=getrawmetatable(game)
  188. if setreadonly then
  189. setreadonly(mt,false)
  190. elseif make_writeable then
  191. make_writeable(mt)
  192. end
  193. local old__newindex=mt.__newindex
  194. if newcclosure then
  195. mt.__newindex=newcclosure(function(t,k,v)
  196. if t~=workspace.CurrentCamera or tostring(getfenv(2).script)~="LocalMain" then
  197. return old__newindex(t,k,v)
  198. end
  199. end)
  200. else
  201. mt.__newindex=function(t,k,v)
  202. if t~=workspace.CurrentCamera or tostring(getfenv(2).script)~="LocalMain" then
  203. return old__newindex(t,k,v)
  204. end
  205. end
  206. end
  207. workspace.Main.RealignCamera.RealignCamera:Destroy()
  208. Instance.new("BindableEvent",workspace.Main.RealignCamera).Name="RealignCamera"
  209. end
  210. assert(remoteKey,"failed to find remoteKey")
  211. --//gui
  212. Create = function(class,parent,props)
  213. local new = Instance.new(class)
  214. for k,v in next,props do
  215. new[k]=v
  216. end
  217. new.Parent = parent
  218. return new
  219. end
  220. gui=Create("ScreenGui",game.CoreGui,{Name="Farm", ZIndexBehavior="Sibling"})
  221. 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)})
  222. topbar=Create("Frame",main,{Name="topbar", Size=UDim2.new(1,0,0.15,0), BackgroundColor3=Color3.new(0.255,0.255,0.255)})
  223. 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,
  224. Font="GothamSemibold", Position=UDim2.new(0.96,0,0,0), TextSize=14, TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  225. titleLbl=Create("TextLabel",topbar,{Name="titleLbl", TextWrapped=true, Size=UDim2.new(0.5,0,1,0), Text="Pizza Factory", TextSize=14, Font="GothamSemibold",
  226. BackgroundTransparency=1, Position=UDim2.new(0.25,0,0,0), TextColor3=Color3.new(1,1,1), BackgroundColor3=Color3.new(1,1,1)})
  227. 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})
  228. 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)})
  229. 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)})
  230. cashier=Create("Frame",settings_1,{Name="cashier", LayoutOrder=4, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  231. Label=Create("TextLabel",cashier,{TextWrapped=true, Size=UDim2.new(0.6,0,1,0), Text="Cashier", TextSize=14, TextXAlignment="Left", Font="SourceSans",
  232. BackgroundTransparency=1, Position=UDim2.new(0.4,0,0,0), TextColor3=Color3.new(1,1,1), TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  233. 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)})
  234. 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)})
  235. kitchen=Create("Frame",settings_1,{Name="kitchen", LayoutOrder=9, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  236. Label_2=Create("TextLabel",kitchen,{TextWrapped=true, Size=UDim2.new(0.6,0,1,0), Text="[redacted]:", TextSize=14, TextXAlignment="Right", Font="SourceSans",
  237. BackgroundTransparency=1, TextColor3=Color3.new(1,1,1), TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  238. 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",
  239. Position=UDim2.new(0.62,0,0,0), TextSize=35, TextScaled=true, BackgroundColor3=Color3.new(0.784,0.784,0.784)})
  240. refillEnd=Create("Frame",settings_1,{Name="refillEnd", LayoutOrder=8, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  241. 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(),
  242. Font="Code", Position=UDim2.new(0.62,0,0,0), TextScaled=true, BackgroundColor3=Color3.new(0.784,0.784,0.784)})
  243. Label_3=Create("TextLabel",refillEnd,{TextWrapped=true, Size=UDim2.new(0.6,0,1,0), Text="Refill End:", TextSize=14, TextXAlignment="Right", Font="SourceSans",
  244. BackgroundTransparency=1, TextColor3=Color3.new(1,1,1), TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  245. refillAt=Create("Frame",settings_1,{Name="refillAt", LayoutOrder=7, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  246. Label_4=Create("TextLabel",refillAt,{TextWrapped=true, Size=UDim2.new(0.5,0,1,0), Text="Refill At:", TextSize=14, TextXAlignment="Right", Font="SourceSans",
  247. BackgroundTransparency=1, TextColor3=Color3.new(1,1,1), TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  248. 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(),
  249. Font="Code", Position=UDim2.new(0.52,0,0,0), TextScaled=true, BackgroundColor3=Color3.new(0.784,0.784,0.784)})
  250. supplier=Create("Frame",settings_1,{Name="supplier", LayoutOrder=6, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  251. Label_5=Create("TextLabel",supplier,{TextWrapped=true, Size=UDim2.new(0.6,0,1,0), Text="Supplier", TextSize=14, TextXAlignment="Left", Font="SourceSans",
  252. BackgroundTransparency=1, Position=UDim2.new(0.4,0,0,0), TextColor3=Color3.new(1,1,1), TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  253. 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)})
  254. 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)})
  255. delivery=Create("Frame",settings_1,{Name="delivery", LayoutOrder=5, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  256. Label_6=Create("TextLabel",delivery,{TextWrapped=true, Size=UDim2.new(0.6,0,1,0), Text="Delivery", TextSize=14, TextXAlignment="Left", Font="SourceSans",
  257. BackgroundTransparency=1, Position=UDim2.new(0.4,0,0,0), TextColor3=Color3.new(1,1,1), TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  258. 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)})
  259. 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)})
  260. boxer=Create("Frame",settings_1,{Name="boxer", LayoutOrder=2, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  261. boxerLbl=Create("TextLabel",boxer,{TextWrapped=true, Size=UDim2.new(0.6,0,1,0), Text="Boxer", TextSize=14, TextXAlignment="Left", Font="SourceSans",
  262. BackgroundTransparency=1, Position=UDim2.new(0.4,0,0,0), TextColor3=Color3.new(1,1,1), TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  263. 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)})
  264. 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)})
  265. cook=Create("Frame",settings_1,{Name="cook", LayoutOrder=3, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  266. cookLbl=Create("TextLabel",cook,{TextWrapped=true, Size=UDim2.new(0.6,0,1,0), Text="Cook", TextSize=14, TextXAlignment="Left", Font="SourceSans",
  267. BackgroundTransparency=1, Position=UDim2.new(0.4,0,0,0), TextColor3=Color3.new(1,1,1), TextScaled=true, BackgroundColor3=Color3.new(1,1,1)})
  268. 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)})
  269. 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)})
  270. toggleAll=Create("Frame",settings_1,{Name="toggleAll", LayoutOrder=1, BackgroundTransparency=1, Size=UDim2.new(0,100,0,100), BackgroundColor3=Color3.new(1,1,1)})
  271. switch=Create("Frame",toggleAll,{Name="switch", BackgroundTransparency=1, Size=UDim2.new(0.75,0,1,0), BackgroundColor3=Color3.new(1,1,1)})
  272. 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)})
  273. 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)})
  274. 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)})
  275. messageLbl=Create("TextLabel",topbar,{Name="messageLbl", Size=UDim2.new(0.5,0,1,0), Text="Saved.", TextSize=14, Font="GothamSemibold", BackgroundTransparency=1,
  276. Position=UDim2.new(0.07,0,0,0), TextColor3=Color3.new(1,1,1), Visible=false, TextXAlignment="Left"})
  277. 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)})
  278. 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,
  279. BackgroundColor3=Color3.new(1,1,1)})
  280. 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)})
  281. 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)})
  282. 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 sirelKilla",TextScaled=true,TextStrokeTransparency=.8})
  283.  
  284. local function toggleCashier(bool)
  285. if bool~=nil then
  286. doCashier=bool
  287. else
  288. doCashier = not doCashier
  289. end
  290. cashierSlider:TweenPosition(UDim2.new(doCashier and 0.5 or 0,2,0,2),nil,"Sine",0.1,true)
  291. end
  292. local function toggleCook(bool)
  293. if bool~=nil then
  294. doCook=bool
  295. else
  296. doCook = not doCook
  297. end
  298. cookSlider:TweenPosition(UDim2.new(doCook and 0.5 or 0,2,0,2),nil,"Sine",0.1,true)
  299. end
  300. local function toggleBoxer(bool)
  301. if bool~=nil then
  302. doBoxer=bool
  303. else
  304. doBoxer = not doBoxer
  305. end
  306. boxerSlider:TweenPosition(UDim2.new(doBoxer and 0.5 or 0,2,0,2),nil,"Sine",0.1,true)
  307. end
  308. local function toggleDelivery(bool)
  309. if bool~=nil then
  310. doDelivery=bool
  311. else
  312. doDelivery = not doDelivery
  313. end
  314. deliverySlider:TweenPosition(UDim2.new(doDelivery and 0.5 or 0,2,0,2),nil,"Sine",0.1,true)
  315. end
  316. local function toggleSupplier(bool)
  317. if bool~=nil then
  318. doSupplier=bool
  319. else
  320. doSupplier = not doSupplier
  321. end
  322. supplierSlider:TweenPosition(UDim2.new(doSupplier and 0.5 or 0,2,0,2),nil,"Sine",0.1,true)
  323. end
  324. cashierBtn.MouseButton1Click:Connect(toggleCashier)
  325. cookBtn.MouseButton1Click:Connect(toggleCook)
  326. boxerBtn.MouseButton1Click:Connect(toggleBoxer)
  327. deliveryBtn.MouseButton1Click:Connect(toggleDelivery)
  328. supplierBtn.MouseButton1Click:Connect(toggleSupplier)
  329. allOffBtn.InputBegan:Connect(function()
  330. if game:GetService("UserInputService"):IsMouseButtonPressed(Enum.UserInputType.MouseButton1) then
  331. toggleCashier(false)
  332. toggleCook(false)
  333. toggleBoxer(false)
  334. toggleDelivery(false)
  335. toggleSupplier(false)
  336. toggleAllSlider:TweenPosition(UDim2.new(0,0,0,-2),nil,"Sine",0.1,true)
  337. wait(1)
  338. if toggleAllSlider.Position.X.Scale<.01 then
  339. toggleAllSlider:TweenPosition(UDim2.new(0.45,0,0,-2),nil,"Sine",0.1,true)
  340. end
  341. end
  342. end)
  343. allOnBtn.InputBegan:Connect(function()
  344. if game:GetService("UserInputService"):IsMouseButtonPressed(Enum.UserInputType.MouseButton1) then
  345. toggleCashier(true)
  346. toggleCook(true)
  347. toggleBoxer(true)
  348. toggleDelivery(true)
  349. toggleSupplier(true)
  350. toggleAllSlider:TweenPosition(UDim2.new(0.9,0,0,-2),nil,"Sine",0.1,true)
  351. wait(1)
  352. if toggleAllSlider.Position.X.Scale>.88 then
  353. toggleAllSlider:TweenPosition(UDim2.new(0.45,0,0,-2),nil,"Sine",0.1,true)
  354. end
  355. end
  356. end)
  357. kitchenBtn.MouseButton1Click:Connect(function()
  358. settings.stay_in_kitchen = not settings.stay_in_kitchen
  359. kitchenBtn.Text = settings.stay_in_kitchen and "X" or ""
  360. end)
  361. local oldRefillAt=refillAtBox.Text
  362. refillAtBox:GetPropertyChangedSignal("Text"):Connect(function()
  363. if #refillAtBox.Text>2 or refillAtBox.Text:match("%D") then
  364. refillAtBox.Text = oldRefillAt
  365. end
  366. oldRefillAt = refillAtBox.Text
  367. end)
  368. refillAtBox.FocusLost:Connect(function()
  369. if tonumber(refillAtBox.Text) then
  370. settings.refill_at=tonumber(refillAtBox.Text)
  371. end
  372. refillAtBox.Text=tostring(settings.refill_at)
  373. end)
  374. local oldRefillEnd=refillEndBox.Text
  375. refillEndBox:GetPropertyChangedSignal("Text"):Connect(function()
  376. if #refillEndBox.Text>2 or refillEndBox.Text:match("%D") then
  377. refillEndBox.Text = oldRefillEnd
  378. end
  379. oldRefillEnd = refillEndBox.Text
  380. end)
  381. refillEndBox.FocusLost:Connect(function()
  382. if tonumber(refillEndBox.Text) then
  383. settings.refill_end=tonumber(refillEndBox.Text)
  384. end
  385. refillEndBox.Text=tostring(settings.refill_end)
  386. end)
  387. closeBtn.MouseButton1Click:Connect(function() gui:Destroy() end)
  388. closeBtn.MouseEnter:Connect(function() closeBtn.TextColor3=Color3.new(.9,0,0) end)
  389. closeBtn.MouseLeave:Connect(function() closeBtn.TextColor3=Color3.new(1,1,1) end)
  390. saveBtn.MouseButton1Click:Connect(function()
  391. if writefile and messageLbl.Visible==false then
  392. writefile("PizzaFarm.txt",game:GetService("HttpService"):JSONEncode(settings))
  393. messageLbl.Visible=true
  394. wait(2)
  395. messageLbl.Visible=false
  396. end
  397. end)
  398. 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)}
  399. local cameraIndex = 0
  400. centerCamBtn.MouseButton1Click:Connect(function()
  401. cameraIndex = 0
  402. workspace.CurrentCamera.CameraType = "Custom"
  403. end)
  404. leftCamBtn.MouseButton1Click:Connect(function()
  405. cameraIndex = cameraIndex - 1
  406. if cameraIndex < 0 then
  407. cameraIndex = #cameraArray
  408. end
  409. if cameraIndex == 0 then
  410. workspace.CurrentCamera.CameraType="Custom"
  411. else
  412. local cf = cameraArray[cameraIndex]
  413. workspace.CurrentCamera.CameraType="Scriptable"
  414. workspace.CurrentCamera:Interpolate(cf,cf+cf.lookVector*10,0.5)
  415. end
  416. end)
  417. rightCamBtn.MouseButton1Click:Connect(function()
  418. cameraIndex = cameraIndex + 1
  419. if cameraIndex > #cameraArray then
  420. cameraIndex = 0
  421. workspace.CurrentCamera.CameraType="Custom"
  422. else
  423. local cf = cameraArray[cameraIndex]
  424. workspace.CurrentCamera.CameraType="Scriptable"
  425. workspace.CurrentCamera:Interpolate(cf,cf+cf.lookVector*10,0.5)
  426. end
  427. end)
  428.  
  429. --//subroutines
  430. local supplyCounts = {TomatoSauce=99,Cheese=99,Sausage=99,Pepperoni=99,Dough=99,Box=99,Dew=99}
  431. for name in pairs(supplyCounts) do
  432. local lbl = workspace.SupplyCounters[name=="Dew" and "CounterMountainDew" or "Counter"..name].a.SG.Counter
  433. supplyCounts[name]=tonumber(lbl.Text)
  434. lbl.Changed:Connect(function()
  435. supplyCounts[name]=tonumber(lbl.Text)
  436. end)
  437. end
  438.  
  439. local function FindFirstCustomer()
  440. local children = workspace.Customers:GetChildren()
  441. for i=1,#children do
  442. local c = children[i]
  443. if ffc(c,"Head") and ffc(c,"Humanoid") and c.Head.CFrame.Z<102 and ffc(c.Head,"Dialog") and ffc(c.Head.Dialog,"Correct") and ((c.Humanoid.SeatPart and c.Humanoid.SeatPart.Anchored) or (c.Humanoid.SeatPart==nil and (c.Head.Velocity.Z^2)^.5<.0001)) then
  444. return c
  445. end
  446. end
  447. end
  448.  
  449. local boxPtick=0
  450. local boxDtick=0
  451. local function FindBoxes()
  452. local c,o,f
  453. local children = workspace.AllBox:GetChildren()
  454. for i=1,#children do
  455. local b = children[i]
  456. if ffc(b,"HasPizzaInside") or ffc(b,"Pizza") then
  457. if c==nil and b.Name=="BoxClosed" and b.Anchored==false and not b.HasPizzaInside.Value then
  458. c=b
  459. elseif o==nil and b.Name=="BoxOpen" and b.Anchored==false and not b.Pizza.Value then
  460. o=b
  461. elseif f==nil and (b.Name=="BoxOpen" and b.Pizza.Value) or (b.Name=="BoxClosed" and b.HasPizzaInside.Value) then
  462. f=b
  463. end
  464. if c and o and f then
  465. return c,o,f
  466. end
  467. end
  468. end
  469. return c,o,f
  470. end
  471. local function FindBoxingFoods()
  472. local p,d
  473. local children = workspace.BoxingRoom:GetChildren()
  474. for i=1,#children do
  475. local f = children[i]
  476. if not f.Anchored then
  477. if p==nil and f.Name=="Pizza" then
  478. p=f
  479. elseif d==nil and f.Name=="Dew" then
  480. d=f
  481. end
  482. if p and d then
  483. return p,d
  484. end
  485. end
  486. end
  487. return p,d
  488. end
  489.  
  490. local orderDict={["3540529228"]="Cheese",["3540530535"]="Sausage",["3540529917"]="Pepperoni",["2512571151"]="Dew",["2512441325"]="Dew"}
  491. local cookingDict = {Cheese=0,Sausage=0,Pepperoni=0,Dew=0}
  492. local cookPtick=0
  493. local cookDtick=0
  494. local cookWarned=false
  495. local boxerWarned=false
  496. local function getOrders()
  497. local orders={}
  498. local tempCookingDict = {}
  499. for i,v in pairs(cookingDict) do tempCookingDict[i]=v end
  500. local children = workspace.Orders:GetChildren()
  501. for i=1,#children do
  502. local o = orderDict[children[i].SG.ImageLabel.Image:match("%d+$")]
  503. if o then
  504. if tempCookingDict[o]>0 then
  505. --ignores oven pizzas, so new orders are priority
  506. tempCookingDict[o]=tempCookingDict[o]-1
  507. elseif (o=="Dew" and #workspace.AllMountainDew:GetChildren()>0) or (supplyCounts[o]>0 and supplyCounts.TomatoSauce>0 and supplyCounts.Cheese>0) then
  508. --need supplies
  509. orders[#orders+1]=o
  510. end
  511. end
  512. end
  513. return orders
  514. end
  515. local function FindFirstDew()
  516. local children = workspace.AllMountainDew:GetChildren()
  517. for i=1,#children do
  518. if not children[i].Anchored then
  519. return children[i]
  520. end
  521. end
  522. end
  523. local function FindDoughAndWithout(str)
  524. local goodraw,p,raw,trash
  525. local children = workspace.AllDough:GetChildren()
  526. for i = #children, 2, -1 do --shuffle
  527. local j = RNG:NextInteger(1, i)
  528. children[j], children[i] = children[i], children[j]
  529. end
  530. for i=1,#children do
  531. local d = children[i]
  532. if d.Anchored==false and #d:GetChildren()>9 then
  533. if d.IsBurned.Value or d.HasBugs.Value or d.Cold.Value or (d.BrickColor.Name=="Bright orange" and ffc(d,"XBillboard")) then
  534. if trash==nil and d.Position.Y > 0 then
  535. trash=d
  536. end
  537. elseif p==nil and d.BrickColor.Name=="Bright orange" then
  538. p=d
  539. 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
  540. --prefers flat
  541. if d.Mesh.Scale.Y<1.1 then
  542. goodraw=d
  543. else
  544. raw=d
  545. end
  546. end
  547. if goodraw and p and trash then
  548. return goodraw,p,trash
  549. end
  550. end
  551. end
  552. return goodraw or raw,p,trash
  553. end
  554. local function getOvenNear(pos)
  555. local children = workspace.Ovens:GetChildren()
  556. for i=1,#children do
  557. if (children[i].Bottom.Position-pos).magnitude < 1.5 then
  558. return children[i]
  559. end
  560. end
  561. end
  562. local function getDoughNear(pos)
  563. local children = workspace.AllDough:GetChildren()
  564. for i=1,#children do
  565. if (children[i].Position-pos).magnitude < 1.5 then
  566. return children[i]
  567. end
  568. end
  569. end
  570. local function isFullyOpen(oven)
  571. return oven.IsOpen.Value==true and (oven.Door.Meter.RotVelocity.Z^2)^.5<.0001
  572. end
  573.  
  574. 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"}
  575. local supplyButtons = {}
  576. for _,button in ipairs(workspace.SupplyButtons:GetChildren()) do
  577. supplyButtons[bcolorToSupply[button.Unpressed.BrickColor.Name]] = button.Unpressed
  578. end
  579.  
  580. local delTool
  581. local function FindFirstDeliveryTool()
  582. local t
  583. local children = workspace:GetChildren()
  584. for i=1,#children do
  585. local v = children[i]
  586. 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
  587. if ffc(v.Handle,"X10") then
  588. return v
  589. end
  590. t = v
  591. end
  592. end
  593. return t
  594. end
  595. local function getHousePart(address)
  596. local houses = workspace.Houses:GetChildren()
  597. for i=1,#houses do
  598. local h = houses[i]
  599. 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
  600. return h.Upgrades:GetChildren()[1].GivePizza
  601. end
  602. end
  603. end
  604. local delTouched=false
  605. local function forgetDeliveryTool()
  606. if delTool then
  607. if delTool.Parent==player.Backpack then
  608. delTool.Parent = character
  609. end
  610. if delTool.Parent==character then
  611. wait(0.1)
  612. delTool.Parent = workspace
  613. wait(0.1)
  614. end
  615. end
  616. delTool=nil
  617. delTouched=false
  618. if ffc(character,"RightHand") and ffc(character.RightHand,"RightGrip") then
  619. character.RightHand.RightGrip:Destroy()
  620. end
  621. end
  622.  
  623. local function onCharacterAdded(char)
  624. if not char then return end
  625. character=char
  626. root = character:WaitForChild("HumanoidRootPart")
  627. character:WaitForChild("Humanoid"):GetPropertyChangedSignal("WalkSpeed"):Connect(function()
  628. if delTool then
  629. character.Humanoid.WalkSpeed=16
  630. end
  631. end)
  632. end
  633. onCharacterAdded(player.Character or player.CharacterAdded:Wait())
  634. player.CharacterAdded:Connect(onCharacterAdded)
  635.  
  636. local function simTouch(part)
  637. local oldcc = part.CanCollide
  638. local oldcf = part.CFrame
  639. part.CanCollide = false
  640. part.CFrame = root.CFrame
  641. delay(0.01,function()
  642. part.CFrame = oldcf
  643. part.CanCollide = oldcc
  644. end)
  645. end
  646. --//main loop
  647. while gui.Parent do
  648. wait(0.3)
  649. if doCashier then
  650. local c = FindFirstCustomer()
  651. if c then
  652. local dialog = c.Head.Dialog.Correct.ResponseDialog or ''
  653. local rootMoved = false
  654. 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
  655. local order = "MountainDew"
  656. if dialog:sub(-8)=="instead." then
  657. dialog = dialog:sub(-30)
  658. end
  659. if dialog:find("pepperoni",1,true) then
  660. order = "PepperoniPizza"
  661. elseif dialog:find("sausage",1,true) then
  662. order = "SausagePizza"
  663. elseif dialog:find("cheese",1,true) then
  664. order = "CheesePizza"
  665. end
  666.  
  667. workspace.GameService.OrderCompleted:FireServer(c, order, workspace.Register3)
  668. if rootMoved then wait(.1) end
  669. end
  670. end
  671. if doCook then
  672. local order = getOrders()[1]
  673. local topping
  674. if order=="Pepperoni" or order=="Sausage" then topping=order end
  675. local cookD = FindFirstDew()
  676. local raw,cookP,trash
  677. if topping then
  678. --pepperoni order avoids sausage dough and vice verca
  679. raw,cookP,trash = FindDoughAndWithout(topping=="Pepperoni" and "Sausage" or "Pepperoni")
  680. else
  681. raw,cookP,trash = FindDoughAndWithout()
  682. end
  683. local rootMoved = false
  684. local ovens = workspace.Ovens:GetChildren()
  685. for i = #ovens, 2, -1 do --shuffle
  686. local j = RNG:NextInteger(1, i)
  687. ovens[j], ovens[i] = ovens[i], ovens[j]
  688. end
  689. --move final pizza
  690. if cookP and tick()-cookPtick>0.8 then
  691. local oven = getOvenNear(cookP.Position)
  692. if oven==nil or oven.IsOpen.Value then
  693. cookPtick=tick()
  694. 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
  695. workspace.GameService.UpdateObjectProperty:FireServer(true, cookP, "CFrame", CFrame.new(56,4.1,38), remoteKey)
  696. end
  697. end
  698. if order then
  699. if order=="Dew" and cookD and tick()-cookDtick>0.8 then
  700. --move dew if ordered
  701. cookDtick=tick()
  702. 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
  703. workspace.GameService.UpdateObjectProperty:FireServer(true, cookD, "CFrame", CFrame.new(53,4.68,36.5), remoteKey)
  704. elseif order~="Dew" and raw and raw.Parent and supplyCounts[order]>0 and supplyCounts.TomatoSauce>0 and supplyCounts.Cheese>0 then
  705. --make pizza
  706. if raw.Mesh.Scale.Y>1.5 then
  707. 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
  708. workspace.GameService.UpdateObjectProperty:FireServer(true, raw, "CFrame", CFrame.new(RNG:NextNumber(29.6,44.6),3.7,RNG:NextNumber(42.5,48.5)), remoteKey)
  709. wait()
  710. workspace.GameService.SquishDough:FireServer(raw)
  711. else
  712. --make sure it will have an oven
  713. local oven
  714. for _,o in ipairs(ovens) do
  715. if isFullyOpen(o) then
  716. local other = getDoughNear(o.Bottom.Position)
  717. if other==nil or not (other.BrickColor.Name=="Bright orange" and ffc(other.SG.Frame,"TomatoSauce") and ffc(other.SG.Frame,"MeltedCheese")) then
  718. if other then
  719. --replace mistaken dough
  720. 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
  721. workspace.GameService.UpdateObjectProperty:FireServer(true, other, "CFrame", CFrame.new(RNG:NextNumber(29.6,44.6),3.7,RNG:NextNumber(42.5,48.5)), remoteKey)
  722. wait()
  723. end
  724. oven=o
  725. break
  726. end
  727. end
  728. end
  729. if oven and raw.Parent==workspace.AllDough then
  730. --make
  731. 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
  732. workspace.GameService.AddIngredientToPizza:FireServer(raw,"TomatoSauce")
  733. workspace.GameService.AddIngredientToPizza:FireServer(raw,"Cheese")
  734. workspace.GameService.AddIngredientToPizza:FireServer(raw,topping)
  735. workspace.GameService.UpdateObjectProperty:FireServer(true, raw, "CFrame", oven.Bottom.CFrame+Vector3.new(0,0.7,0), remoteKey)
  736. oven.Door.ClickDetector.Detector:FireServer()
  737. --mark as cooking
  738. cookingDict[order]=cookingDict[order]+1
  739. local revoked=false
  740. spawn(function()
  741. raw.AncestryChanged:Wait()
  742. if not revoked then
  743. cookingDict[order]=cookingDict[order]-1
  744. revoked=true
  745. end
  746. end)
  747. delay(40, function()
  748. if not revoked then
  749. cookingDict[order]=cookingDict[order]-1
  750. revoked=true
  751. end
  752. end)
  753. end
  754. end
  755. end
  756. end
  757. --open unnecessarily closed ovens
  758. for _,o in ipairs(ovens) do
  759. local bar = o.Door.Meter.SurfaceGui.ProgressBar.Bar
  760. 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
  761. 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
  762. o.Door.ClickDetector.Detector:FireServer()
  763. break
  764. end
  765. end
  766. --trash
  767. if trash and (trash.IsBurned.Value==false or getOvenNear(trash.Position)==nil or getOvenNear(trash.Position).IsOpen.Value) then
  768. --closed oven breaks if you take burnt out of it
  769. 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
  770. workspace.GameService.UpdateObjectProperty:FireServer(true, trash, "CFrame", CFrame.new(47.9,RNG:NextNumber(-10,-30),72.5), remoteKey)
  771. end
  772. if rootMoved then wait(.1) end
  773. end
  774. if doBoxer then
  775. local boxP,boxD = FindBoxingFoods()
  776. local closedBox,openBox,fullBox = FindBoxes()
  777. local rootMoved = false
  778. if boxD and tick()-boxDtick>0.8 then
  779. boxDtick=tick()
  780. 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
  781. workspace.GameService.UpdateObjectProperty:FireServer(true, boxD, "CFrame", CFrame.new(63,4.9,-1,-1,0,0,0,1,0,0,0,-1), remoteKey)
  782. end
  783. if fullBox then
  784. if fullBox.Name=="BoxOpen" then
  785. 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
  786. workspace.GameService.CloseBox:FireServer(fullBox)
  787. --will be moved next loop
  788. elseif tick()-boxPtick>0.8 then
  789. 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
  790. workspace.GameService.UpdateObjectProperty:FireServer(true, fullBox, "CFrame", CFrame.new(68.2,4.4,-1,-1,0,0,0,1,0,0,0,-1), remoteKey)
  791. boxPtick=tick()
  792. end
  793. end
  794. if closedBox and not openBox then
  795. 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
  796. workspace.GameService.UpdateObjectProperty:FireServer(true, closedBox, "CFrame", CFrame.new(RNG:NextNumber(62.5,70.5),3.5,RNG:NextNumber(11,25)), remoteKey)
  797. wait()
  798. workspace.GameService.OpenBox:FireServer(closedBox)
  799. end
  800. if openBox and boxP then
  801. 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
  802. workspace.GameService.UpdateObjectProperty:FireServer(true, boxP, "Anchored", true, remoteKey)
  803. workspace.GameService.UpdateObjectProperty:FireServer(true, openBox, "Anchored", true, remoteKey)
  804. wait()
  805. workspace.GameService.UpdateObjectProperty:FireServer(true, boxP, "CFrame", openBox.CFrame+Vector3.new(0,-2,0), remoteKey)
  806. wait()
  807. workspace.GameService.AssignPizzaToBox:FireServer(openBox, boxP)
  808. end
  809. if rootMoved then wait(.1) end
  810. end
  811. if doSupplier then
  812. local refill=false
  813. for s,c in pairs(supplyCounts) do
  814. if c <= settings.refill_at then
  815. refill=true
  816. break
  817. end
  818. end
  819. if refill then
  820. local oldcf = root.CFrame
  821. local alt=0
  822. local waiting = false
  823. local waitingTick = 0
  824. local lastBox
  825. while doSupplier do
  826. --check if refill is done otherwise hit buttons
  827. local fulfilled=true
  828. local boxes = workspace.AllSupplyBoxes:GetChildren()
  829. for s,c in pairs(supplyCounts) do
  830. if c<settings.refill_end then
  831. fulfilled=false
  832. local count = 0
  833. if #boxes > 30 then
  834. for i=1,#boxes do
  835. local box = boxes[i]
  836. if bcolorToSupply[box.BrickColor.Name]==s and box.Anchored==false and box.Position.Z < -940 then
  837. count=count+1
  838. end
  839. end
  840. end
  841. if count < 2 then
  842. simTouch(supplyButtons[s])
  843. end
  844. end
  845. end
  846. if fulfilled then
  847. break
  848. end
  849. wait(1.5)
  850. --check if can finish waiting for boxes to move
  851. if waiting and (lastBox.Position.X>42 or tick()-waitingTick>5) then
  852. waiting=false
  853. if lastBox.Position.X<42 then
  854. --clear boxes if stuck
  855. root.CFrame=CFrame.new(20.5,8,-35)
  856. wait(0.1)
  857. local boxes = workspace.AllSupplyBoxes:GetChildren()
  858. for i=1,#boxes do
  859. local box = boxes[i]
  860. if box.Anchored==false and box.Position.Z>-55 then
  861. workspace.GameService.UpdateObjectProperty:FireServer(true, box, "CFrame", CFrame.new(RNG:NextNumber(0,40),RNG:NextNumber(-10,-30),-70), remoteKey)
  862. wait()
  863. end
  864. end
  865. wait(0.1)
  866. end
  867. end
  868. if not waiting then
  869. --move boxes
  870. root.CFrame=CFrame.new(8,12.4,-1020)
  871. wait(0.1)
  872. alt=1-alt
  873. lastBox=nil
  874. local j=0
  875. local boxes = workspace.AllSupplyBoxes:GetChildren()
  876. for i=1,#boxes do
  877. local box = boxes[i]
  878. if box.Anchored==false and box.Position.Z < -940 and bcolorToSupply[box.BrickColor.Name] and supplyCounts[bcolorToSupply[box.BrickColor.Name]]<settings.refill_end then
  879. box.CFrame = CFrame.new(38-4*j,5,-7-5*alt)
  880. workspace.GameService.UpdateObjectProperty:FireServer(true, box, "CFrame", box.CFrame, remoteKey)
  881. lastBox=box
  882. j=j+1
  883. if j>8 then break end
  884. end
  885. end
  886. if alt==0 and lastBox then
  887. waiting=true
  888. waitingTick=tick()
  889. end
  890. end
  891. end
  892. root.CFrame=oldcf
  893. end
  894. end
  895. if doDelivery then
  896. local del = FindFirstDeliveryTool()
  897. if delTool==nil and del then
  898. --get tool
  899. delTool=del
  900. delTool.Handle.CanCollide=false
  901. delTool.Handle.CFrame = root.CFrame
  902. delay(6,forgetDeliveryTool)
  903. elseif delTool and delTool.Parent==character and delTouched==false then
  904. --deliver to house
  905. local housePart = getHousePart(delTool.Name)
  906. if housePart then
  907. delTouched=true
  908. root.CFrame = housePart.CFrame+Vector3.new(0,9,0)
  909. wait(0.3)
  910. end
  911. end
  912. end
  913. local hum = character:FindFirstChild("Humanoid")
  914. if hum and hum.Sit then hum.Jump = true end
  915. end
  916. end)
  917.  
  918. FurnitureMod.Name = "FurnitureMod"
  919. FurnitureMod.Parent = Main
  920. FurnitureMod.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  921. FurnitureMod.Position = UDim2.new(0.540740788, 0, 0.628571451, 0)
  922. FurnitureMod.Size = UDim2.new(0, 117, 0, 42)
  923. FurnitureMod.Font = Enum.Font.SourceSans
  924. FurnitureMod.Text = "FurnitureMod"
  925. FurnitureMod.TextColor3 = Color3.fromRGB(234, 234, 234)
  926. FurnitureMod.TextSize = 14.000
  927. FurnitureMod.MouseButton1Down:connect(function()
  928. plr = game.Players.LocalPlayer
  929. mouse = plr:GetMouse()
  930. mouse.KeyDown:connect(function(key)
  931. if key == "f" then
  932. local Item = game.Players.LocalPlayer:GetMouse().Target.Parent
  933. local Size = Item.PrimaryPart.Size.Y
  934. Item.PrimaryPart.Size = Vector3.new(0,0,0)
  935. local Rotate
  936. local Tilt
  937. Rotate = 0
  938. Tilt = 0
  939. plr = game.Players.LocalPlayer
  940. mouse = plr:GetMouse()
  941. mouse.KeyDown:connect(function(key)
  942. if key == "r" then
  943. Rotate = Rotate + 22.5
  944. end
  945. end)
  946. plr = game.Players.LocalPlayer
  947. mouse = plr:GetMouse()
  948. mouse.KeyDown:connect(function(key)
  949. if key == "t" then
  950. Tilt = Tilt + 22.5
  951. end
  952. end)
  953. spawn(function()
  954. while game:GetService("RunService").RenderStepped:Wait() do
  955. game.Players.LocalPlayer:GetMouse().TargetFilter = Item
  956. Item:SetPrimaryPartCFrame(CFrame.new(math.floor(game.Players.LocalPlayer:GetMouse().Hit.X)+.03,math.ceil(game.Players.LocalPlayer:GetMouse().Hit.Y+(Size/2)-1),math.floor(game.Players.LocalPlayer:GetMouse().Hit.Z)-.03) * CFrame.Angles(math.rad(0),math.rad(Rotate),math.rad(Tilt)))
  957. end
  958. end)
  959. end
  960. end)
  961. end)
  962.  
  963. Close.Name = "Close"
  964. Close.Parent = Main
  965. Close.Active = false
  966. Close.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  967. Close.BackgroundTransparency = 1.000
  968. Close.Position = UDim2.new(0.877777815, 0, 0, 0)
  969. Close.Size = UDim2.new(0, 33, 0, 31)
  970. Close.Font = Enum.Font.SourceSans
  971. Close.Text = "X"
  972. Close.TextColor3 = Color3.fromRGB(250, 25, 4)
  973. Close.TextSize = 20.000
  974. CLose.MouseButton1Down:connect(function()
  975. OpenFrame.Visible = true
  976. Main.Visible = false
  977. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement