Advertisement
meldrednyx

my Gui v3

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