Advertisement
NukeVsCity

Untitled

Mar 28th, 2023
649
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 60.42 KB | None | 0 0
  1. -- Decompiled with the Synapse X Luau decompiler.
  2.  
  3. local v1 = {};
  4. local u1 = nil;
  5. coroutine.wrap(function()
  6.     u1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
  7. end)();
  8. local l__RunService__2 = game:GetService("RunService");
  9. local v3 = {};
  10. function v3.new(p1, p2, p3, p4)
  11.     local v4 = setmetatable(u1.Entity.new(p1, p2, "Customer", p3, p4), {
  12.         __index = function(p5, p6)
  13.             return v3[p6] or u1.Entity[p6];
  14.         end
  15.     });
  16.     v4.state = "WaitingForSeat";
  17.     v4.stateData = {
  18.         seatUID = nil,
  19.         tableUID = nil,
  20.         queuePosition = nil,
  21.         isSitting = false,
  22.         queueGroup = {},
  23.         busyWalking = false,
  24.         foodOrder = nil,
  25.         deliveryPingUI = nil,
  26.         pathToMe = nil,
  27.         celebrityApproachCount = 0
  28.     };
  29.     v4.cachedLeftHipCF = nil;
  30.     v4.cachedRightHipCF = nil;
  31.     v4.chatBox = nil;
  32.     v4.humanoid = v4.model:WaitForChild("Humanoid");
  33.     v4.humanoid.WalkSpeed = v4.data.walkSpeed;
  34.     v4:InitHumanoidAnimations();
  35.     local v5, v6, v7 = ipairs(v4.model:GetDescendants());
  36.     while true do
  37.         v5(v6, v7);
  38.         if not v5 then
  39.             break;
  40.         end;
  41.         v7 = v5;
  42.         if v6:IsA("BasePart") then
  43.             u1.Services.PhysicsService:SetPartCollisionGroup(v6, "NPCGroup");
  44.         end;   
  45.     end;
  46.     if p3.nameCounters["Epic Totem"] > 0 and math.random() < 0.25 then
  47.         v4:EquipLei();
  48.     end;
  49.     if p3.nameCounters["Haunted Statue"] > 0 then
  50.         local v8 = v4.model.Head:FindFirstChildOfClass("Decal");
  51.         if v8 then
  52.             v8.Texture = "http://www.roblox.com/asset/?id=49493144";
  53.         end;
  54.     end;
  55.     if v4.ID == "27" then
  56.         v4:InitSantaCustomer();
  57.     end;
  58.     if v4.ID == "28" then
  59.         v4:InitElfCustomer();
  60.     end;
  61.     if v4.ID == "30" then
  62.         v4:InitAlienCustomer();
  63.     end;
  64.     return v4;
  65. end;
  66. function v3.FromUIDData(p7, p8, p9)
  67.     local v9 = v3.new(p9.ID, p9.UID, p7, p8);
  68.     v9.xVoxel = p9.XVoxel and 1;
  69.     v9.yVoxel = 0;
  70.     v9.zVoxel = p9.ZVoxel and 1;
  71.     v9:UpdateVoxelPosition();
  72.     if v9:BelongsToMyBakery() then
  73.         v9.cachedParent = v9.model.Parent;
  74.         v9.model.Parent = nil;
  75.         local v10, v11, v12 = ipairs(v9.model:GetDescendants());
  76.         while true do
  77.             v10(v11, v12);
  78.             if not v10 then
  79.                 break;
  80.             end;
  81.             v12 = v10;
  82.             if v11:IsA("BasePart") then
  83.                 v11.Transparency = 1;
  84.             end;       
  85.         end;
  86.     end;
  87.     if p9.RichCustomer then
  88.         v9.isRichCustomer = true;
  89.     end;
  90.     v9.model:SetPrimaryPartCFrame(CFrame.new(p8:WorldPositionFromVoxel(v9.xVoxel, v9.yVoxel, v9.zVoxel) + Vector3.new(0, v9.model.PrimaryPart.Size.Y / 2, 0)));
  91.     if not v9:BelongsToMyBakery() then
  92.         v9:CustomerStateChangedByReplication(p9.CurrentState, p9.CurrentStateData);
  93.     end;
  94.     return v9;
  95. end;
  96. function v3.CreateRandomCustomer(p10, p11, p12, p13)
  97.     return u1.Entity.FromUIDData(u1.Variables.MyBakery, p10);
  98. end;
  99. function v3.CreateAlienPortal(p14)
  100.  
  101. end;
  102. local u2 = {};
  103. function v3.DropPresent(p15)
  104.     if u1.Functions.DictionaryLength(u2) >= 10 then
  105.         return;
  106.     end;
  107.     local v13 = u1.Network.Invoke("Santa_RequestPresentUID", p15.UID);
  108.     if not v13 then
  109.         return;
  110.     end;
  111.     if not p15.model or not p15.model.PrimaryPart then
  112.         return;
  113.     end;
  114.     local v14 = game.ReplicatedStorage.Assets.Models.SantaPresent:Clone();
  115.     u1.Services.PhysicsService:SetPartCollisionGroup(v14.PrimaryPart, "PresentGroup");
  116.     v14:SetPrimaryPartCFrame(CFrame.new(p15.model.PrimaryPart.CFrame.p));
  117.     v14.PrimaryPart.Velocity = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5) * 20;
  118.     v14.Parent = workspace.__DEBRIS;
  119.     u2[v13] = v14;
  120.     local v15, v16 = u1.Interact.Add(v14.PrimaryPart, 8);
  121.     v15:Connect(function()
  122.         u1.Network.Fire("Santa_PickUpGift", v13, v14.PrimaryPart.Position);
  123.         v16();
  124.         v14:Destroy();
  125.         u2[v13] = nil;
  126.     end);
  127. end;
  128. u1.Network.Fired("Santa_GiftPickedUp"):Connect(function(p16, p17)
  129.     u1.CustomUIEffects.CreateRewardBillboard(p17, p16);
  130.     u1.SFX.Play(6106143051, p17);
  131. end);
  132. function v3.InitAlienCustomer(p18)
  133.     task.spawn(function()
  134.         p18:CreateAlienPortal();
  135.     end);
  136. end;
  137. function v3.InitElfCustomer(p19)
  138.  
  139. end;
  140. function v3.InitSantaCustomer(p20)
  141.     coroutine.wrap(function()
  142.         while not p20.isDeleted do
  143.             wait(math.random(2, 7));
  144.             if not ({
  145.                 ThinkingAboutOrder = true,
  146.                 DecidedOnOrder = true,
  147.                 WaitingToOrder = true,
  148.                 WaitingForFood = true,
  149.                 EatingFood = true
  150.             })[p20.state] then
  151.                 p20:DropPresent();
  152.             end;       
  153.         end;
  154.     end)();
  155. end;
  156. function v3.DisplayMyClothing(p21, p22)
  157.  
  158. end;
  159. function v3.GetMyTransparency(p23)
  160.     if p23:IsGhostCustomer() then
  161.         return 0.4;
  162.     end;
  163.     return 0;
  164. end;
  165. function v3.ToUIDData(p24)
  166.     return {
  167.         ClassName = "Customer",
  168.         ID = p24.ID,
  169.         UID = p24.UID,
  170.         FloorLevel = p24:GetMyFloor().floorLevel,
  171.         XVoxel = p24.xVoxel,
  172.         YVoxel = p24.yVoxel,
  173.         ZVoxel = p24.zVoxel,
  174.         CurrentState = p24.state
  175.     };
  176. end;
  177. function v3.IsHauntedHorseman(p25)
  178.     return p25.ID == "25";
  179. end;
  180. function v3.IsAlienCustomer(p26)
  181.     return p26.ID == "30";
  182. end;
  183. function v3.InitHumanoidAnimations(p27)
  184.     p27.animations = {};
  185.     p27.runningAnimation = nil;
  186.     local v17 = Instance.new("Animation");
  187.     if not (not p27:IsSpecialCustomer()) or not (not p27:IsGhostCustomer()) or p27:IsHauntedHorseman() then
  188.         v17.AnimationId = "http://www.roblox.com/asset/?id=616006778";
  189.     elseif p27:IsPirateCustomer() then
  190.         v17.AnimationId = "rbxassetid://750785693";
  191.     else
  192.         v17.AnimationId = "rbxassetid://913402848";
  193.     end;
  194.     local v18 = Instance.new("Animation");
  195.     v18.AnimationId = "rbxassetid://507766388";
  196.     local v19 = Instance.new("Animation");
  197.     v19.AnimationId = "rbxassetid://5021239100";
  198.     local v20 = Instance.new("Animation");
  199.     v20.AnimationId = "rbxassetid://5055508570";
  200.     local v21 = Instance.new("Animation");
  201.     v21.AnimationId = "rbxassetid://507770239";
  202.     local v22 = Instance.new("Animation");
  203.     v22.AnimationId = "rbxassetid://5055556552";
  204.     p27.animations.gaming = p27.humanoid:LoadAnimation(v22);
  205.     p27.animations.gaming.Looped = true;
  206.     p27.animations.walking = p27.humanoid:LoadAnimation(v17);
  207.     p27.animations.walking.Looped = true;
  208.     p27.animations.idle = p27.humanoid:LoadAnimation(v18);
  209.     p27.animations.idle.Looped = true;
  210.     p27.animations.eating = p27.humanoid:LoadAnimation(v19);
  211.     p27.animations.eating.Looped = true;
  212.     p27.animations.menu = p27.humanoid:LoadAnimation(v20);
  213.     p27.animations.menu.Looped = true;
  214.     p27.animations.wave = p27.humanoid:LoadAnimation(v21);
  215.     p27.animations.wave.Looped = false;
  216.     v22:Destroy();
  217.     v18:Destroy();
  218.     v19:Destroy();
  219.     v20:Destroy();
  220.     v21:Destroy();
  221.     p27.animations.idle:Play();
  222. end;
  223. function v3.PlayLoadedAnimation(p28, p29)
  224.     p28.runningAnimation = nil;
  225.     for v23, v24 in pairs(p28.animations) do
  226.         v24:Stop();
  227.     end;
  228.     if p28.animations[p29] and p28:ShouldPlayAnimation(p29) then
  229.         if p28:PlayerIsOnMyFloor() then
  230.             p28.animations[p29]:Play();
  231.         end;
  232.         p28.runningAnimation = p29;
  233.     end;
  234. end;
  235. function v3.StopLoadedAnimation(p30, p31)
  236.     if p30.animations[p31] then
  237.         p30.animations[p31]:Stop();
  238.         p30.runningAnimation = nil;
  239.     end;
  240. end;
  241. function v3.PauseCurrentAnimation(p32)
  242.     if not p32.runningAnimation then
  243.         return;
  244.     end;
  245.     p32.animations[p32.runningAnimation]:Stop();
  246. end;
  247. function v3.RestartCurrentAnimation(p33)
  248.     if not p33.runningAnimation then
  249.         return;
  250.     end;
  251.     p33.animations[p33.runningAnimation]:Play();
  252. end;
  253. function v3.Chat(p34, p35, p36, p37)
  254.     if p34.chatBox then
  255.         p34.chatBox:Destroy();
  256.     end;
  257.     p34.chatBox = u1.CustomUIEffects.CustomerChatBox(p34.model:FindFirstChild("Head"), p35);
  258.     if p37 then
  259.         for v25, v26 in pairs(p37) do
  260.             p34.chatBox.MainFrame[v25] = v26;
  261.         end;
  262.     end;
  263.     if not p36 then
  264.         return;
  265.     end;
  266.     return p34.chatBox.MainFrame.Message.MouseButton1Down:Connect(function()
  267.         p36(function()
  268.             if not p34.chatBox then
  269.                 return;
  270.             end;
  271.             p34.chatBox:Destroy();
  272.             p34.chatBox = nil;
  273.         end);
  274.     end);
  275. end;
  276. function v3.CleanupGroupInteract(p38)
  277.     p38:CleanupInteract();
  278.     local v27, v28, v29 = ipairs(p38.stateData.queueGroup);
  279.     while true do
  280.         v27(v28, v29);
  281.         if not v27 then
  282.             break;
  283.         end;
  284.         v29 = v27;
  285.         v28:CleanupInteract(); 
  286.     end;
  287. end;
  288. function v3.StopGroupEmoji(p39)
  289.     p39:StopEmoji();
  290.     local v30, v31, v32 = ipairs(p39.stateData.queueGroup);
  291.     while true do
  292.         v30(v31, v32);
  293.         if not v30 then
  294.             break;
  295.         end;
  296.         v32 = v30;
  297.         v31:StopEmoji();   
  298.     end;
  299. end;
  300. function v3.StopChat(p40)
  301.     if p40.chatBox then
  302.         p40.chatBox:Destroy();
  303.     end;
  304.     p40.chatBox = nil;
  305. end;
  306. function v3.CustomerStateChangedByReplication(p41, p42, p43)
  307.     p41.state = p42;
  308.     p41.currentStateData = p43 or {};
  309.     if p41:BelongsToMyBakery() then
  310.         return;
  311.     end;
  312.     if p41.state == "WalkingToQueueSpot" or p41.state == "WaitingForSeat" then
  313.         p41:Emoji("WaitingForSeat");
  314.         return;
  315.     end;
  316.     p41:StopEmoji();
  317.     if p41.state == "WalkingToExit" then
  318.         p41:Emoji("HappyEmoji");
  319.         p41:StandUp();
  320.         return;
  321.     end;
  322.     local v33 = p41:GetMyBakery();
  323.     local v34 = v33:GetEntityByUID(p41.currentStateData.seatUID);
  324.     if not v34 or not v33:GetEntityByUID(p41.currentStateData.tableUID) then
  325.         print("Init replicated state error: no seat leaf or table leaf", p42);
  326.         return;
  327.     end;
  328.     if not p41.stateData.isSitting then
  329.         p41:SitInSeat(v34);
  330.     end;
  331.     if p41.state == "ThinkingAboutOrder" then
  332.         p41:ReadMenu();
  333.         return;
  334.     end;
  335.     if p41.state == "WaitingToOrder" then
  336.         p41:StopReadingMenu();
  337.         p41:Emoji("WaitingToOrder");
  338.         return;
  339.     end;
  340.     if p41.state == "EatingFood" then
  341.         if p43.foodCFrame then
  342.             p41.stateData.foodOrder = u1.Food.new(p43.foodID, p41.UID);
  343.             p41:CreateMyFoodModel(p43.foodCFrame);
  344.             p41:PlayLoadedAnimation("eating");
  345.             return;
  346.         end;
  347.     elseif p41.state == "ReadyToExit" and p41.stateData.foodOrder then
  348.         p41.stateData.foodOrder:DestroyModel();
  349.         p41.stateData.foodOrder = nil;
  350.         p41:StopLoadedAnimation("eating");
  351.     end;
  352. end;
  353. function v3.SetCustomerState(p44, p45)
  354.     if not p44:BelongsToMyBakery() then
  355.         return;
  356.     end;
  357.     p44.state = p45;
  358.     u1.Signal.Fire("MUTATE_CustomerStateChanged", p44.UID, p45, ((function()
  359.         local v35 = {};
  360.         if p45 == "WalkingToQueueSpot" or p45 == "WaitingForSeat" or p45 == "WalkingToSeat" then
  361.             return v35;
  362.         end;
  363.         v35.seatUID = p44.stateData.seatUID;
  364.         v35.tableUID = p44.stateData.tableUID;
  365.         if p45 == "ThinkingAboutOrder" or p45 == "DecidedOnOrder" or p45 == "WaitingToOrder" then
  366.             return v35;
  367.         end;
  368.         if p44.stateData.foodOrder then
  369.             v35.foodID = p44.stateData.foodOrder.ID;
  370.             if p44.stateData.foodOrder.model then
  371.                 v35.foodCFrame = p44.stateData.foodOrder.model:GetPrimaryPartCFrame();
  372.             end;
  373.         end;
  374.         if p45 == "WaitingForFood" then
  375.             return v35;
  376.         end;
  377.         return v35;
  378.     end)()));
  379. end;
  380. function v3.ChangeToWaitingForFoodState(p46, p47)
  381.     p46.stateData.foodOrder = p47;
  382.     p46:PlayLoadedAnimation("idle");
  383.     p46:SetCustomerState("WaitingForFood");
  384. end;
  385. local l__LocalPlayer__3 = game.Players.LocalPlayer;
  386. function v3.ReadyToOrder(p48)
  387.     if p48.state ~= "DecidedOnOrder" then
  388.         return;
  389.     end;
  390.     p48:SetCustomerState("WaitingToOrder");
  391.     p48:PlayLoadedAnimation("idle");
  392.     p48:Emoji("WaitingToOrder", true);
  393.     p48:Interact(function(p49)
  394.         if p48.isDeleted or p48.state ~= "WaitingToOrder" then
  395.             return;
  396.         end;
  397.         u1.Audio.Play(5074101610, l__LocalPlayer__3.PlayerGui);
  398.         local v36 = p48:GetMyFloor():FindOrderStandOnAnyFloor();
  399.         if not v36 then
  400.             u1.Alert.Message("Place an Order Stand to take a customer's order.");
  401.             return;
  402.         end;
  403.         p49();
  404.         p48:StopEmoji();
  405.         local v37 = u1.Food.RandomFoodChoice(p48.UID, p48.ID, p48:IsRichCustomer(), p48:IsPirateCustomer(), p48.isNearTree);
  406.         v36:AddFoodToQueue(v37);
  407.         p48:ChangeToWaitingForFoodState(v37);
  408.         p48:FoodEmoji(v37.ID);
  409.         task.delay(3, function()
  410.             p48:StopEmoji();
  411.         end);
  412.     end);
  413. end;
  414. function v3.SitInSeat(p50, p51)
  415.     local v38 = Vector3.new(0, 1.3, 0);
  416.     if p50:IsAlienCustomer() then
  417.         v38 = v38 + Vector3.new(0, 0.8, 0);
  418.     end;
  419.     local l__PrimaryPart__39 = p51.model.PrimaryPart;
  420.     local v40 = p51:GetFaceDirection();
  421.     local v41 = p51.model.PrimaryPart.SeatAttachment.WorldPosition + v38;
  422.     local v42 = CFrame.new(v41 + v40 * 0.4, v41 + v40);
  423.     p50.stateData.isSitting = true;
  424.     p50.stateData.mySeat = p51;
  425.     p50.model.HumanoidRootPart.Anchored = true;
  426.     if not p50.cachedLeftHipCF then
  427.         p50.cachedLeftHipCF = p50.model.LeftUpperLeg.LeftHip.C0;
  428.         p50.cachedRightHipCF = p50.model.RightUpperLeg.RightHip.C0;
  429.     end;
  430.     u1.Functions.Tween(p50.model.LeftUpperLeg.LeftHip, {
  431.         C0 = CFrame.new(-0.35, -0.5, 0) * CFrame.Angles(1.3089969389957472, 0, 0)
  432.     }, { 0.3, "Quad", "Out" });
  433.     u1.Functions.Tween(p50.model.RightUpperLeg.RightHip, {
  434.         C0 = CFrame.new(0.35, -0.5, 0) * CFrame.Angles(1.3089969389957472, 0, 0)
  435.     }, { 0.3, "Quad", "Out" });
  436.     if p51.ID == "120" then
  437.         task.delay(0.3, function()
  438.             while p50.stateData.isSitting and not p51.isDeleted do
  439.                 local v43 = p51.model.PrimaryPart.SeatAttachment.WorldPosition + v38;
  440.                 p50.model.PrimaryPart.CFrame = CFrame.new(v43 + v40 * 0.4, v43 + v40);
  441.                 u1.Services.RunService.RenderStepped:Wait();           
  442.             end;
  443.         end);
  444.     end;
  445.     return u1.Functions.Tween(p50.model.PrimaryPart, {
  446.         CFrame = v42
  447.     }, { 0.3, "Quad", "Out" });
  448. end;
  449. function v3.ReadMenu(p52)
  450.     if not p52.model then
  451.         return;
  452.     end;
  453.     p52:PlayLoadedAnimation("menu");
  454.     local v44 = game.ReplicatedStorage.Assets.Models.MenuModel:Clone();
  455.     local v45 = Instance.new("Weld");
  456.     v45.Part0 = p52.model.RightHand;
  457.     v45.Part1 = v44.PrimaryPart;
  458.     v45.C0 = CFrame.new(-0.8, -0.4, 0) * CFrame.Angles(0, math.pi, -math.pi / 8);
  459.     v45.Parent = v44.PrimaryPart;
  460.     local v46, v47, v48 = ipairs(v44:GetChildren());
  461.     while true do
  462.         v46(v47, v48);
  463.         if not v46 then
  464.             break;
  465.         end;
  466.         v48 = v46;
  467.         local v49 = Instance.new("WeldConstraint");
  468.         v49.Parent = v44.PrimaryPart;
  469.         v49.Part0 = v44.PrimaryPart;
  470.         v49.Part1 = v47;   
  471.     end;
  472.     v44.Parent = p52.model;
  473.     p52.stateData.menuModel = v44;
  474. end;
  475. function v3.StopReadingMenu(p53)
  476.     p53:StopLoadedAnimation("menu");
  477.     if p53.stateData.menuModel then
  478.         p53.stateData.menuModel = p53.stateData.menuModel:Destroy();
  479.     end;
  480. end;
  481. function v3.ChangeToWaitForOrderState(p54)
  482.     if p54.state ~= "WalkingToSeat" then
  483.         return;
  484.     end;
  485.     local v50 = p54:EntityTable()[p54.stateData.seatUID];
  486.     if v50.isDeleted or p54:EntityTable()[p54.stateData.tableUID].isDeleted then
  487.         p54:ForcedToLeave();
  488.         return;
  489.     end;
  490.     p54:SetCustomerState("ThinkingAboutOrder");
  491.     p54:SitInSeat(v50).Completed:Connect(function()
  492.         p54.humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, true);
  493.         p54.xVoxel = v50.xVoxel;
  494.         p54.zVoxel = v50.zVoxel;
  495.         coroutine.wrap(function()
  496.             wait(0.35);
  497.             p54:ReadMenu();
  498.             if u1.Variables.MyBakery.isTutorial then
  499.                 wait(3.25);
  500.             else
  501.                 wait(7.5 + math.random() * 6);
  502.             end;
  503.             if p54.isDeleted or p54.state ~= "ThinkingAboutOrder" then
  504.                 return;
  505.             end;
  506.             p54:StopReadingMenu();
  507.             p54:SetCustomerState("DecidedOnOrder");
  508.             local v51 = { p54 };
  509.             local v52, v53, v54 = ipairs(p54.stateData.queueGroup);
  510.             while true do
  511.                 v52(v53, v54);
  512.                 if not v52 then
  513.                     break;
  514.                 end;
  515.                 v54 = v52;
  516.                 if not v53.isDeleted then
  517.                     table.insert(v51, v53);
  518.                 end;           
  519.             end;
  520.             local v55 = false;
  521.             local v56, v57, v58 = ipairs(v51);
  522.             while true do
  523.                 v56(v57, v58);
  524.                 if not v56 then
  525.                     break;
  526.                 end;
  527.                 v58 = v56;
  528.                 if v57.state ~= "DecidedOnOrder" then
  529.                     v55 = true;
  530.                     break;
  531.                 end;           
  532.             end;
  533.             if not v55 then
  534.                 local v59, v60, v61 = ipairs(v51);
  535.                 while true do
  536.                     v59(v60, v61);
  537.                     if not v59 then
  538.                         break;
  539.                     end;
  540.                     v61 = v59;
  541.                     v60:ReadyToOrder();            
  542.                 end;
  543.             end;
  544.         end)();
  545.     end);
  546. end;
  547. function v3.ResetAllStates(p55)
  548.  
  549. end;
  550. function v3.ChangeToReadyToExitState(p56, p57)
  551.     p56:SetCustomerState("ReadyToExit");
  552.     p56:PlayLoadedAnimation("idle");
  553.     local v62 = p56:EntityTable()[p56.stateData.seatUID];
  554.     local v63 = p56:GetMyFloor();
  555.     local l__foodOrder__64 = p56.stateData.foodOrder;
  556.     v62.stateData.dish = l__foodOrder__64;
  557.     table.insert(v63.dishChairs, v62);
  558.     l__foodOrder__64:InitMoneyModel((function()
  559.         if not v62.stateData.cachedFaceDirection then
  560.             return math.rad(v62.model.PrimaryPart.Orientation.Y);
  561.         end;
  562.         local l__cachedFaceDirection__65 = v62.stateData.cachedFaceDirection;
  563.         return l__cachedFaceDirection__65 == Vector3.new(1, 0, 0) and math.pi / 2 or (l__cachedFaceDirection__65 == Vector3.new(0, 0, 1) and math.pi or (l__cachedFaceDirection__65 == Vector3.new(-1, 0, 0) and 3 * math.pi / 2 or 0));
  564.     end)() + math.pi / 2, p56:IsVIPCustomer() or (p56:IsRichCustomer() or (p56:IsGhostCustomer() or p56:IsSpecialCustomer())));
  565.     if u1.Gamepasses.Owns(u1.Directory.Gamepasses.AutoCashCollect.ID) and u1.PlayerSettings.IsEnabled("Gamepasses") then
  566.         l__foodOrder__64:MoneyPickedUp();
  567.     end;
  568.     coroutine.wrap(function()
  569.         local v66 = nil;
  570.         if u1.Variables.MyBakery.isTutorial then
  571.             while true do
  572.                 wait();
  573.                 if u1.Variables.MyBakery.tutorial.readyForUserToWash then
  574.                     break;
  575.                 end;           
  576.             end;
  577.             v66 = u1.WorldFX.ArrowPing3D(l__foodOrder__64.model.PrimaryPart);
  578.         end;
  579.         l__foodOrder__64:Interact(function(p58)
  580.             if u1.Variables.MyBakery.isTutorial and not u1.Variables.MyBakery.tutorial.readyForUserToWash then
  581.                 return;
  582.             end;
  583.             if u1.Variables.MyBakery.animatedPath then
  584.                 u1.Alert.Message("You cannot do that right now.");
  585.                 return;
  586.             end;
  587.             local v67 = v63:GatherDishwashersOnAnyFloor(l__foodOrder__64.flaggedDishwasherUID);
  588.             if #v67 == 0 then
  589.                 u1.Alert.Message("All sinks/dishwashers are currently full.");
  590.                 return;
  591.             end;
  592.             local v68 = false;
  593.             local v69, v70, v71 = ipairs(v63.dishChairs);
  594.             while true do
  595.                 v69(v70, v71);
  596.                 if not v69 then
  597.                     break;
  598.                 end;
  599.                 v71 = v69;
  600.                 if v70 == v62 then
  601.                     v68 = true;
  602.                     table.remove(v63.dishChairs, v69);
  603.                     break;
  604.                 end;           
  605.             end;
  606.             if not v68 then
  607.                 u1.Alert.Message("A waiter is already coming to get this dish.");
  608.                 return;
  609.             end;
  610.             if u1.Variables.MyBakery.isTutorial then
  611.                 u1.Signal.Fire("Tutorial_DishPickedUp");
  612.                 if v66 then
  613.                     v66:Destroy();
  614.                 end;
  615.             end;
  616.             if l__foodOrder__64.model then
  617.                 local v72 = { 5205173686, 5205173942 };
  618.                 u1.SFX.Play(v72[math.random(#v72)], l__foodOrder__64.model:GetPrimaryPartCFrame().p);
  619.             end;
  620.             if not v62.isDeleted then
  621.                 v62.stateData.dish = nil;
  622.             end;
  623.             l__foodOrder__64:DestroyModel();
  624.             l__foodOrder__64:CleanupInteract();
  625.             l__foodOrder__64:MoneyPickedUp();
  626.             u1.PlayerAnimations.HoldModel(game.ReplicatedStorage.Assets.BakeryEntityAssets.Food.DirtyDish);
  627.             local v73 = v67[math.random(#v67)];
  628.             local l__stateData__74 = v73.stateData;
  629.             l__stateData__74.dishWasherTargetCount = l__stateData__74.dishWasherTargetCount + 1;
  630.             v73.stateData.dishwasherUI.Enabled = false;
  631.             v73:Emoji("DishEmoji", true);
  632.             v73:Interact(function(p59)
  633.                 v73.stateData.dishwasherUI.Enabled = true;
  634.                 v73:AddDish();
  635.                 u1.Variables.MyBakery:CleanupAnimatedPath();
  636.                 p59();
  637.                 v73:StopEmoji();
  638.                 u1.PlayerAnimations.DropModel();
  639.                 if u1.Variables.MyBakery.isTutorial then
  640.                     u1.Signal.Fire("Tutorial_StartedWashing");
  641.                 end;
  642.                 u1.Network.Fire("AwardBakeryExperienceWithVerification");
  643.             end);
  644.             v62:AnimatePathToEntity(v73);
  645.         end);
  646.     end)();
  647.     local v75 = { p56 };
  648.     local v76, v77, v78 = ipairs(p56.stateData.queueGroup);
  649.     while true do
  650.         v76(v77, v78);
  651.         if not v76 then
  652.             break;
  653.         end;
  654.         v78 = v76;
  655.         table.insert(v75, v77);
  656.     end;
  657.     local v79, v80, v81 = ipairs(v75);
  658.     while true do
  659.         v79(v80, v81);
  660.         if not v79 then
  661.             break;
  662.         end;
  663.         v81 = v79;
  664.         if v80.state ~= "ReadyToExit" then
  665.             return;
  666.         end;   
  667.     end;
  668.     local v82, v83, v84 = ipairs(v75);
  669.     while true do
  670.         v82(v83, v84);
  671.         if not v82 then
  672.             break;
  673.         end;
  674.         v84 = v82;
  675.         if not v83.isDeleted then
  676.             v83:ChangeToExitingState(false, p57);
  677.         end;   
  678.     end;
  679. end;
  680. function v3.RecheckGroupFinishedEating(p60)
  681.     local v85 = { p60 };
  682.     local v86, v87, v88 = ipairs(p60.stateData.queueGroup);
  683.     while true do
  684.         v86(v87, v88);
  685.         if not v86 then
  686.             break;
  687.         end;
  688.         v88 = v86;
  689.         table.insert(v85, v87);
  690.     end;
  691.     local v89, v90, v91 = ipairs(v85);
  692.     while true do
  693.         v89(v90, v91);
  694.         if not v89 then
  695.             break;
  696.         end;
  697.         v91 = v89;
  698.         if v90.state ~= "ReadyToExit" then
  699.             return;
  700.         end;   
  701.     end;
  702.     local v92, v93, v94 = ipairs(v85);
  703.     while true do
  704.         v92(v93, v94);
  705.         if not v92 then
  706.             break;
  707.         end;
  708.         v94 = v92;
  709.         if not v93.isDeleted then
  710.             v93:ChangeToExitingState(false);
  711.         end;   
  712.     end;
  713. end;
  714. function v3.LeaveBakery(p61)
  715.     if p61.isDeleted then
  716.         return;
  717.     end;
  718.     local v95 = p61:EntityTable()[p61.stateData.seatUID];
  719.     if v95 and not v95.isDeleted then
  720.         p61:EntityTable()[p61.stateData.seatUID]:SetIsOccupied(nil);
  721.     end;
  722.     local v96 = p61:GetMyFloor();
  723.     local v97, v98, v99 = ipairs(v96.customers);
  724.     while true do
  725.         v97(v98, v99);
  726.         if not v97 then
  727.             break;
  728.         end;
  729.         v99 = v97;
  730.         if v98 == p61 then
  731.             table.remove(v96.customers, v97);
  732.             break;
  733.         end;   
  734.     end;
  735.     if p61:BelongsToMyBakery() then
  736.         u1.Replication.SendEvent("CustomerDestroyed", p61.UID);
  737.         u1.Variables.MyBakery.activeCelebrity = false;
  738.     end;
  739.     p61:Cleanup();
  740. end;
  741. function v3.ForcedToLeave(p62)
  742.     p62:StopEmoji();
  743.     if not p62:BelongsToMyBakery() then
  744.         return;
  745.     end;
  746.     if p62.stateData.foodOrder then
  747.         if p62.stateData.foodOrder.moneyModel then
  748.             p62.stateData.foodOrder:MoneyPickedUp();
  749.         end;
  750.         p62.stateData.foodOrder:CleanupInteract();
  751.         p62.stateData.foodOrder:DestroyModel();
  752.         p62.stateData.foodOrder.isDeleted = true;
  753.         if p62.stateData.foodOrder.associatedListItem then
  754.             p62.stateData.foodOrder.associatedListItem:Destroy();
  755.         end;
  756.         local v100, v101, v102 = ipairs(u1.Variables.MyBakery.floors);
  757.         while true do
  758.             v100(v101, v102);
  759.             if not v100 then
  760.                 break;
  761.             end;
  762.             v102 = v100;
  763.             local v103, v104, v105 = ipairs((v101:GetEntitiesFromClassAndSubClass("Appliance", "Order Stand")));
  764.             while true do
  765.                 v103(v104, v105);
  766.                 if not v103 then
  767.                     break;
  768.                 end;
  769.                 v105 = v103;
  770.                 v104:CleanupFoodObjectFromBothLists(p62.stateData.foodOrder);          
  771.             end;       
  772.         end;
  773.         p62.stateData.foodOrder = nil;
  774.     end;
  775.     if p62 == p62:GetMyBakery().animatedPathTargetEntity then
  776.         p62:GetMyBakery():CleanupAnimatedPath();
  777.         u1.PlayerAnimations.DropModel();
  778.     end;
  779.     local l__customerQueue__106 = u1.Variables.MyBakery.customerQueue;
  780.     local v107, v108, v109 = ipairs(l__customerQueue__106);
  781.     while true do
  782.         v107(v108, v109);
  783.         if not v107 then
  784.             break;
  785.         end;
  786.         local v110 = false;
  787.         local v111, v112, v113 = ipairs(v108);
  788.         while true do
  789.             v111(v112, v113);
  790.             if not v111 then
  791.                 break;
  792.             end;
  793.             v113 = v111;
  794.             if v112 == p62 then
  795.                 table.remove(v108, v111);
  796.                 v110 = true;
  797.                 if #v108 == 0 then
  798.                     table.remove(l__customerQueue__106, v107);
  799.                 end;
  800.                 break;
  801.             end;       
  802.         end;
  803.         if v110 then
  804.             break;
  805.         end;   
  806.     end;
  807.     local v114, v115, v116 = ipairs(p62.stateData.queueGroup);
  808.     while true do
  809.         v114(v115, v116);
  810.         if not v114 then
  811.             break;
  812.         end;
  813.         v116 = v114;
  814.         if not v115.isDeleted then
  815.             local v117, v118, v119 = ipairs(v115.stateData.queueGroup);
  816.             while true do
  817.                 v117(v118, v119);
  818.                 if not v117 then
  819.                     break;
  820.                 end;
  821.                 v119 = v117;
  822.                 if p62 == v118 then
  823.                     table.remove(v115.stateData.queueGroup, v117);
  824.                     v115:RecheckGroupFinishedEating();
  825.                     break;
  826.                 end;           
  827.             end;
  828.         end;   
  829.     end;
  830.     p62:CleanupInteract();
  831.     p62:ChangeToExitingState(true);
  832. end;
  833. function v3.IsVIPCustomer(p63)
  834.     return p63.ID == "13";
  835. end;
  836. function v3.IsSpecialCustomer(p64)
  837.     return p64.ID == "14";
  838. end;
  839. function v3.IsPirateCustomer(p65)
  840.     return p65.ID == "21";
  841. end;
  842. function v3.IsGhostCustomer(p66)
  843.     return p66.ID == "15";
  844. end;
  845. function v3.IsCelebrityCustomer(p67)
  846.     return p67.ID == "20";
  847. end;
  848. function v3.IsRichCustomer(p68)
  849.     return p68.isRichCustomer;
  850. end;
  851. function v3.StandUp(p69)
  852.     p69.stateData.isSitting = false;
  853.     p69.model.HumanoidRootPart.Anchored = false;
  854.     p69.humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, false);
  855.     if p69.cachedLeftHipCF and p69.cachedRightHipCF then
  856.         p69.model.LeftUpperLeg.LeftHip.C0 = p69.cachedLeftHipCF;
  857.         p69.model.RightUpperLeg.RightHip.C0 = p69.cachedRightHipCF;
  858.     end;
  859. end;
  860. function v3.ChangeToExitingState(p70, p71, p72)
  861.     if p70.isDeleted then
  862.         return;
  863.     end;
  864.     p70.leaving = true;
  865.     p70:SetCustomerState("WalkingToExit");
  866.     local v120 = p70:EntityTable()[p70.stateData.tableUID];
  867.     if v120 and not v120.isDeleted then
  868.         v120:RemoveCustomerFromTable(p70);
  869.     end;
  870.     local u4 = p70:GetMyFloor();
  871.     coroutine.wrap(function()
  872.         if not p71 and (math.random() < 0.3 or u1.Variables.MyBakery.isTutorial) then
  873.             p70:TimedEmoji("HappyEmoji", 2.5);
  874.         end;
  875.         p70:StandUp();
  876.         local v121 = false;
  877.         local v122 = false;
  878.         local v123 = false;
  879.         local v124 = false;
  880.         local v125 = false;
  881.         local v126 = false;
  882.         local v127 = false;
  883.         if not p71 then
  884.             local v128 = u4:GetEntitiesFromClassAndSubClass("Appliance", "Tip Jar");
  885.             if #v128 > 0 then
  886.                 local v129, v130, v131 = ipairs(v128);
  887.                 while true do
  888.                     v129(v130, v131);
  889.                     if not v129 then
  890.                         break;
  891.                     end;
  892.                     v131 = v129;
  893.                     if v130.ID == "14" then
  894.                         local v132 = 0.05;
  895.                     elseif v130.ID == "19" then
  896.                         v132 = 0.5;
  897.                     elseif v130.ID == "26" then
  898.                         v132 = 0.4;
  899.                     else
  900.                         v132 = 0;
  901.                     end;
  902.                     if math.random() < v132 then
  903.                         v121 = true;
  904.                         p70:WalkToPoint(v130.xVoxel, v130.yVoxel, v130.zVoxel, function()
  905.                             if not v130.isDeleted and not p70.isDeleted and p70.stateData and p70.stateData.foodOrder then
  906.                                 p70:TimedEmoji("VeryHappyEmoji", 2.5);
  907.                                 u1.Network.Fire("AwardTipWithVerification", p70.UID, v130.UID, p70.stateData.foodOrder.ID);
  908.                                 u1.SFX.Play(5839737230, v130.model.PrimaryPart);
  909.                                 p70:FaceEntity(v130);
  910.                                 wait(0.3);
  911.                                 p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  912.                                     local v133, v134, v135 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  913.                                     p70:WalkToPoint(v133, v134, v135, function()
  914.                                         p70:FadeTransparency(1, function()
  915.                                             p70:LeaveBakery();
  916.                                         end);
  917.                                     end, nil, true);
  918.                                 end);
  919.                                 return;
  920.                             end;
  921.                             p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  922.                                 local v136, v137, v138 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  923.                                 p70:WalkToPoint(v136, v137, v138, function()
  924.                                     p70:FadeTransparency(1, function()
  925.                                         p70:LeaveBakery();
  926.                                     end);
  927.                                 end, nil, true);
  928.                             end);
  929.                         end);
  930.                         break;
  931.                     end;
  932.                     if p72 then
  933.                         v121 = true;
  934.                         p70:WalkToPoint(v130.xVoxel, v130.yVoxel, v130.zVoxel, function()
  935.                             if not v130.isDeleted and not p70.isDeleted and p70.stateData and p70.stateData.foodOrder then
  936.                                 p70:TimedEmoji("VeryHappyEmoji", 2.5);
  937.                                 u1.Network.Fire("AwardTipWithVerification", p70.UID, v130.UID, p70.stateData.foodOrder.ID);
  938.                                 u1.SFX.Play(5839737230, v130.model.PrimaryPart);
  939.                                 p70:FaceEntity(v130);
  940.                                 wait(0.3);
  941.                                 p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  942.                                     v133, v134, v135 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  943.                                     p70:WalkToPoint(v133, v134, v135, function()
  944.                                         p70:FadeTransparency(1, function()
  945.                                             p70:LeaveBakery();
  946.                                         end);
  947.                                     end, nil, true);
  948.                                 end);
  949.                                 return;
  950.                             end;
  951.                             p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  952.                                 v136, v137, v138 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  953.                                 p70:WalkToPoint(v136, v137, v138, function()
  954.                                     p70:FadeTransparency(1, function()
  955.                                         p70:LeaveBakery();
  956.                                     end);
  957.                                 end, nil, true);
  958.                             end);
  959.                         end);
  960.                         break;
  961.                     end;
  962.                     if p70:IsVIPCustomer() then
  963.                         v121 = true;
  964.                         p70:WalkToPoint(v130.xVoxel, v130.yVoxel, v130.zVoxel, function()
  965.                             if not v130.isDeleted and not p70.isDeleted and p70.stateData and p70.stateData.foodOrder then
  966.                                 p70:TimedEmoji("VeryHappyEmoji", 2.5);
  967.                                 u1.Network.Fire("AwardTipWithVerification", p70.UID, v130.UID, p70.stateData.foodOrder.ID);
  968.                                 u1.SFX.Play(5839737230, v130.model.PrimaryPart);
  969.                                 p70:FaceEntity(v130);
  970.                                 wait(0.3);
  971.                                 p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  972.                                     v133, v134, v135 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  973.                                     p70:WalkToPoint(v133, v134, v135, function()
  974.                                         p70:FadeTransparency(1, function()
  975.                                             p70:LeaveBakery();
  976.                                         end);
  977.                                     end, nil, true);
  978.                                 end);
  979.                                 return;
  980.                             end;
  981.                             p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  982.                                 v136, v137, v138 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  983.                                 p70:WalkToPoint(v136, v137, v138, function()
  984.                                     p70:FadeTransparency(1, function()
  985.                                         p70:LeaveBakery();
  986.                                     end);
  987.                                 end, nil, true);
  988.                             end);
  989.                         end);
  990.                         break;
  991.                     end;               
  992.                 end;
  993.             end;
  994.         end;
  995.         if not v121 then
  996.             local v139 = u4:GetEntitiesFromClassAndSubClass("Appliance", "CandyBowl");
  997.             if #v139 > 0 then
  998.                 local v140, v141, v142 = ipairs(v139);
  999.                 while true do
  1000.                     v140(v141, v142);
  1001.                     if not v140 then
  1002.                         break;
  1003.                     end;
  1004.                     v142 = v140;
  1005.                     if math.random() < 0.3 and v141.level and v141.level > 0 then
  1006.                         v127 = true;
  1007.                         p70:WalkToPoint(v141.xVoxel, v141.yVoxel, v141.zVoxel, function()
  1008.                             if not v141.isDeleted and p70.stateData and p70.stateData.foodOrder and not (v141.level <= 0) then
  1009.                                 p70:TimedEmoji("VeryHappyEmoji", 2.5);
  1010.                                 u1.Network.Fire("AwardTipWithVerification", p70.UID, v141.UID, p70.stateData.foodOrder.ID);
  1011.                                 u1.SFX.Play(5057746151, v141.model.PrimaryPart);
  1012.                                 p70:FaceEntity(v141);
  1013.                                 wait(0.3);
  1014.                                 p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  1015.                                     local v143, v144, v145 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  1016.                                     p70:WalkToPoint(v143, v144, v145, function()
  1017.                                         p70:FadeTransparency(1, function()
  1018.                                             p70:LeaveBakery();
  1019.                                         end);
  1020.                                     end, nil, true);
  1021.                                 end);
  1022.                                 return;
  1023.                             end;
  1024.                             p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  1025.                                 local v146, v147, v148 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  1026.                                 p70:WalkToPoint(v146, v147, v148, function()
  1027.                                     p70:FadeTransparency(1, function()
  1028.                                         p70:LeaveBakery();
  1029.                                     end);
  1030.                                 end, nil, true);
  1031.                             end);
  1032.                         end);
  1033.                         break;
  1034.                     end;               
  1035.                 end;
  1036.             end;
  1037.         end;
  1038.         if not v121 and not v127 then
  1039.             local v149 = u4:GetEntitiesFromClassAndSubClass("Appliance", "GumballMachine");
  1040.             if #v149 > 0 then
  1041.                 local v150, v151, v152 = ipairs(v149);
  1042.                 while true do
  1043.                     v150(v151, v152);
  1044.                     if not v150 then
  1045.                         break;
  1046.                     end;
  1047.                     v152 = v150;
  1048.                     if math.random() < 0.1 then
  1049.                         v122 = true;
  1050.                         local v153, v154, v155 = v151:GetFacePosition();
  1051.                         if not u4:IsValidVoxel(v153, v154, v155) then
  1052.                             v153 = v151.xVoxel;
  1053.                             v154 = v151.yVoxel;
  1054.                             v155 = v151.zVoxel;
  1055.                         end;
  1056.                         p70:WalkToPoint(v153, v154, v155, function()
  1057.                             if v151.isDeleted or p70.isDeleted then
  1058.                                 p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  1059.                                     local v156, v157, v158 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  1060.                                     p70:WalkToPoint(v156, v157, v158, function()
  1061.                                         p70:FadeTransparency(1, function()
  1062.                                             p70:LeaveBakery();
  1063.                                         end);
  1064.                                     end, nil, true);
  1065.                                 end);
  1066.                                 return;
  1067.                             end;
  1068.                             if p70.stateData.foodOrder then
  1069.                                 u1.Network.Fire("AwardTipWithVerification", p70.UID, v151.UID, p70.stateData.foodOrder.ID);
  1070.                             end;
  1071.                             u1.SFX.Play(5205171179, v151.model.PrimaryPart.Position);
  1072.                             p70:TimedEmoji("VeryHappyEmoji", 2.5);
  1073.                             p70:FaceEntity(v151);
  1074.                             wait(0.3);
  1075.                             p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  1076.                                 local v159, v160, v161 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  1077.                                 p70:WalkToPoint(v159, v160, v161, function()
  1078.                                     p70:FadeTransparency(1, function()
  1079.                                         p70:LeaveBakery();
  1080.                                     end);
  1081.                                 end, nil, true);
  1082.                             end);
  1083.                         end);
  1084.                         break;
  1085.                     end;               
  1086.                 end;
  1087.             end;
  1088.         end;
  1089.         if not v121 and not v122 and not v127 then
  1090.             local v162 = u4:GetEntitiesFromClassAndSubClass("Appliance", "CandyMachine");
  1091.             if #v162 > 0 then
  1092.                 local v163, v164, v165 = ipairs(v162);
  1093.                 while true do
  1094.                     v163(v164, v165);
  1095.                     if not v163 then
  1096.                         break;
  1097.                     end;
  1098.                     v165 = v163;
  1099.                     if math.random() < 0.1 then
  1100.                         v123 = true;
  1101.                         local v166, v167, v168 = v164:GetFacePosition();
  1102.                         if not u4:IsValidVoxel(v166, v167, v168) then
  1103.                             v166 = v164.xVoxel;
  1104.                             v167 = v164.yVoxel;
  1105.                             v168 = v164.zVoxel;
  1106.                         end;
  1107.                         p70:WalkToPoint(v166, v167, v168, function()
  1108.                             if v164.isDeleted or p70.isDeleted then
  1109.                                 p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  1110.                                     local v169, v170, v171 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  1111.                                     p70:WalkToPoint(v169, v170, v171, function()
  1112.                                         p70:FadeTransparency(1, function()
  1113.                                             p70:LeaveBakery();
  1114.                                         end);
  1115.                                     end, nil, true);
  1116.                                 end);
  1117.                                 return;
  1118.                             end;
  1119.                             u1.SFX.Play(5601560734, v164.model.PrimaryPart);
  1120.                             if p70.stateData.foodOrder then
  1121.                                 u1.Network.Fire("AwardTipWithVerification", p70.UID, v164.UID, p70.stateData.foodOrder.ID);
  1122.                             end;
  1123.                             p70:TimedEmoji("VeryHappyEmoji", 2.5);
  1124.                             p70:FaceEntity(v164);
  1125.                             wait(0.3);
  1126.                             p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  1127.                                 local v172, v173, v174 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  1128.                                 p70:WalkToPoint(v172, v173, v174, function()
  1129.                                     p70:FadeTransparency(1, function()
  1130.                                         p70:LeaveBakery();
  1131.                                     end);
  1132.                                 end, nil, true);
  1133.                             end);
  1134.                         end);
  1135.                         break;
  1136.                     end;               
  1137.                 end;
  1138.             end;
  1139.         end;
  1140.         if not v121 and not v122 and not v123 and not v127 then
  1141.             local v175 = u4:GetEntitiesFromClassAndSubClass("Appliance", "PopcornMachine");
  1142.             if #v175 > 0 then
  1143.                 local v176, v177, v178 = ipairs(v175);
  1144.                 while true do
  1145.                     v176(v177, v178);
  1146.                     if not v176 then
  1147.                         break;
  1148.                     end;
  1149.                     v178 = v176;
  1150.                     if math.random() < 0.1 then
  1151.                         v125 = true;
  1152.                         local v179, v180, v181 = v177:GetFacePosition();
  1153.                         if not u4:IsValidVoxel(v179, v180, v181) then
  1154.                             v179 = v177.xVoxel;
  1155.                             v180 = v177.yVoxel;
  1156.                             v181 = v177.zVoxel;
  1157.                         end;
  1158.                         p70:WalkToPoint(v179, v180, v181, function()
  1159.                             if v177.isDeleted or p70.isDeleted then
  1160.                                 p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  1161.                                     local v182, v183, v184 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  1162.                                     p70:WalkToPoint(v182, v183, v184, function()
  1163.                                         p70:FadeTransparency(1, function()
  1164.                                             p70:LeaveBakery();
  1165.                                         end);
  1166.                                     end, nil, true);
  1167.                                 end);
  1168.                                 return;
  1169.                             end;
  1170.                             u1.SFX.Play(5625433552, v177.model.PrimaryPart);
  1171.                             if p70.stateData.foodOrder then
  1172.                                 u1.Network.Fire("AwardTipWithVerification", p70.UID, v177.UID, p70.stateData.foodOrder.ID);
  1173.                             end;
  1174.                             p70:TimedEmoji("VeryHappyEmoji", 2.5);
  1175.                             p70:FaceEntity(v177);
  1176.                             wait(0.3);
  1177.                             p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  1178.                                 local v185, v186, v187 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  1179.                                 p70:WalkToPoint(v185, v186, v187, function()
  1180.                                     p70:FadeTransparency(1, function()
  1181.                                         p70:LeaveBakery();
  1182.                                     end);
  1183.                                 end, nil, true);
  1184.                             end);
  1185.                         end);
  1186.                         break;
  1187.                     end;               
  1188.                 end;
  1189.             end;
  1190.         end;
  1191.         if not v121 and not v122 and not v123 and not v125 and not p71 and not v127 then
  1192.             local v188 = u4:GetEntitiesFromClassAndSubClass("Appliance", "SodaMachine");
  1193.             if #v188 > 0 then
  1194.                 local v189, v190, v191 = ipairs(v188);
  1195.                 while true do
  1196.                     v189(v190, v191);
  1197.                     if not v189 then
  1198.                         break;
  1199.                     end;
  1200.                     v191 = v189;
  1201.                     if math.random() < 0.15 then
  1202.                         v126 = true;
  1203.                         local v192, v193, v194 = v190:GetFacePosition();
  1204.                         if not u4:IsValidVoxel(v192, v193, v194) then
  1205.                             v192 = v190.xVoxel;
  1206.                             v193 = v190.yVoxel;
  1207.                             v194 = v190.zVoxel;
  1208.                         end;
  1209.                         p70:WalkToPoint(v192, v193, v194, function()
  1210.                             if v190.isDeleted or p70.isDeleted then
  1211.                                 p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  1212.                                     local v195, v196, v197 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  1213.                                     p70:WalkToPoint(v195, v196, v197, function()
  1214.                                         p70:FadeTransparency(1, function()
  1215.                                             p70:LeaveBakery();
  1216.                                         end);
  1217.                                     end, nil, true);
  1218.                                 end);
  1219.                                 return;
  1220.                             end;
  1221.                             u1.SFX.Play(5708685354, v190.model.PrimaryPart);
  1222.                             if p70.stateData.foodOrder then
  1223.                                 u1.Network.Fire("AwardTipWithVerification", p70.UID, v190.UID, p70.stateData.foodOrder.ID);
  1224.                             end;
  1225.                             p70:TimedEmoji("VeryHappyEmoji", 2.5);
  1226.                             p70:FaceEntity(v190);
  1227.                             wait(0.3);
  1228.                             p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  1229.                                 local v198, v199, v200 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  1230.                                 p70:WalkToPoint(v198, v199, v200, function()
  1231.                                     p70:FadeTransparency(1, function()
  1232.                                         p70:LeaveBakery();
  1233.                                     end);
  1234.                                 end, nil, true);
  1235.                             end);
  1236.                         end);
  1237.                         break;
  1238.                     end;               
  1239.                 end;
  1240.             end;
  1241.         end;
  1242.         if not v121 and not v122 and not v123 and not v125 and not v126 and not p71 and not v127 then
  1243.             local v201 = u4:GetEntitiesFromClassAndSubClass("Furniture", "ArcadeMachine");
  1244.             if #v201 > 0 then
  1245.                 local v202, v203, v204 = ipairs((u1.Functions.RandomIndices(v201)));
  1246.                 while true do
  1247.                     v202(v203, v204);
  1248.                     if not v202 then
  1249.                         break;
  1250.                     end;
  1251.                     v204 = v202;
  1252.                     local v205 = v201[v203];
  1253.                     if v205.arcadeState == "Highscore" and not v205.busy then
  1254.                         v205.busy = true;
  1255.                         v124 = true;
  1256.                         local v206, v207, v208 = v205:GetFacePosition();
  1257.                         if not u4:IsValidVoxel(v206, v207, v208) then
  1258.                             v206 = v205.xVoxel;
  1259.                             v207 = v205.yVoxel;
  1260.                             v208 = v205.zVoxel;
  1261.                         end;
  1262.                         p70:WalkToPoint(v206, v207, v208, function()
  1263.                             if v205.isDeleted or p70.isDeleted then
  1264.                                 p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  1265.                                     local v209, v210, v211 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  1266.                                     p70:WalkToPoint(v209, v210, v211, function()
  1267.                                         p70:FadeTransparency(1, function()
  1268.                                             p70:LeaveBakery();
  1269.                                         end);
  1270.                                     end, nil, true);
  1271.                                 end);
  1272.                                 return;
  1273.                             end;
  1274.                             p70:FaceEntity(v205);
  1275.                             v205:PlayGameWithCustomer(p70);
  1276.                             v205.busy = false;
  1277.                             p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  1278.                                 local v212, v213, v214 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  1279.                                 p70:WalkToPoint(v212, v213, v214, function()
  1280.                                     p70:FadeTransparency(1, function()
  1281.                                         p70:LeaveBakery();
  1282.                                     end);
  1283.                                 end, nil, true);
  1284.                             end);
  1285.                         end);
  1286.                         break;
  1287.                     end;               
  1288.                 end;
  1289.             end;
  1290.         end;
  1291.         local u5 = false;
  1292.         (function()
  1293.             if not v121 and not v122 and not v123 and not v125 and not v124 and not v126 and not v127 then
  1294.                 if u1.Variables.MyBakery.nameCounters["Celebrity Customer"] == 0 then
  1295.                     return;
  1296.                 else
  1297.                     local v215 = u1.Variables.MyBakery:SearchForCelebrity();
  1298.                     if not v215 or not (not v215.isDeleted) or v215.stateData.celebrityApproachCount >= 3 then
  1299.                         return;
  1300.                     elseif not (not v215.isDeleted) or not ({
  1301.                         ThinkingAboutOrder = true,
  1302.                         DecidedOnOrder = true,
  1303.                         WaitingToOrder = true,
  1304.                         WaitingForFood = true,
  1305.                         EatingFood = true
  1306.                     })[v215.state] then
  1307.                         return;
  1308.                     else
  1309.                         u5 = true;
  1310.                         local l__stateData__216 = v215.stateData;
  1311.                         l__stateData__216.celebrityApproachCount = l__stateData__216.celebrityApproachCount + 1;
  1312.                         p70:WalkToNewFloor(v215:GetMyFloor(), function()
  1313.                             if not v215.isDeleted and ({
  1314.                                 ThinkingAboutOrder = true,
  1315.                                 DecidedOnOrder = true,
  1316.                                 WaitingToOrder = true,
  1317.                                 WaitingForFood = true,
  1318.                                 EatingFood = true
  1319.                             })[v215.state] then
  1320.                                 p70:WalkToPoint(v215.xVoxel, v215.yVoxel, v215.zVoxel, function()
  1321.                                     if not (not v215.isDeleted) or not ({
  1322.                                         ThinkingAboutOrder = true,
  1323.                                         DecidedOnOrder = true,
  1324.                                         WaitingToOrder = true,
  1325.                                         WaitingForFood = true,
  1326.                                         EatingFood = true
  1327.                                     })[v215.state] then
  1328.                                         if not v215.isDeleted then
  1329.                                             local l__stateData__217 = v215.stateData;
  1330.                                             l__stateData__217.celebrityApproachCount = l__stateData__217.celebrityApproachCount - 1;
  1331.                                         end;
  1332.                                         p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  1333.                                             local v218, v219, v220 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  1334.                                             p70:WalkToPoint(v218, v219, v220, function()
  1335.                                                 p70:FadeTransparency(1, function()
  1336.                                                     p70:LeaveBakery();
  1337.                                                 end);
  1338.                                             end, nil, true);
  1339.                                         end);
  1340.                                         return;
  1341.                                     end;
  1342.                                     local l__stateData__221 = v215.stateData;
  1343.                                     l__stateData__221.celebrityApproachCount = l__stateData__221.celebrityApproachCount - 1;
  1344.                                     u1.SFX.Play(5278932469, v215.model.PrimaryPart.Position);
  1345.                                     p70:FaceEntity(v215);
  1346.                                     p70:TimedEmoji("Starstruck", 2.5);
  1347.                                     p70:PlayLoadedAnimation("wave");
  1348.                                     wait(2);
  1349.                                     p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  1350.                                         local v222, v223, v224 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  1351.                                         p70:WalkToPoint(v222, v223, v224, function()
  1352.                                             p70:FadeTransparency(1, function()
  1353.                                                 p70:LeaveBakery();
  1354.                                             end);
  1355.                                         end, nil, true);
  1356.                                     end);
  1357.                                 end);
  1358.                                 return;
  1359.                             end;
  1360.                             if not v215.isDeleted then
  1361.                                 local l__stateData__225 = v215.stateData;
  1362.                                 l__stateData__225.celebrityApproachCount = l__stateData__225.celebrityApproachCount - 1;
  1363.                             end;
  1364.                             p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  1365.                                 local v226, v227, v228 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  1366.                                 p70:WalkToPoint(v226, v227, v228, function()
  1367.                                     p70:FadeTransparency(1, function()
  1368.                                         p70:LeaveBakery();
  1369.                                     end);
  1370.                                 end, nil, true);
  1371.                             end);
  1372.                         end);
  1373.                         return;
  1374.                     end;
  1375.                 end;
  1376.             end;
  1377.         end)();
  1378.         if not v121 and not v122 and not u5 and not v123 and not v124 and not v125 and not v127 then
  1379.             p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
  1380.                 local v229, v230, v231 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
  1381.                 p70:WalkToPoint(v229, v230, v231, function()
  1382.                     p70:FadeTransparency(1, function()
  1383.                         p70:LeaveBakery();
  1384.                     end);
  1385.                 end, nil, true);
  1386.             end);
  1387.         end;
  1388.     end)();
  1389. end;
  1390. function v3.CreateMyFoodModel(p73, p74)
  1391.     p73.stateData.foodOrder:MakeModel();
  1392.     p73.stateData.foodOrder:SetModelPrimaryPartCFrame(p74);
  1393. end;
  1394. function v3.ChangeToEatingState(p75)
  1395.     coroutine.wrap(function()
  1396.         local v232 = nil;
  1397.         if p75.state == "EatingFood" then
  1398.             return;
  1399.         end;
  1400.         local v233 = p75:GetMyFloor();
  1401.         table.sort(v233.silverwareTrays, function(p76, p77)
  1402.             return math.abs(p75.xVoxel - p76.xVoxel) + math.abs(p75.zVoxel - p76.zVoxel) < math.abs(p75.xVoxel - p77.xVoxel) + math.abs(p75.zVoxel - p77.zVoxel);
  1403.         end);
  1404.         table.sort(v233.goldSilverwareTrays, function(p78, p79)
  1405.             return math.abs(p75.xVoxel - p78.xVoxel) + math.abs(p75.zVoxel - p78.zVoxel) < math.abs(p75.xVoxel - p79.xVoxel) + math.abs(p75.zVoxel - p79.zVoxel);
  1406.         end);
  1407.         p75:SetCustomerState("EatingFood");
  1408.         if p75.stateData.pathToMe then
  1409.             u1.Variables.MyBakery:CleanupAnimatedPath();
  1410.             p75.stateData.pathToMe = nil;
  1411.         end;
  1412.         local u6 = false;
  1413.         local u7 = false;
  1414.         local u8 = false;
  1415.         if not p75.stateData.foodOrder then
  1416.             p75:ForcedToLeave();
  1417.             return;
  1418.         end;
  1419.         local v234 = p75:EntityTable()[p75.stateData.tableUID];
  1420.         v232 = p75:EntityTable()[p75.stateData.seatUID];
  1421.         if not v234 or not v232 then
  1422.             u1.Print("CRITICAL: COULDN'T FIND CUSTOMERS TABLE WHEN EATING", true);
  1423.             return;
  1424.         end;
  1425.         local v235 = v234:GetMyFloor();
  1426.         local v236 = v235:WorldPositionFromVoxel(v232:GetFacePosition());
  1427.         local l__PrimaryPart__237 = v234.model.PrimaryPart;
  1428.         p75:CreateMyFoodModel((CFrame.new(Vector3.new(v236.X, l__PrimaryPart__237.Position.Y + l__PrimaryPart__237.Size.Y / 2, v236.Z) + (-1.1 * v232:GetFaceDirection() + Vector3.new(0, p75.stateData.foodOrder.data.model.PrimaryPart.Size.Y / 2, 0)))));
  1429.         local u9 = false;
  1430.         local u10 = false;
  1431.         local u11 = false;
  1432.         local function u12(p80, p81)
  1433.             u6 = true;
  1434.             local v238 = false;
  1435.             local v239 = false;
  1436.             local v240, v241, v242 = ipairs(v233.saladBars);
  1437.             while true do
  1438.                 v240(v241, v242);
  1439.                 if not v240 then
  1440.                     break;
  1441.                 end;
  1442.                 v242 = v240;
  1443.                 if math.random() < 0.2 then
  1444.                     if not p80 then
  1445.                         p75:StandUp();
  1446.                     end;
  1447.                     v239 = true;
  1448.                     v238 = true;
  1449.                     local u13 = v239;
  1450.                     local l__xVoxel__14 = p75.xVoxel;
  1451.                     local l__yVoxel__15 = p75.yVoxel;
  1452.                     local l__zVoxel__16 = p75.zVoxel;
  1453.                     p75:WalkToPoint(v241.xVoxel, v241.yVoxel, v241.zVoxel, function()
  1454.                         if v241.isDeleted then
  1455.                             u13 = false;
  1456.                             p75:ForcedToLeave();
  1457.                             return;
  1458.                         end;
  1459.                         p75:FaceEntity(v241);
  1460.                         wait(0.3);
  1461.                         u1.SFX.Play(5708685167, v241.model.PrimaryPart);
  1462.                         u1.Network.Fire("AwardTipWithVerification", p75.UID, v241.UID, p75.stateData.foodOrder.ID, p80);
  1463.                         if not p81 then
  1464.                             u13 = false;
  1465.                             return;
  1466.                         end;
  1467.                         p75:WalkToPoint(l__xVoxel__14, l__yVoxel__15, l__zVoxel__16, function()
  1468.                             u13 = false;
  1469.                             if p75.stateData.mySeat.isDeleted then
  1470.                                 p75:ForcedToLeave();
  1471.                                 return;
  1472.                             end;
  1473.                             p75:SitInSeat(p75.stateData.mySeat);
  1474.                         end);
  1475.                     end);
  1476.                     break;
  1477.                 end;           
  1478.             end;
  1479.             if v239 then
  1480.                 while true do
  1481.                     wait();
  1482.                     if not v239 then
  1483.                         break;
  1484.                     end;               
  1485.                 end;
  1486.             end;
  1487.             return v238;
  1488.         end;
  1489.         local function u17(p82, p83)
  1490.             u7 = true;
  1491.             local v243 = false;
  1492.             local v244 = false;
  1493.             local v245, v246, v247 = ipairs(v233.dessertBars);
  1494.             while true do
  1495.                 v245(v246, v247);
  1496.                 if not v245 then
  1497.                     break;
  1498.                 end;
  1499.                 v247 = v245;
  1500.                 if math.random() < 0.2 then
  1501.                     if not p82 then
  1502.                         p75:StandUp();
  1503.                     end;
  1504.                     v244 = true;
  1505.                     v243 = true;
  1506.                     local u18 = v244;
  1507.                     local l__xVoxel__19 = p75.xVoxel;
  1508.                     local l__yVoxel__20 = p75.yVoxel;
  1509.                     local l__zVoxel__21 = p75.zVoxel;
  1510.                     p75:WalkToPoint(v246.xVoxel, v246.yVoxel, v246.zVoxel, function()
  1511.                         if v246.isDeleted then
  1512.                             u18 = false;
  1513.                             p75:ForcedToLeave();
  1514.                             return;
  1515.                         end;
  1516.                         p75:FaceEntity(v246);
  1517.                         wait(0.3);
  1518.                         u1.SFX.Play(5708685167, v246.model.PrimaryPart);
  1519.                         u1.Network.Fire("AwardTipWithVerification", p75.UID, v246.UID, p75.stateData.foodOrder.ID, p82);
  1520.                         if not p83 then
  1521.                             u18 = false;
  1522.                             return;
  1523.                         end;
  1524.                         p75:WalkToPoint(l__xVoxel__19, l__yVoxel__20, l__zVoxel__21, function()
  1525.                             u18 = false;
  1526.                             if p75.stateData.mySeat.isDeleted then
  1527.                                 p75:ForcedToLeave();
  1528.                                 return;
  1529.                             end;
  1530.                             p75:SitInSeat(p75.stateData.mySeat);
  1531.                         end);
  1532.                     end);
  1533.                     break;
  1534.                 end;           
  1535.             end;
  1536.             if v244 then
  1537.                 while true do
  1538.                     wait();
  1539.                     if not v244 then
  1540.                         break;
  1541.                     end;               
  1542.                 end;
  1543.             end;
  1544.             return v243;
  1545.         end;
  1546.         local function u22(p84, p85)
  1547.             u8 = true;
  1548.             local v248 = false;
  1549.             local v249 = false;
  1550.             local v250, v251, v252 = ipairs(v233.balloonMachines);
  1551.             while true do
  1552.                 v250(v251, v252);
  1553.                 if not v250 then
  1554.                     break;
  1555.                 end;
  1556.                 v252 = v250;
  1557.                 if math.random() < 0.1 then
  1558.                     if not p84 then
  1559.                         p75:StandUp();
  1560.                     end;
  1561.                     v249 = true;
  1562.                     v248 = true;
  1563.                     local u23 = v249;
  1564.                     local l__xVoxel__24 = p75.xVoxel;
  1565.                     local l__yVoxel__25 = p75.yVoxel;
  1566.                     local l__zVoxel__26 = p75.zVoxel;
  1567.                     p75:WalkToPoint(v251.xVoxel, v251.yVoxel, v251.zVoxel, function()
  1568.                         if v251.isDeleted then
  1569.                             u23 = false;
  1570.                             p75:ForcedToLeave();
  1571.                             return;
  1572.                         end;
  1573.                         p75:FaceEntity(v251);
  1574.                         wait(0.3);
  1575.                         local v253 = game.ReplicatedStorage.Assets.Models.CustomerBalloon:Clone();
  1576.                         v253.Parent = p75.model;
  1577.                         v253:SetPrimaryPartCFrame(p75.model.LeftHand.CFrame);
  1578.                         u1.SFX.Play(10244075139, p75.model.PrimaryPart.Position);
  1579.                         local v254 = Instance.new("Attachment");
  1580.                         v254.Name = "CustomerAttachment";
  1581.                         v254.Position = Vector3.new();
  1582.                         v254.Parent = p75.model.LeftHand;
  1583.                         local v255 = Instance.new("AlignPosition");
  1584.                         v255.Parent = v253.Weight.Weight;
  1585.                         v255.Attachment0 = v253.Weight.Weight.CustomerAttachment;
  1586.                         v255.Attachment1 = v254;
  1587.                         v255.MaxForce = 100000000;
  1588.                         v255.MaxVelocity = 100000000;
  1589.                         v255.Responsiveness = 200;
  1590.                         local v256 = { Color3.fromRGB(255, 0, 0), Color3.fromRGB(0, 255, 0), Color3.fromRGB(0, 0, 255), Color3.fromRGB(255, 0, 255), Color3.fromRGB(255, 255, 0), Color3.fromRGB(0, 255, 255) };
  1591.                         local v257 = v256[math.random(#v256)];
  1592.                         v253.Balloon["Inner Balloon Part"].Color = v257;
  1593.                         v253.Balloon.OuterBalloonPart.Color = v257;
  1594.                         if math.random() < 0.5 then
  1595.                             local v258 = 10244074875;
  1596.                         else
  1597.                             v258 = 10244074737;
  1598.                         end;
  1599.                         u1.SFX.Play(v258, v253.Balloon.OuterBalloonPart);
  1600.                         u1.Network.Fire("AwardTipWithVerification", p75.UID, v251.UID, p75.stateData.foodOrder.ID);
  1601.                         if not p85 then
  1602.                             u23 = false;
  1603.                             return;
  1604.                         end;
  1605.                         p75:WalkToPoint(l__xVoxel__24, l__yVoxel__25, l__zVoxel__26, function()
  1606.                             u23 = false;
  1607.                             if p75.stateData.mySeat.isDeleted then
  1608.                                 p75:ForcedToLeave();
  1609.                                 return;
  1610.                             end;
  1611.                             p75:SitInSeat(p75.stateData.mySeat);
  1612.                         end);
  1613.                     end);
  1614.                     break;
  1615.                 end;           
  1616.             end;
  1617.             if v249 then
  1618.                 while true do
  1619.                     wait();
  1620.                     if not v249 then
  1621.                         break;
  1622.                     end;               
  1623.                 end;
  1624.             end;
  1625.             return v248;
  1626.         end;
  1627.         local u27 = {};
  1628.         local u28 = nil;
  1629.         local u29 = nil;
  1630.         if #v235.goldSilverwareTrays > 0 then
  1631.             local v259 = v235.goldSilverwareTrays[1];
  1632.             u9 = true;
  1633.             u10 = true;
  1634.             u11 = v259.UID;
  1635.             p75:StandUp();
  1636.             local l__xVoxel__30 = p75.xVoxel;
  1637.             local l__yVoxel__31 = p75.yVoxel;
  1638.             local l__zVoxel__32 = p75.zVoxel;
  1639.             p75:WalkToPoint(v259.xVoxel, v259.yVoxel, v259.zVoxel, function()
  1640.                 if v259.isDeleted then
  1641.                     u9 = false;
  1642.                     p75:ForcedToLeave();
  1643.                     return;
  1644.                 end;
  1645.                 local v260 = { 5601560377, 5601560515, 5601560641 };
  1646.                 u1.SFX.Play(v260[math.random(#v260)], v259.model.PrimaryPart);
  1647.                 p75:FaceEntity(v259);
  1648.                 wait(0.3);
  1649.                 if not u12(true, false) then
  1650.                     u17(true, false);
  1651.                 end;
  1652.                 u22(true, false);
  1653.                 p75:WalkToPoint(l__xVoxel__30, l__yVoxel__31, l__zVoxel__32, function()
  1654.                     u9 = false;
  1655.                     if p75.stateData.mySeat.isDeleted then
  1656.                         p75:ForcedToLeave();
  1657.                         return;
  1658.                     end;
  1659.                     p75:SitInSeat(p75.stateData.mySeat);
  1660.                     if v259.ID == "25" then
  1661.                         u28 = game.ReplicatedStorage.Assets.Models["Luxury Fork"]:Clone();
  1662.                         u29 = game.ReplicatedStorage.Assets.Models["Luxury Spoon"]:Clone();
  1663.                         u28.Parent = p75.model;
  1664.                         u29.Parent = p75.model;
  1665.                         local v261 = Instance.new("Weld", u28);
  1666.                         v261.Part0 = u28;
  1667.                         v261.Part1 = p75.model.RightHand;
  1668.                         v261.C0 = CFrame.Angles(-math.pi / 2, 0, 0);
  1669.                         table.insert(u27, v261);
  1670.                         local v262 = Instance.new("Weld", u29);
  1671.                         v262.Part0 = u29;
  1672.                         v262.Part1 = p75.model.LeftHand;
  1673.                         v262.C0 = CFrame.Angles(-math.pi / 2, 0, 0);
  1674.                         table.insert(u27, v262);
  1675.                         return;
  1676.                     end;
  1677.                     u28 = game.ReplicatedStorage.Assets.Models["Default Fork"]:Clone();
  1678.                     u29 = game.ReplicatedStorage.Assets.Models["Default Spoon"]:Clone();
  1679.                     u28.Parent = p75.model;
  1680.                     u29.Parent = p75.model;
  1681.                     local v263 = Instance.new("Weld", u28);
  1682.                     v263.Part0 = u28;
  1683.                     v263.Part1 = p75.model.RightHand;
  1684.                     v263.C0 = CFrame.Angles(-math.pi / 2, 0, 0);
  1685.                     table.insert(u27, v263);
  1686.                     local v264 = Instance.new("Weld", u29);
  1687.                     v264.Part0 = u29;
  1688.                     v264.Part1 = p75.model.LeftHand;
  1689.                     v264.C0 = CFrame.Angles(-math.pi / 2, 0, 0);
  1690.                     table.insert(u27, v264);
  1691.                 end);
  1692.             end);
  1693.         elseif #v235.silverwareTrays > 0 then
  1694.             local v265 = false;
  1695.             for v266 = 1, #v235.silverwareTrays do
  1696.                 if math.random() < 0.2 then
  1697.                     v265 = true;
  1698.                 end;
  1699.             end;
  1700.             if v265 then
  1701.                 local v267 = v235.silverwareTrays[1];
  1702.                 u9 = true;
  1703.                 u10 = true;
  1704.                 u11 = v267.UID;
  1705.                 p75:StandUp();
  1706.                 local l__xVoxel__33 = p75.xVoxel;
  1707.                 local l__yVoxel__34 = p75.yVoxel;
  1708.                 local l__zVoxel__35 = p75.zVoxel;
  1709.                 p75:WalkToPoint(v267.xVoxel, v267.yVoxel, v267.zVoxel, function()
  1710.                     if v267.isDeleted then
  1711.                         u9 = false;
  1712.                         p75:ForcedToLeave();
  1713.                         return;
  1714.                     end;
  1715.                     local v268 = { 5601560377, 5601560515, 5601560641 };
  1716.                     u1.SFX.Play(v268[math.random(#v268)], v267.model.PrimaryPart);
  1717.                     p75:FaceEntity(v267);
  1718.                     wait(0.3);
  1719.                     if not u12(true, false) then
  1720.                         u17(true, false);
  1721.                     end;
  1722.                     u22(true, false);
  1723.                     p75:WalkToPoint(l__xVoxel__33, l__yVoxel__34, l__zVoxel__35, function()
  1724.                         u9 = false;
  1725.                         if p75.stateData.mySeat.isDeleted then
  1726.                             p75:ForcedToLeave();
  1727.                             return;
  1728.                         end;
  1729.                         p75:SitInSeat(p75.stateData.mySeat);
  1730.                         if v267.ID == "25" then
  1731.                             u28 = game.ReplicatedStorage.Assets.Models["Luxury Fork"]:Clone();
  1732.                             u29 = game.ReplicatedStorage.Assets.Models["Luxury Spoon"]:Clone();
  1733.                             u28.Parent = p75.model;
  1734.                             u29.Parent = p75.model;
  1735.                             local v269 = Instance.new("Weld", u28);
  1736.                             v269.Part0 = u28;
  1737.                             v269.Part1 = p75.model.RightHand;
  1738.                             v269.C0 = CFrame.Angles(-math.pi / 2, 0, 0);
  1739.                             table.insert(u27, v269);
  1740.                             local v270 = Instance.new("Weld", u29);
  1741.                             v270.Part0 = u29;
  1742.                             v270.Part1 = p75.model.LeftHand;
  1743.                             v270.C0 = CFrame.Angles(-math.pi / 2, 0, 0);
  1744.                             table.insert(u27, v270);
  1745.                             return;
  1746.                         end;
  1747.                         u28 = game.ReplicatedStorage.Assets.Models["Default Fork"]:Clone();
  1748.                         u29 = game.ReplicatedStorage.Assets.Models["Default Spoon"]:Clone();
  1749.                         u28.Parent = p75.model;
  1750.                         u29.Parent = p75.model;
  1751.                         local v271 = Instance.new("Weld", u28);
  1752.                         v271.Part0 = u28;
  1753.                         v271.Part1 = p75.model.RightHand;
  1754.                         v271.C0 = CFrame.Angles(-math.pi / 2, 0, 0);
  1755.                         table.insert(u27, v271);
  1756.                         local v272 = Instance.new("Weld", u29);
  1757.                         v272.Part0 = u29;
  1758.                         v272.Part1 = p75.model.LeftHand;
  1759.                         v272.C0 = CFrame.Angles(-math.pi / 2, 0, 0);
  1760.                         table.insert(u27, v272);
  1761.                     end);
  1762.                 end);
  1763.             end;
  1764.         end;
  1765.         if u9 then
  1766.             while true do
  1767.                 wait();
  1768.                 if not u9 then
  1769.                     break;
  1770.                 end;           
  1771.             end;
  1772.         end;
  1773.         if not u6 and not u12(false, true) then
  1774.             u17(false, true);
  1775.         end;
  1776.         if not u8 then
  1777.             u22(false, true);
  1778.         end;
  1779.         p75:PlayLoadedAnimation("eating");
  1780.         u1.SFX.Play(5205174537, p75.model.PrimaryPart, nil, 0.6);
  1781.         if math.random() < 0.5 then
  1782.             local v273 = 5029600710;
  1783.         else
  1784.             v273 = 5029600543;
  1785.         end;
  1786.         p75.stateData.loopedEatingSound = u1.SFX.Play(v273, p75.model.PrimaryPart, 1 + (math.random() - 0.5) * 0.1, 0.85, 35, nil, true);
  1787.         coroutine.wrap(function()
  1788.             local v274 = u1.Network.Invoke("WaitForEatTime", p75.ID, p75.UID, u11);
  1789.             if not p75.isDeleted and p75.state == "EatingFood" then
  1790.                 if p75.stateData.loopedEatingSound then
  1791.                     p75.stateData.loopedEatingSound = p75.stateData.loopedEatingSound:Destroy();
  1792.                 end;
  1793.                 p75.stateData.foodOrder:ChangeToDirtyDish();
  1794.                 p75:StopLoadedAnimation("eating");
  1795.                 p75:ChangeToReadyToExitState(v274);
  1796.                 if u28 then
  1797.                     u28:Destroy();
  1798.                     u29:Destroy();
  1799.                     local v275, v276, v277 = ipairs(u27);
  1800.                     while true do
  1801.                         v275(v276, v277);
  1802.                         if not v275 then
  1803.                             break;
  1804.                         end;
  1805.                         v277 = v275;
  1806.                         v276:Destroy();                
  1807.                     end;
  1808.                     u27 = {};
  1809.                 end;
  1810.             end;
  1811.         end)();
  1812.     end)();
  1813. end;
  1814. function v3.PingForFoodDelivery(p86)
  1815.     p86:Emoji("ServeEmoji");
  1816.     p86:Interact(function(p87)
  1817.         if (l__LocalPlayer__3.Character:GetModelCFrame().p - p86.model.PrimaryPart.Position).Magnitude > 12 then
  1818.             return;
  1819.         end;
  1820.         if u1.Variables.MyBakery.isTutorial then
  1821.             u1.Signal.Fire("Tutorial_FinishedServing");
  1822.         end;
  1823.         u1.SFX.Play(5074101610, l__LocalPlayer__3.PlayerGui);
  1824.         p87();
  1825.         p86:StopEmoji();
  1826.         u1.PlayerAnimations.DropModel();
  1827.         if l__LocalPlayer__3:FindFirstChild("__ACTIVATED_CARRY") then
  1828.             l__LocalPlayer__3.__ACTIVATED_CARRY:Destroy();
  1829.         end;
  1830.         u1.Network.Fire("AwardBakeryExperienceWithVerification");
  1831.         p86:ChangeToEatingState();
  1832.     end);
  1833. end;
  1834. function v3.GoToTargetChair(p88)
  1835.     local v278 = nil;
  1836.     if p88.isDeleted then
  1837.         return;
  1838.     end;
  1839.     if not p88.stateData.seatUID then
  1840.         u1.Print("Error: Can't sit customer at chair because it is unassigned", true);
  1841.         p88:ForcedToLeave();
  1842.         return;
  1843.     end;
  1844.     if not p88.stateData.tableUID then
  1845.         u1.Print("Error: can't sit customer at table because it is unassigned", true);
  1846.         p88:ForcedToLeave();
  1847.         return;
  1848.     end;
  1849.     if p88.state ~= "WaitingForSeat" then
  1850.         return;
  1851.     end;
  1852.     p88:SetCustomerState("WalkingToSeat");
  1853.     if math.random() < 0.15 or u1.Variables.MyBakery.isTutorial then
  1854.         p88:TimedEmoji("HappyEmoji", 1.75);
  1855.     end;
  1856.     local v279 = p88:GetMyFloor();
  1857.     local v280 = p88:EntityTable()[p88.stateData.seatUID];
  1858.     v278 = p88:EntityTable()[p88.stateData.tableUID];
  1859.     if not v280 or not v278 then
  1860.         p88:ForcedToLeave();
  1861.         return;
  1862.     end;
  1863.     p88:WalkToNewFloor(v280:GetMyFloor(), function()
  1864.         p88:WalkToPoint(v280.xVoxel, v280.yVoxel, v280.zVoxel, function()
  1865.             if v280.isDeleted or v278.isDeleted then
  1866.                 p88:ForcedToLeave();
  1867.                 return;
  1868.             end;
  1869.             p88:FaceEntity(v280);
  1870.             wait(0.3);
  1871.             if not u1.Variables.MyBakery.isOpen then
  1872.                 p88:ForcedToLeave();
  1873.                 return;
  1874.             end;
  1875.             p88:ChangeToWaitForOrderState();
  1876.         end, true);
  1877.     end);
  1878. end;
  1879. function v3.EquipLei(p89)
  1880.     local v281 = Instance.new("Part");
  1881.     v281.Name = "LeiPart";
  1882.     v281.formFactor = 0;
  1883.     v281.Size = Vector3.new(0, -0.25, 0);
  1884.     v281.BottomSurface = 0;
  1885.     v281.TopSurface = 0;
  1886.     v281.Locked = true;
  1887.     v281.CanCollide = false;
  1888.     v281.Parent = p89.model;
  1889.     game.ReplicatedStorage.Assets.Models.LeiMesh:Clone().Parent = v281;
  1890.     local v282 = Instance.new("Weld");
  1891.     v282.Part0 = v281;
  1892.     v282.Part1 = p89.model.Head;
  1893.     v282.C0 = CFrame.new(0, -0.65, 0);
  1894.     v282.Parent = v281;
  1895. end;
  1896. local function u36(p90, p91, p92, p93)
  1897.     local v283 = p90:GetMyFloor();
  1898.     local v284 = u1.Pathfinding.CalculatePath(v283:GenerateObstacleTable(), p90.xVoxel, p90.zVoxel, p91, p93);
  1899.     local v285 = {};
  1900.     local v286, v287, v288 = ipairs(v284);
  1901.     while true do
  1902.         v286(v287, v288);
  1903.         if not v286 then
  1904.             break;
  1905.         end;
  1906.         v288 = v286;
  1907.         table.insert(v285, v283:WorldPositionFromVoxel(v287.x, p90.yVoxel, v287.y));   
  1908.     end;
  1909.     return v284, v285;
  1910. end;
  1911. function v3.WalkToPoint(p94, p95, p96, p97, p98)
  1912.     if p94.stateData.busyWalking then
  1913.         return;
  1914.     end;
  1915.     p94.stateData.busyWalking = true;
  1916.     p94:PlayLoadedAnimation("walking");
  1917.     local v289, v290 = u36(p94, p95, p96, p97);
  1918.     local v291 = {};
  1919.     coroutine.wrap(function()
  1920.         if p94:BelongsToMyBakery() then
  1921.             u1.Replication.SendEvent("NPCWalkingFromPointToPoint", p94.UID, v289);
  1922.         end;
  1923.         p94:WalkThroughWaypoints(v289, v290, p94.xVoxel, p94.zVoxel);
  1924.         p94.stateData.busyWalking = false;
  1925.         coroutine.wrap(function()
  1926.             p94:NetworkMyVoxelPosition();
  1927.         end)();
  1928.         p94:StopLoadedAnimation("walking");
  1929.         p94:PlayLoadedAnimation("idle");
  1930.         if p98 then
  1931.             p98();
  1932.         end;
  1933.     end)();
  1934. end;
  1935. function v3.WalkToNewFloor(p99, p100, p101)
  1936.     local v292 = p99:GetMyFloor();
  1937.     if p100 and v292.floorLevel ~= p100.floorLevel then
  1938.         p99:WalkToPoint(v292.floorTransitionXVoxel, p99.yVoxel, v292.floorTransitionZVoxel, function()
  1939.             p99:FadeTransparency(1, function()
  1940.                 p99:TransitionToDifferentFloor(p100);
  1941.                 p99:FadeTransparency(p99:GetMyTransparency(), function()
  1942.                     if p101 then
  1943.                         p101();
  1944.                     end;
  1945.                 end);
  1946.             end);
  1947.         end, false, true);
  1948.         return;
  1949.     end;
  1950.     if p101 then
  1951.         p101();
  1952.     end;
  1953. end;
  1954. function v3.WalkToPointInQueue(p102, p103, p104, p105, p106)
  1955.     p104 = p104 and 0;
  1956.     if p102.isDeleted then
  1957.         return;
  1958.     end;
  1959.     if p102.stateData.busyWalking then
  1960.         return;
  1961.     end;
  1962.     p102.stateData.busyWalking = true;
  1963.     p102:PlayLoadedAnimation("walking");
  1964.     local v293 = p102:GetMyFloor():WorldPositionFromVoxel(p103, p102.yVoxel, p105);
  1965.     if p102:BelongsToMyBakery() and p102.stateData.queueGroup then
  1966.         local v294 = nil;
  1967.         local v295 = #p102.stateData.queueGroup + 1;
  1968.         v294 = CFrame.Angles(0, p102:GetMyBakery().baseAngle, 0);
  1969.         if v295 == 1 then
  1970.             v293 = v293 + (v294 * CFrame.new(2, 0, 0)).p;
  1971.         elseif v295 == 3 then
  1972.             v293 = v293 + (v294 * CFrame.new(-2, 0, 0)).p;
  1973.         end;
  1974.     end;
  1975.     if p102:BelongsToMyBakery() then
  1976.         u1.Replication.SendEvent("NPCWalkingFromPointToPointWithoutPathfinding", p102.UID, p103, p105);
  1977.     end;
  1978.     coroutine.wrap(function()
  1979.         p102.humanoid:MoveTo(v293);
  1980.         p102.humanoid.MoveToFinished:Wait();
  1981.         p102.xVoxel = p103;
  1982.         p102.zVoxel = p105;
  1983.         p102:NetworkMyVoxelPosition();
  1984.         p102:GetMyFloor():BroadcastNPCPositionChange(p102, p102.xVoxel, p102.zVoxel);
  1985.         p102.stateData.busyWalking = false;
  1986.         p102:StopLoadedAnimation("walking");
  1987.         p102:PlayLoadedAnimation("idle");
  1988.         if p106 then
  1989.             p106();
  1990.         end;
  1991.     end)();
  1992. end;
  1993. return v3;
  1994.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement