Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Decompiled with the Synapse X Luau decompiler.
- local v1 = {};
- local u1 = nil;
- coroutine.wrap(function()
- u1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
- end)();
- local l__RunService__2 = game:GetService("RunService");
- local v3 = {};
- function v3.new(p1, p2, p3, p4)
- local v4 = setmetatable(u1.Entity.new(p1, p2, "Customer", p3, p4), {
- __index = function(p5, p6)
- return v3[p6] or u1.Entity[p6];
- end
- });
- v4.state = "WaitingForSeat";
- v4.stateData = {
- seatUID = nil,
- tableUID = nil,
- queuePosition = nil,
- isSitting = false,
- queueGroup = {},
- busyWalking = false,
- foodOrder = nil,
- deliveryPingUI = nil,
- pathToMe = nil,
- celebrityApproachCount = 0
- };
- v4.cachedLeftHipCF = nil;
- v4.cachedRightHipCF = nil;
- v4.chatBox = nil;
- v4.humanoid = v4.model:WaitForChild("Humanoid");
- v4.humanoid.WalkSpeed = v4.data.walkSpeed;
- v4:InitHumanoidAnimations();
- local v5, v6, v7 = ipairs(v4.model:GetDescendants());
- while true do
- v5(v6, v7);
- if not v5 then
- break;
- end;
- v7 = v5;
- if v6:IsA("BasePart") then
- u1.Services.PhysicsService:SetPartCollisionGroup(v6, "NPCGroup");
- end;
- end;
- if p3.nameCounters["Epic Totem"] > 0 and math.random() < 0.25 then
- v4:EquipLei();
- end;
- if p3.nameCounters["Haunted Statue"] > 0 then
- local v8 = v4.model.Head:FindFirstChildOfClass("Decal");
- if v8 then
- v8.Texture = "http://www.roblox.com/asset/?id=49493144";
- end;
- end;
- if v4.ID == "27" then
- v4:InitSantaCustomer();
- end;
- if v4.ID == "28" then
- v4:InitElfCustomer();
- end;
- if v4.ID == "30" then
- v4:InitAlienCustomer();
- end;
- return v4;
- end;
- function v3.FromUIDData(p7, p8, p9)
- local v9 = v3.new(p9.ID, p9.UID, p7, p8);
- v9.xVoxel = p9.XVoxel and 1;
- v9.yVoxel = 0;
- v9.zVoxel = p9.ZVoxel and 1;
- v9:UpdateVoxelPosition();
- if v9:BelongsToMyBakery() then
- v9.cachedParent = v9.model.Parent;
- v9.model.Parent = nil;
- local v10, v11, v12 = ipairs(v9.model:GetDescendants());
- while true do
- v10(v11, v12);
- if not v10 then
- break;
- end;
- v12 = v10;
- if v11:IsA("BasePart") then
- v11.Transparency = 1;
- end;
- end;
- end;
- if p9.RichCustomer then
- v9.isRichCustomer = true;
- end;
- v9.model:SetPrimaryPartCFrame(CFrame.new(p8:WorldPositionFromVoxel(v9.xVoxel, v9.yVoxel, v9.zVoxel) + Vector3.new(0, v9.model.PrimaryPart.Size.Y / 2, 0)));
- if not v9:BelongsToMyBakery() then
- v9:CustomerStateChangedByReplication(p9.CurrentState, p9.CurrentStateData);
- end;
- return v9;
- end;
- function v3.CreateRandomCustomer(p10, p11, p12, p13)
- return u1.Entity.FromUIDData(u1.Variables.MyBakery, p10);
- end;
- function v3.CreateAlienPortal(p14)
- end;
- local u2 = {};
- function v3.DropPresent(p15)
- if u1.Functions.DictionaryLength(u2) >= 10 then
- return;
- end;
- local v13 = u1.Network.Invoke("Santa_RequestPresentUID", p15.UID);
- if not v13 then
- return;
- end;
- if not p15.model or not p15.model.PrimaryPart then
- return;
- end;
- local v14 = game.ReplicatedStorage.Assets.Models.SantaPresent:Clone();
- u1.Services.PhysicsService:SetPartCollisionGroup(v14.PrimaryPart, "PresentGroup");
- v14:SetPrimaryPartCFrame(CFrame.new(p15.model.PrimaryPart.CFrame.p));
- v14.PrimaryPart.Velocity = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5) * 20;
- v14.Parent = workspace.__DEBRIS;
- u2[v13] = v14;
- local v15, v16 = u1.Interact.Add(v14.PrimaryPart, 8);
- v15:Connect(function()
- u1.Network.Fire("Santa_PickUpGift", v13, v14.PrimaryPart.Position);
- v16();
- v14:Destroy();
- u2[v13] = nil;
- end);
- end;
- u1.Network.Fired("Santa_GiftPickedUp"):Connect(function(p16, p17)
- u1.CustomUIEffects.CreateRewardBillboard(p17, p16);
- u1.SFX.Play(6106143051, p17);
- end);
- function v3.InitAlienCustomer(p18)
- task.spawn(function()
- p18:CreateAlienPortal();
- end);
- end;
- function v3.InitElfCustomer(p19)
- end;
- function v3.InitSantaCustomer(p20)
- coroutine.wrap(function()
- while not p20.isDeleted do
- wait(math.random(2, 7));
- if not ({
- ThinkingAboutOrder = true,
- DecidedOnOrder = true,
- WaitingToOrder = true,
- WaitingForFood = true,
- EatingFood = true
- })[p20.state] then
- p20:DropPresent();
- end;
- end;
- end)();
- end;
- function v3.DisplayMyClothing(p21, p22)
- end;
- function v3.GetMyTransparency(p23)
- if p23:IsGhostCustomer() then
- return 0.4;
- end;
- return 0;
- end;
- function v3.ToUIDData(p24)
- return {
- ClassName = "Customer",
- ID = p24.ID,
- UID = p24.UID,
- FloorLevel = p24:GetMyFloor().floorLevel,
- XVoxel = p24.xVoxel,
- YVoxel = p24.yVoxel,
- ZVoxel = p24.zVoxel,
- CurrentState = p24.state
- };
- end;
- function v3.IsHauntedHorseman(p25)
- return p25.ID == "25";
- end;
- function v3.IsAlienCustomer(p26)
- return p26.ID == "30";
- end;
- function v3.InitHumanoidAnimations(p27)
- p27.animations = {};
- p27.runningAnimation = nil;
- local v17 = Instance.new("Animation");
- if not (not p27:IsSpecialCustomer()) or not (not p27:IsGhostCustomer()) or p27:IsHauntedHorseman() then
- v17.AnimationId = "http://www.roblox.com/asset/?id=616006778";
- elseif p27:IsPirateCustomer() then
- v17.AnimationId = "rbxassetid://750785693";
- else
- v17.AnimationId = "rbxassetid://913402848";
- end;
- local v18 = Instance.new("Animation");
- v18.AnimationId = "rbxassetid://507766388";
- local v19 = Instance.new("Animation");
- v19.AnimationId = "rbxassetid://5021239100";
- local v20 = Instance.new("Animation");
- v20.AnimationId = "rbxassetid://5055508570";
- local v21 = Instance.new("Animation");
- v21.AnimationId = "rbxassetid://507770239";
- local v22 = Instance.new("Animation");
- v22.AnimationId = "rbxassetid://5055556552";
- p27.animations.gaming = p27.humanoid:LoadAnimation(v22);
- p27.animations.gaming.Looped = true;
- p27.animations.walking = p27.humanoid:LoadAnimation(v17);
- p27.animations.walking.Looped = true;
- p27.animations.idle = p27.humanoid:LoadAnimation(v18);
- p27.animations.idle.Looped = true;
- p27.animations.eating = p27.humanoid:LoadAnimation(v19);
- p27.animations.eating.Looped = true;
- p27.animations.menu = p27.humanoid:LoadAnimation(v20);
- p27.animations.menu.Looped = true;
- p27.animations.wave = p27.humanoid:LoadAnimation(v21);
- p27.animations.wave.Looped = false;
- v22:Destroy();
- v18:Destroy();
- v19:Destroy();
- v20:Destroy();
- v21:Destroy();
- p27.animations.idle:Play();
- end;
- function v3.PlayLoadedAnimation(p28, p29)
- p28.runningAnimation = nil;
- for v23, v24 in pairs(p28.animations) do
- v24:Stop();
- end;
- if p28.animations[p29] and p28:ShouldPlayAnimation(p29) then
- if p28:PlayerIsOnMyFloor() then
- p28.animations[p29]:Play();
- end;
- p28.runningAnimation = p29;
- end;
- end;
- function v3.StopLoadedAnimation(p30, p31)
- if p30.animations[p31] then
- p30.animations[p31]:Stop();
- p30.runningAnimation = nil;
- end;
- end;
- function v3.PauseCurrentAnimation(p32)
- if not p32.runningAnimation then
- return;
- end;
- p32.animations[p32.runningAnimation]:Stop();
- end;
- function v3.RestartCurrentAnimation(p33)
- if not p33.runningAnimation then
- return;
- end;
- p33.animations[p33.runningAnimation]:Play();
- end;
- function v3.Chat(p34, p35, p36, p37)
- if p34.chatBox then
- p34.chatBox:Destroy();
- end;
- p34.chatBox = u1.CustomUIEffects.CustomerChatBox(p34.model:FindFirstChild("Head"), p35);
- if p37 then
- for v25, v26 in pairs(p37) do
- p34.chatBox.MainFrame[v25] = v26;
- end;
- end;
- if not p36 then
- return;
- end;
- return p34.chatBox.MainFrame.Message.MouseButton1Down:Connect(function()
- p36(function()
- if not p34.chatBox then
- return;
- end;
- p34.chatBox:Destroy();
- p34.chatBox = nil;
- end);
- end);
- end;
- function v3.CleanupGroupInteract(p38)
- p38:CleanupInteract();
- local v27, v28, v29 = ipairs(p38.stateData.queueGroup);
- while true do
- v27(v28, v29);
- if not v27 then
- break;
- end;
- v29 = v27;
- v28:CleanupInteract();
- end;
- end;
- function v3.StopGroupEmoji(p39)
- p39:StopEmoji();
- local v30, v31, v32 = ipairs(p39.stateData.queueGroup);
- while true do
- v30(v31, v32);
- if not v30 then
- break;
- end;
- v32 = v30;
- v31:StopEmoji();
- end;
- end;
- function v3.StopChat(p40)
- if p40.chatBox then
- p40.chatBox:Destroy();
- end;
- p40.chatBox = nil;
- end;
- function v3.CustomerStateChangedByReplication(p41, p42, p43)
- p41.state = p42;
- p41.currentStateData = p43 or {};
- if p41:BelongsToMyBakery() then
- return;
- end;
- if p41.state == "WalkingToQueueSpot" or p41.state == "WaitingForSeat" then
- p41:Emoji("WaitingForSeat");
- return;
- end;
- p41:StopEmoji();
- if p41.state == "WalkingToExit" then
- p41:Emoji("HappyEmoji");
- p41:StandUp();
- return;
- end;
- local v33 = p41:GetMyBakery();
- local v34 = v33:GetEntityByUID(p41.currentStateData.seatUID);
- if not v34 or not v33:GetEntityByUID(p41.currentStateData.tableUID) then
- print("Init replicated state error: no seat leaf or table leaf", p42);
- return;
- end;
- if not p41.stateData.isSitting then
- p41:SitInSeat(v34);
- end;
- if p41.state == "ThinkingAboutOrder" then
- p41:ReadMenu();
- return;
- end;
- if p41.state == "WaitingToOrder" then
- p41:StopReadingMenu();
- p41:Emoji("WaitingToOrder");
- return;
- end;
- if p41.state == "EatingFood" then
- if p43.foodCFrame then
- p41.stateData.foodOrder = u1.Food.new(p43.foodID, p41.UID);
- p41:CreateMyFoodModel(p43.foodCFrame);
- p41:PlayLoadedAnimation("eating");
- return;
- end;
- elseif p41.state == "ReadyToExit" and p41.stateData.foodOrder then
- p41.stateData.foodOrder:DestroyModel();
- p41.stateData.foodOrder = nil;
- p41:StopLoadedAnimation("eating");
- end;
- end;
- function v3.SetCustomerState(p44, p45)
- if not p44:BelongsToMyBakery() then
- return;
- end;
- p44.state = p45;
- u1.Signal.Fire("MUTATE_CustomerStateChanged", p44.UID, p45, ((function()
- local v35 = {};
- if p45 == "WalkingToQueueSpot" or p45 == "WaitingForSeat" or p45 == "WalkingToSeat" then
- return v35;
- end;
- v35.seatUID = p44.stateData.seatUID;
- v35.tableUID = p44.stateData.tableUID;
- if p45 == "ThinkingAboutOrder" or p45 == "DecidedOnOrder" or p45 == "WaitingToOrder" then
- return v35;
- end;
- if p44.stateData.foodOrder then
- v35.foodID = p44.stateData.foodOrder.ID;
- if p44.stateData.foodOrder.model then
- v35.foodCFrame = p44.stateData.foodOrder.model:GetPrimaryPartCFrame();
- end;
- end;
- if p45 == "WaitingForFood" then
- return v35;
- end;
- return v35;
- end)()));
- end;
- function v3.ChangeToWaitingForFoodState(p46, p47)
- p46.stateData.foodOrder = p47;
- p46:PlayLoadedAnimation("idle");
- p46:SetCustomerState("WaitingForFood");
- end;
- local l__LocalPlayer__3 = game.Players.LocalPlayer;
- function v3.ReadyToOrder(p48)
- if p48.state ~= "DecidedOnOrder" then
- return;
- end;
- p48:SetCustomerState("WaitingToOrder");
- p48:PlayLoadedAnimation("idle");
- p48:Emoji("WaitingToOrder", true);
- p48:Interact(function(p49)
- if p48.isDeleted or p48.state ~= "WaitingToOrder" then
- return;
- end;
- u1.Audio.Play(5074101610, l__LocalPlayer__3.PlayerGui);
- local v36 = p48:GetMyFloor():FindOrderStandOnAnyFloor();
- if not v36 then
- u1.Alert.Message("Place an Order Stand to take a customer's order.");
- return;
- end;
- p49();
- p48:StopEmoji();
- local v37 = u1.Food.RandomFoodChoice(p48.UID, p48.ID, p48:IsRichCustomer(), p48:IsPirateCustomer(), p48.isNearTree);
- v36:AddFoodToQueue(v37);
- p48:ChangeToWaitingForFoodState(v37);
- p48:FoodEmoji(v37.ID);
- task.delay(3, function()
- p48:StopEmoji();
- end);
- end);
- end;
- function v3.SitInSeat(p50, p51)
- local v38 = Vector3.new(0, 1.3, 0);
- if p50:IsAlienCustomer() then
- v38 = v38 + Vector3.new(0, 0.8, 0);
- end;
- local l__PrimaryPart__39 = p51.model.PrimaryPart;
- local v40 = p51:GetFaceDirection();
- local v41 = p51.model.PrimaryPart.SeatAttachment.WorldPosition + v38;
- local v42 = CFrame.new(v41 + v40 * 0.4, v41 + v40);
- p50.stateData.isSitting = true;
- p50.stateData.mySeat = p51;
- p50.model.HumanoidRootPart.Anchored = true;
- if not p50.cachedLeftHipCF then
- p50.cachedLeftHipCF = p50.model.LeftUpperLeg.LeftHip.C0;
- p50.cachedRightHipCF = p50.model.RightUpperLeg.RightHip.C0;
- end;
- u1.Functions.Tween(p50.model.LeftUpperLeg.LeftHip, {
- C0 = CFrame.new(-0.35, -0.5, 0) * CFrame.Angles(1.3089969389957472, 0, 0)
- }, { 0.3, "Quad", "Out" });
- u1.Functions.Tween(p50.model.RightUpperLeg.RightHip, {
- C0 = CFrame.new(0.35, -0.5, 0) * CFrame.Angles(1.3089969389957472, 0, 0)
- }, { 0.3, "Quad", "Out" });
- if p51.ID == "120" then
- task.delay(0.3, function()
- while p50.stateData.isSitting and not p51.isDeleted do
- local v43 = p51.model.PrimaryPart.SeatAttachment.WorldPosition + v38;
- p50.model.PrimaryPart.CFrame = CFrame.new(v43 + v40 * 0.4, v43 + v40);
- u1.Services.RunService.RenderStepped:Wait();
- end;
- end);
- end;
- return u1.Functions.Tween(p50.model.PrimaryPart, {
- CFrame = v42
- }, { 0.3, "Quad", "Out" });
- end;
- function v3.ReadMenu(p52)
- if not p52.model then
- return;
- end;
- p52:PlayLoadedAnimation("menu");
- local v44 = game.ReplicatedStorage.Assets.Models.MenuModel:Clone();
- local v45 = Instance.new("Weld");
- v45.Part0 = p52.model.RightHand;
- v45.Part1 = v44.PrimaryPart;
- v45.C0 = CFrame.new(-0.8, -0.4, 0) * CFrame.Angles(0, math.pi, -math.pi / 8);
- v45.Parent = v44.PrimaryPart;
- local v46, v47, v48 = ipairs(v44:GetChildren());
- while true do
- v46(v47, v48);
- if not v46 then
- break;
- end;
- v48 = v46;
- local v49 = Instance.new("WeldConstraint");
- v49.Parent = v44.PrimaryPart;
- v49.Part0 = v44.PrimaryPart;
- v49.Part1 = v47;
- end;
- v44.Parent = p52.model;
- p52.stateData.menuModel = v44;
- end;
- function v3.StopReadingMenu(p53)
- p53:StopLoadedAnimation("menu");
- if p53.stateData.menuModel then
- p53.stateData.menuModel = p53.stateData.menuModel:Destroy();
- end;
- end;
- function v3.ChangeToWaitForOrderState(p54)
- if p54.state ~= "WalkingToSeat" then
- return;
- end;
- local v50 = p54:EntityTable()[p54.stateData.seatUID];
- if v50.isDeleted or p54:EntityTable()[p54.stateData.tableUID].isDeleted then
- p54:ForcedToLeave();
- return;
- end;
- p54:SetCustomerState("ThinkingAboutOrder");
- p54:SitInSeat(v50).Completed:Connect(function()
- p54.humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, true);
- p54.xVoxel = v50.xVoxel;
- p54.zVoxel = v50.zVoxel;
- coroutine.wrap(function()
- wait(0.35);
- p54:ReadMenu();
- if u1.Variables.MyBakery.isTutorial then
- wait(3.25);
- else
- wait(7.5 + math.random() * 6);
- end;
- if p54.isDeleted or p54.state ~= "ThinkingAboutOrder" then
- return;
- end;
- p54:StopReadingMenu();
- p54:SetCustomerState("DecidedOnOrder");
- local v51 = { p54 };
- local v52, v53, v54 = ipairs(p54.stateData.queueGroup);
- while true do
- v52(v53, v54);
- if not v52 then
- break;
- end;
- v54 = v52;
- if not v53.isDeleted then
- table.insert(v51, v53);
- end;
- end;
- local v55 = false;
- local v56, v57, v58 = ipairs(v51);
- while true do
- v56(v57, v58);
- if not v56 then
- break;
- end;
- v58 = v56;
- if v57.state ~= "DecidedOnOrder" then
- v55 = true;
- break;
- end;
- end;
- if not v55 then
- local v59, v60, v61 = ipairs(v51);
- while true do
- v59(v60, v61);
- if not v59 then
- break;
- end;
- v61 = v59;
- v60:ReadyToOrder();
- end;
- end;
- end)();
- end);
- end;
- function v3.ResetAllStates(p55)
- end;
- function v3.ChangeToReadyToExitState(p56, p57)
- p56:SetCustomerState("ReadyToExit");
- p56:PlayLoadedAnimation("idle");
- local v62 = p56:EntityTable()[p56.stateData.seatUID];
- local v63 = p56:GetMyFloor();
- local l__foodOrder__64 = p56.stateData.foodOrder;
- v62.stateData.dish = l__foodOrder__64;
- table.insert(v63.dishChairs, v62);
- l__foodOrder__64:InitMoneyModel((function()
- if not v62.stateData.cachedFaceDirection then
- return math.rad(v62.model.PrimaryPart.Orientation.Y);
- end;
- local l__cachedFaceDirection__65 = v62.stateData.cachedFaceDirection;
- 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));
- end)() + math.pi / 2, p56:IsVIPCustomer() or (p56:IsRichCustomer() or (p56:IsGhostCustomer() or p56:IsSpecialCustomer())));
- if u1.Gamepasses.Owns(u1.Directory.Gamepasses.AutoCashCollect.ID) and u1.PlayerSettings.IsEnabled("Gamepasses") then
- l__foodOrder__64:MoneyPickedUp();
- end;
- coroutine.wrap(function()
- local v66 = nil;
- if u1.Variables.MyBakery.isTutorial then
- while true do
- wait();
- if u1.Variables.MyBakery.tutorial.readyForUserToWash then
- break;
- end;
- end;
- v66 = u1.WorldFX.ArrowPing3D(l__foodOrder__64.model.PrimaryPart);
- end;
- l__foodOrder__64:Interact(function(p58)
- if u1.Variables.MyBakery.isTutorial and not u1.Variables.MyBakery.tutorial.readyForUserToWash then
- return;
- end;
- if u1.Variables.MyBakery.animatedPath then
- u1.Alert.Message("You cannot do that right now.");
- return;
- end;
- local v67 = v63:GatherDishwashersOnAnyFloor(l__foodOrder__64.flaggedDishwasherUID);
- if #v67 == 0 then
- u1.Alert.Message("All sinks/dishwashers are currently full.");
- return;
- end;
- local v68 = false;
- local v69, v70, v71 = ipairs(v63.dishChairs);
- while true do
- v69(v70, v71);
- if not v69 then
- break;
- end;
- v71 = v69;
- if v70 == v62 then
- v68 = true;
- table.remove(v63.dishChairs, v69);
- break;
- end;
- end;
- if not v68 then
- u1.Alert.Message("A waiter is already coming to get this dish.");
- return;
- end;
- if u1.Variables.MyBakery.isTutorial then
- u1.Signal.Fire("Tutorial_DishPickedUp");
- if v66 then
- v66:Destroy();
- end;
- end;
- if l__foodOrder__64.model then
- local v72 = { 5205173686, 5205173942 };
- u1.SFX.Play(v72[math.random(#v72)], l__foodOrder__64.model:GetPrimaryPartCFrame().p);
- end;
- if not v62.isDeleted then
- v62.stateData.dish = nil;
- end;
- l__foodOrder__64:DestroyModel();
- l__foodOrder__64:CleanupInteract();
- l__foodOrder__64:MoneyPickedUp();
- u1.PlayerAnimations.HoldModel(game.ReplicatedStorage.Assets.BakeryEntityAssets.Food.DirtyDish);
- local v73 = v67[math.random(#v67)];
- local l__stateData__74 = v73.stateData;
- l__stateData__74.dishWasherTargetCount = l__stateData__74.dishWasherTargetCount + 1;
- v73.stateData.dishwasherUI.Enabled = false;
- v73:Emoji("DishEmoji", true);
- v73:Interact(function(p59)
- v73.stateData.dishwasherUI.Enabled = true;
- v73:AddDish();
- u1.Variables.MyBakery:CleanupAnimatedPath();
- p59();
- v73:StopEmoji();
- u1.PlayerAnimations.DropModel();
- if u1.Variables.MyBakery.isTutorial then
- u1.Signal.Fire("Tutorial_StartedWashing");
- end;
- u1.Network.Fire("AwardBakeryExperienceWithVerification");
- end);
- v62:AnimatePathToEntity(v73);
- end);
- end)();
- local v75 = { p56 };
- local v76, v77, v78 = ipairs(p56.stateData.queueGroup);
- while true do
- v76(v77, v78);
- if not v76 then
- break;
- end;
- v78 = v76;
- table.insert(v75, v77);
- end;
- local v79, v80, v81 = ipairs(v75);
- while true do
- v79(v80, v81);
- if not v79 then
- break;
- end;
- v81 = v79;
- if v80.state ~= "ReadyToExit" then
- return;
- end;
- end;
- local v82, v83, v84 = ipairs(v75);
- while true do
- v82(v83, v84);
- if not v82 then
- break;
- end;
- v84 = v82;
- if not v83.isDeleted then
- v83:ChangeToExitingState(false, p57);
- end;
- end;
- end;
- function v3.RecheckGroupFinishedEating(p60)
- local v85 = { p60 };
- local v86, v87, v88 = ipairs(p60.stateData.queueGroup);
- while true do
- v86(v87, v88);
- if not v86 then
- break;
- end;
- v88 = v86;
- table.insert(v85, v87);
- end;
- local v89, v90, v91 = ipairs(v85);
- while true do
- v89(v90, v91);
- if not v89 then
- break;
- end;
- v91 = v89;
- if v90.state ~= "ReadyToExit" then
- return;
- end;
- end;
- local v92, v93, v94 = ipairs(v85);
- while true do
- v92(v93, v94);
- if not v92 then
- break;
- end;
- v94 = v92;
- if not v93.isDeleted then
- v93:ChangeToExitingState(false);
- end;
- end;
- end;
- function v3.LeaveBakery(p61)
- if p61.isDeleted then
- return;
- end;
- local v95 = p61:EntityTable()[p61.stateData.seatUID];
- if v95 and not v95.isDeleted then
- p61:EntityTable()[p61.stateData.seatUID]:SetIsOccupied(nil);
- end;
- local v96 = p61:GetMyFloor();
- local v97, v98, v99 = ipairs(v96.customers);
- while true do
- v97(v98, v99);
- if not v97 then
- break;
- end;
- v99 = v97;
- if v98 == p61 then
- table.remove(v96.customers, v97);
- break;
- end;
- end;
- if p61:BelongsToMyBakery() then
- u1.Replication.SendEvent("CustomerDestroyed", p61.UID);
- u1.Variables.MyBakery.activeCelebrity = false;
- end;
- p61:Cleanup();
- end;
- function v3.ForcedToLeave(p62)
- p62:StopEmoji();
- if not p62:BelongsToMyBakery() then
- return;
- end;
- if p62.stateData.foodOrder then
- if p62.stateData.foodOrder.moneyModel then
- p62.stateData.foodOrder:MoneyPickedUp();
- end;
- p62.stateData.foodOrder:CleanupInteract();
- p62.stateData.foodOrder:DestroyModel();
- p62.stateData.foodOrder.isDeleted = true;
- if p62.stateData.foodOrder.associatedListItem then
- p62.stateData.foodOrder.associatedListItem:Destroy();
- end;
- local v100, v101, v102 = ipairs(u1.Variables.MyBakery.floors);
- while true do
- v100(v101, v102);
- if not v100 then
- break;
- end;
- v102 = v100;
- local v103, v104, v105 = ipairs((v101:GetEntitiesFromClassAndSubClass("Appliance", "Order Stand")));
- while true do
- v103(v104, v105);
- if not v103 then
- break;
- end;
- v105 = v103;
- v104:CleanupFoodObjectFromBothLists(p62.stateData.foodOrder);
- end;
- end;
- p62.stateData.foodOrder = nil;
- end;
- if p62 == p62:GetMyBakery().animatedPathTargetEntity then
- p62:GetMyBakery():CleanupAnimatedPath();
- u1.PlayerAnimations.DropModel();
- end;
- local l__customerQueue__106 = u1.Variables.MyBakery.customerQueue;
- local v107, v108, v109 = ipairs(l__customerQueue__106);
- while true do
- v107(v108, v109);
- if not v107 then
- break;
- end;
- local v110 = false;
- local v111, v112, v113 = ipairs(v108);
- while true do
- v111(v112, v113);
- if not v111 then
- break;
- end;
- v113 = v111;
- if v112 == p62 then
- table.remove(v108, v111);
- v110 = true;
- if #v108 == 0 then
- table.remove(l__customerQueue__106, v107);
- end;
- break;
- end;
- end;
- if v110 then
- break;
- end;
- end;
- local v114, v115, v116 = ipairs(p62.stateData.queueGroup);
- while true do
- v114(v115, v116);
- if not v114 then
- break;
- end;
- v116 = v114;
- if not v115.isDeleted then
- local v117, v118, v119 = ipairs(v115.stateData.queueGroup);
- while true do
- v117(v118, v119);
- if not v117 then
- break;
- end;
- v119 = v117;
- if p62 == v118 then
- table.remove(v115.stateData.queueGroup, v117);
- v115:RecheckGroupFinishedEating();
- break;
- end;
- end;
- end;
- end;
- p62:CleanupInteract();
- p62:ChangeToExitingState(true);
- end;
- function v3.IsVIPCustomer(p63)
- return p63.ID == "13";
- end;
- function v3.IsSpecialCustomer(p64)
- return p64.ID == "14";
- end;
- function v3.IsPirateCustomer(p65)
- return p65.ID == "21";
- end;
- function v3.IsGhostCustomer(p66)
- return p66.ID == "15";
- end;
- function v3.IsCelebrityCustomer(p67)
- return p67.ID == "20";
- end;
- function v3.IsRichCustomer(p68)
- return p68.isRichCustomer;
- end;
- function v3.StandUp(p69)
- p69.stateData.isSitting = false;
- p69.model.HumanoidRootPart.Anchored = false;
- p69.humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, false);
- if p69.cachedLeftHipCF and p69.cachedRightHipCF then
- p69.model.LeftUpperLeg.LeftHip.C0 = p69.cachedLeftHipCF;
- p69.model.RightUpperLeg.RightHip.C0 = p69.cachedRightHipCF;
- end;
- end;
- function v3.ChangeToExitingState(p70, p71, p72)
- if p70.isDeleted then
- return;
- end;
- p70.leaving = true;
- p70:SetCustomerState("WalkingToExit");
- local v120 = p70:EntityTable()[p70.stateData.tableUID];
- if v120 and not v120.isDeleted then
- v120:RemoveCustomerFromTable(p70);
- end;
- local u4 = p70:GetMyFloor();
- coroutine.wrap(function()
- if not p71 and (math.random() < 0.3 or u1.Variables.MyBakery.isTutorial) then
- p70:TimedEmoji("HappyEmoji", 2.5);
- end;
- p70:StandUp();
- local v121 = false;
- local v122 = false;
- local v123 = false;
- local v124 = false;
- local v125 = false;
- local v126 = false;
- local v127 = false;
- if not p71 then
- local v128 = u4:GetEntitiesFromClassAndSubClass("Appliance", "Tip Jar");
- if #v128 > 0 then
- local v129, v130, v131 = ipairs(v128);
- while true do
- v129(v130, v131);
- if not v129 then
- break;
- end;
- v131 = v129;
- if v130.ID == "14" then
- local v132 = 0.05;
- elseif v130.ID == "19" then
- v132 = 0.5;
- elseif v130.ID == "26" then
- v132 = 0.4;
- else
- v132 = 0;
- end;
- if math.random() < v132 then
- v121 = true;
- p70:WalkToPoint(v130.xVoxel, v130.yVoxel, v130.zVoxel, function()
- if not v130.isDeleted and not p70.isDeleted and p70.stateData and p70.stateData.foodOrder then
- p70:TimedEmoji("VeryHappyEmoji", 2.5);
- u1.Network.Fire("AwardTipWithVerification", p70.UID, v130.UID, p70.stateData.foodOrder.ID);
- u1.SFX.Play(5839737230, v130.model.PrimaryPart);
- p70:FaceEntity(v130);
- wait(0.3);
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v133, v134, v135 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v133, v134, v135, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- return;
- end;
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v136, v137, v138 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v136, v137, v138, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- end);
- break;
- end;
- if p72 then
- v121 = true;
- p70:WalkToPoint(v130.xVoxel, v130.yVoxel, v130.zVoxel, function()
- if not v130.isDeleted and not p70.isDeleted and p70.stateData and p70.stateData.foodOrder then
- p70:TimedEmoji("VeryHappyEmoji", 2.5);
- u1.Network.Fire("AwardTipWithVerification", p70.UID, v130.UID, p70.stateData.foodOrder.ID);
- u1.SFX.Play(5839737230, v130.model.PrimaryPart);
- p70:FaceEntity(v130);
- wait(0.3);
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- v133, v134, v135 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v133, v134, v135, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- return;
- end;
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- v136, v137, v138 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v136, v137, v138, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- end);
- break;
- end;
- if p70:IsVIPCustomer() then
- v121 = true;
- p70:WalkToPoint(v130.xVoxel, v130.yVoxel, v130.zVoxel, function()
- if not v130.isDeleted and not p70.isDeleted and p70.stateData and p70.stateData.foodOrder then
- p70:TimedEmoji("VeryHappyEmoji", 2.5);
- u1.Network.Fire("AwardTipWithVerification", p70.UID, v130.UID, p70.stateData.foodOrder.ID);
- u1.SFX.Play(5839737230, v130.model.PrimaryPart);
- p70:FaceEntity(v130);
- wait(0.3);
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- v133, v134, v135 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v133, v134, v135, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- return;
- end;
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- v136, v137, v138 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v136, v137, v138, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- end);
- break;
- end;
- end;
- end;
- end;
- if not v121 then
- local v139 = u4:GetEntitiesFromClassAndSubClass("Appliance", "CandyBowl");
- if #v139 > 0 then
- local v140, v141, v142 = ipairs(v139);
- while true do
- v140(v141, v142);
- if not v140 then
- break;
- end;
- v142 = v140;
- if math.random() < 0.3 and v141.level and v141.level > 0 then
- v127 = true;
- p70:WalkToPoint(v141.xVoxel, v141.yVoxel, v141.zVoxel, function()
- if not v141.isDeleted and p70.stateData and p70.stateData.foodOrder and not (v141.level <= 0) then
- p70:TimedEmoji("VeryHappyEmoji", 2.5);
- u1.Network.Fire("AwardTipWithVerification", p70.UID, v141.UID, p70.stateData.foodOrder.ID);
- u1.SFX.Play(5057746151, v141.model.PrimaryPart);
- p70:FaceEntity(v141);
- wait(0.3);
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v143, v144, v145 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v143, v144, v145, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- return;
- end;
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v146, v147, v148 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v146, v147, v148, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- end);
- break;
- end;
- end;
- end;
- end;
- if not v121 and not v127 then
- local v149 = u4:GetEntitiesFromClassAndSubClass("Appliance", "GumballMachine");
- if #v149 > 0 then
- local v150, v151, v152 = ipairs(v149);
- while true do
- v150(v151, v152);
- if not v150 then
- break;
- end;
- v152 = v150;
- if math.random() < 0.1 then
- v122 = true;
- local v153, v154, v155 = v151:GetFacePosition();
- if not u4:IsValidVoxel(v153, v154, v155) then
- v153 = v151.xVoxel;
- v154 = v151.yVoxel;
- v155 = v151.zVoxel;
- end;
- p70:WalkToPoint(v153, v154, v155, function()
- if v151.isDeleted or p70.isDeleted then
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v156, v157, v158 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v156, v157, v158, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- return;
- end;
- if p70.stateData.foodOrder then
- u1.Network.Fire("AwardTipWithVerification", p70.UID, v151.UID, p70.stateData.foodOrder.ID);
- end;
- u1.SFX.Play(5205171179, v151.model.PrimaryPart.Position);
- p70:TimedEmoji("VeryHappyEmoji", 2.5);
- p70:FaceEntity(v151);
- wait(0.3);
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v159, v160, v161 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v159, v160, v161, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- end);
- break;
- end;
- end;
- end;
- end;
- if not v121 and not v122 and not v127 then
- local v162 = u4:GetEntitiesFromClassAndSubClass("Appliance", "CandyMachine");
- if #v162 > 0 then
- local v163, v164, v165 = ipairs(v162);
- while true do
- v163(v164, v165);
- if not v163 then
- break;
- end;
- v165 = v163;
- if math.random() < 0.1 then
- v123 = true;
- local v166, v167, v168 = v164:GetFacePosition();
- if not u4:IsValidVoxel(v166, v167, v168) then
- v166 = v164.xVoxel;
- v167 = v164.yVoxel;
- v168 = v164.zVoxel;
- end;
- p70:WalkToPoint(v166, v167, v168, function()
- if v164.isDeleted or p70.isDeleted then
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v169, v170, v171 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v169, v170, v171, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- return;
- end;
- u1.SFX.Play(5601560734, v164.model.PrimaryPart);
- if p70.stateData.foodOrder then
- u1.Network.Fire("AwardTipWithVerification", p70.UID, v164.UID, p70.stateData.foodOrder.ID);
- end;
- p70:TimedEmoji("VeryHappyEmoji", 2.5);
- p70:FaceEntity(v164);
- wait(0.3);
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v172, v173, v174 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v172, v173, v174, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- end);
- break;
- end;
- end;
- end;
- end;
- if not v121 and not v122 and not v123 and not v127 then
- local v175 = u4:GetEntitiesFromClassAndSubClass("Appliance", "PopcornMachine");
- if #v175 > 0 then
- local v176, v177, v178 = ipairs(v175);
- while true do
- v176(v177, v178);
- if not v176 then
- break;
- end;
- v178 = v176;
- if math.random() < 0.1 then
- v125 = true;
- local v179, v180, v181 = v177:GetFacePosition();
- if not u4:IsValidVoxel(v179, v180, v181) then
- v179 = v177.xVoxel;
- v180 = v177.yVoxel;
- v181 = v177.zVoxel;
- end;
- p70:WalkToPoint(v179, v180, v181, function()
- if v177.isDeleted or p70.isDeleted then
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v182, v183, v184 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v182, v183, v184, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- return;
- end;
- u1.SFX.Play(5625433552, v177.model.PrimaryPart);
- if p70.stateData.foodOrder then
- u1.Network.Fire("AwardTipWithVerification", p70.UID, v177.UID, p70.stateData.foodOrder.ID);
- end;
- p70:TimedEmoji("VeryHappyEmoji", 2.5);
- p70:FaceEntity(v177);
- wait(0.3);
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v185, v186, v187 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v185, v186, v187, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- end);
- break;
- end;
- end;
- end;
- end;
- if not v121 and not v122 and not v123 and not v125 and not p71 and not v127 then
- local v188 = u4:GetEntitiesFromClassAndSubClass("Appliance", "SodaMachine");
- if #v188 > 0 then
- local v189, v190, v191 = ipairs(v188);
- while true do
- v189(v190, v191);
- if not v189 then
- break;
- end;
- v191 = v189;
- if math.random() < 0.15 then
- v126 = true;
- local v192, v193, v194 = v190:GetFacePosition();
- if not u4:IsValidVoxel(v192, v193, v194) then
- v192 = v190.xVoxel;
- v193 = v190.yVoxel;
- v194 = v190.zVoxel;
- end;
- p70:WalkToPoint(v192, v193, v194, function()
- if v190.isDeleted or p70.isDeleted then
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v195, v196, v197 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v195, v196, v197, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- return;
- end;
- u1.SFX.Play(5708685354, v190.model.PrimaryPart);
- if p70.stateData.foodOrder then
- u1.Network.Fire("AwardTipWithVerification", p70.UID, v190.UID, p70.stateData.foodOrder.ID);
- end;
- p70:TimedEmoji("VeryHappyEmoji", 2.5);
- p70:FaceEntity(v190);
- wait(0.3);
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v198, v199, v200 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v198, v199, v200, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- end);
- break;
- end;
- end;
- end;
- end;
- if not v121 and not v122 and not v123 and not v125 and not v126 and not p71 and not v127 then
- local v201 = u4:GetEntitiesFromClassAndSubClass("Furniture", "ArcadeMachine");
- if #v201 > 0 then
- local v202, v203, v204 = ipairs((u1.Functions.RandomIndices(v201)));
- while true do
- v202(v203, v204);
- if not v202 then
- break;
- end;
- v204 = v202;
- local v205 = v201[v203];
- if v205.arcadeState == "Highscore" and not v205.busy then
- v205.busy = true;
- v124 = true;
- local v206, v207, v208 = v205:GetFacePosition();
- if not u4:IsValidVoxel(v206, v207, v208) then
- v206 = v205.xVoxel;
- v207 = v205.yVoxel;
- v208 = v205.zVoxel;
- end;
- p70:WalkToPoint(v206, v207, v208, function()
- if v205.isDeleted or p70.isDeleted then
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v209, v210, v211 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v209, v210, v211, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- return;
- end;
- p70:FaceEntity(v205);
- v205:PlayGameWithCustomer(p70);
- v205.busy = false;
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v212, v213, v214 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v212, v213, v214, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- end);
- break;
- end;
- end;
- end;
- end;
- local u5 = false;
- (function()
- if not v121 and not v122 and not v123 and not v125 and not v124 and not v126 and not v127 then
- if u1.Variables.MyBakery.nameCounters["Celebrity Customer"] == 0 then
- return;
- else
- local v215 = u1.Variables.MyBakery:SearchForCelebrity();
- if not v215 or not (not v215.isDeleted) or v215.stateData.celebrityApproachCount >= 3 then
- return;
- elseif not (not v215.isDeleted) or not ({
- ThinkingAboutOrder = true,
- DecidedOnOrder = true,
- WaitingToOrder = true,
- WaitingForFood = true,
- EatingFood = true
- })[v215.state] then
- return;
- else
- u5 = true;
- local l__stateData__216 = v215.stateData;
- l__stateData__216.celebrityApproachCount = l__stateData__216.celebrityApproachCount + 1;
- p70:WalkToNewFloor(v215:GetMyFloor(), function()
- if not v215.isDeleted and ({
- ThinkingAboutOrder = true,
- DecidedOnOrder = true,
- WaitingToOrder = true,
- WaitingForFood = true,
- EatingFood = true
- })[v215.state] then
- p70:WalkToPoint(v215.xVoxel, v215.yVoxel, v215.zVoxel, function()
- if not (not v215.isDeleted) or not ({
- ThinkingAboutOrder = true,
- DecidedOnOrder = true,
- WaitingToOrder = true,
- WaitingForFood = true,
- EatingFood = true
- })[v215.state] then
- if not v215.isDeleted then
- local l__stateData__217 = v215.stateData;
- l__stateData__217.celebrityApproachCount = l__stateData__217.celebrityApproachCount - 1;
- end;
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v218, v219, v220 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v218, v219, v220, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- return;
- end;
- local l__stateData__221 = v215.stateData;
- l__stateData__221.celebrityApproachCount = l__stateData__221.celebrityApproachCount - 1;
- u1.SFX.Play(5278932469, v215.model.PrimaryPart.Position);
- p70:FaceEntity(v215);
- p70:TimedEmoji("Starstruck", 2.5);
- p70:PlayLoadedAnimation("wave");
- wait(2);
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v222, v223, v224 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v222, v223, v224, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- end);
- return;
- end;
- if not v215.isDeleted then
- local l__stateData__225 = v215.stateData;
- l__stateData__225.celebrityApproachCount = l__stateData__225.celebrityApproachCount - 1;
- end;
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v226, v227, v228 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v226, v227, v228, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- end);
- return;
- end;
- end;
- end;
- end)();
- if not v121 and not v122 and not u5 and not v123 and not v124 and not v125 and not v127 then
- p70:WalkToNewFloor(u1.Variables.MyBakery.floors[1], function()
- local v229, v230, v231 = u1.Variables.MyBakery:GetCustomerStartVoxel(1);
- p70:WalkToPoint(v229, v230, v231, function()
- p70:FadeTransparency(1, function()
- p70:LeaveBakery();
- end);
- end, nil, true);
- end);
- end;
- end)();
- end;
- function v3.CreateMyFoodModel(p73, p74)
- p73.stateData.foodOrder:MakeModel();
- p73.stateData.foodOrder:SetModelPrimaryPartCFrame(p74);
- end;
- function v3.ChangeToEatingState(p75)
- coroutine.wrap(function()
- local v232 = nil;
- if p75.state == "EatingFood" then
- return;
- end;
- local v233 = p75:GetMyFloor();
- table.sort(v233.silverwareTrays, function(p76, p77)
- 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);
- end);
- table.sort(v233.goldSilverwareTrays, function(p78, p79)
- 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);
- end);
- p75:SetCustomerState("EatingFood");
- if p75.stateData.pathToMe then
- u1.Variables.MyBakery:CleanupAnimatedPath();
- p75.stateData.pathToMe = nil;
- end;
- local u6 = false;
- local u7 = false;
- local u8 = false;
- if not p75.stateData.foodOrder then
- p75:ForcedToLeave();
- return;
- end;
- local v234 = p75:EntityTable()[p75.stateData.tableUID];
- v232 = p75:EntityTable()[p75.stateData.seatUID];
- if not v234 or not v232 then
- u1.Print("CRITICAL: COULDN'T FIND CUSTOMERS TABLE WHEN EATING", true);
- return;
- end;
- local v235 = v234:GetMyFloor();
- local v236 = v235:WorldPositionFromVoxel(v232:GetFacePosition());
- local l__PrimaryPart__237 = v234.model.PrimaryPart;
- 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)))));
- local u9 = false;
- local u10 = false;
- local u11 = false;
- local function u12(p80, p81)
- u6 = true;
- local v238 = false;
- local v239 = false;
- local v240, v241, v242 = ipairs(v233.saladBars);
- while true do
- v240(v241, v242);
- if not v240 then
- break;
- end;
- v242 = v240;
- if math.random() < 0.2 then
- if not p80 then
- p75:StandUp();
- end;
- v239 = true;
- v238 = true;
- local u13 = v239;
- local l__xVoxel__14 = p75.xVoxel;
- local l__yVoxel__15 = p75.yVoxel;
- local l__zVoxel__16 = p75.zVoxel;
- p75:WalkToPoint(v241.xVoxel, v241.yVoxel, v241.zVoxel, function()
- if v241.isDeleted then
- u13 = false;
- p75:ForcedToLeave();
- return;
- end;
- p75:FaceEntity(v241);
- wait(0.3);
- u1.SFX.Play(5708685167, v241.model.PrimaryPart);
- u1.Network.Fire("AwardTipWithVerification", p75.UID, v241.UID, p75.stateData.foodOrder.ID, p80);
- if not p81 then
- u13 = false;
- return;
- end;
- p75:WalkToPoint(l__xVoxel__14, l__yVoxel__15, l__zVoxel__16, function()
- u13 = false;
- if p75.stateData.mySeat.isDeleted then
- p75:ForcedToLeave();
- return;
- end;
- p75:SitInSeat(p75.stateData.mySeat);
- end);
- end);
- break;
- end;
- end;
- if v239 then
- while true do
- wait();
- if not v239 then
- break;
- end;
- end;
- end;
- return v238;
- end;
- local function u17(p82, p83)
- u7 = true;
- local v243 = false;
- local v244 = false;
- local v245, v246, v247 = ipairs(v233.dessertBars);
- while true do
- v245(v246, v247);
- if not v245 then
- break;
- end;
- v247 = v245;
- if math.random() < 0.2 then
- if not p82 then
- p75:StandUp();
- end;
- v244 = true;
- v243 = true;
- local u18 = v244;
- local l__xVoxel__19 = p75.xVoxel;
- local l__yVoxel__20 = p75.yVoxel;
- local l__zVoxel__21 = p75.zVoxel;
- p75:WalkToPoint(v246.xVoxel, v246.yVoxel, v246.zVoxel, function()
- if v246.isDeleted then
- u18 = false;
- p75:ForcedToLeave();
- return;
- end;
- p75:FaceEntity(v246);
- wait(0.3);
- u1.SFX.Play(5708685167, v246.model.PrimaryPart);
- u1.Network.Fire("AwardTipWithVerification", p75.UID, v246.UID, p75.stateData.foodOrder.ID, p82);
- if not p83 then
- u18 = false;
- return;
- end;
- p75:WalkToPoint(l__xVoxel__19, l__yVoxel__20, l__zVoxel__21, function()
- u18 = false;
- if p75.stateData.mySeat.isDeleted then
- p75:ForcedToLeave();
- return;
- end;
- p75:SitInSeat(p75.stateData.mySeat);
- end);
- end);
- break;
- end;
- end;
- if v244 then
- while true do
- wait();
- if not v244 then
- break;
- end;
- end;
- end;
- return v243;
- end;
- local function u22(p84, p85)
- u8 = true;
- local v248 = false;
- local v249 = false;
- local v250, v251, v252 = ipairs(v233.balloonMachines);
- while true do
- v250(v251, v252);
- if not v250 then
- break;
- end;
- v252 = v250;
- if math.random() < 0.1 then
- if not p84 then
- p75:StandUp();
- end;
- v249 = true;
- v248 = true;
- local u23 = v249;
- local l__xVoxel__24 = p75.xVoxel;
- local l__yVoxel__25 = p75.yVoxel;
- local l__zVoxel__26 = p75.zVoxel;
- p75:WalkToPoint(v251.xVoxel, v251.yVoxel, v251.zVoxel, function()
- if v251.isDeleted then
- u23 = false;
- p75:ForcedToLeave();
- return;
- end;
- p75:FaceEntity(v251);
- wait(0.3);
- local v253 = game.ReplicatedStorage.Assets.Models.CustomerBalloon:Clone();
- v253.Parent = p75.model;
- v253:SetPrimaryPartCFrame(p75.model.LeftHand.CFrame);
- u1.SFX.Play(10244075139, p75.model.PrimaryPart.Position);
- local v254 = Instance.new("Attachment");
- v254.Name = "CustomerAttachment";
- v254.Position = Vector3.new();
- v254.Parent = p75.model.LeftHand;
- local v255 = Instance.new("AlignPosition");
- v255.Parent = v253.Weight.Weight;
- v255.Attachment0 = v253.Weight.Weight.CustomerAttachment;
- v255.Attachment1 = v254;
- v255.MaxForce = 100000000;
- v255.MaxVelocity = 100000000;
- v255.Responsiveness = 200;
- 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) };
- local v257 = v256[math.random(#v256)];
- v253.Balloon["Inner Balloon Part"].Color = v257;
- v253.Balloon.OuterBalloonPart.Color = v257;
- if math.random() < 0.5 then
- local v258 = 10244074875;
- else
- v258 = 10244074737;
- end;
- u1.SFX.Play(v258, v253.Balloon.OuterBalloonPart);
- u1.Network.Fire("AwardTipWithVerification", p75.UID, v251.UID, p75.stateData.foodOrder.ID);
- if not p85 then
- u23 = false;
- return;
- end;
- p75:WalkToPoint(l__xVoxel__24, l__yVoxel__25, l__zVoxel__26, function()
- u23 = false;
- if p75.stateData.mySeat.isDeleted then
- p75:ForcedToLeave();
- return;
- end;
- p75:SitInSeat(p75.stateData.mySeat);
- end);
- end);
- break;
- end;
- end;
- if v249 then
- while true do
- wait();
- if not v249 then
- break;
- end;
- end;
- end;
- return v248;
- end;
- local u27 = {};
- local u28 = nil;
- local u29 = nil;
- if #v235.goldSilverwareTrays > 0 then
- local v259 = v235.goldSilverwareTrays[1];
- u9 = true;
- u10 = true;
- u11 = v259.UID;
- p75:StandUp();
- local l__xVoxel__30 = p75.xVoxel;
- local l__yVoxel__31 = p75.yVoxel;
- local l__zVoxel__32 = p75.zVoxel;
- p75:WalkToPoint(v259.xVoxel, v259.yVoxel, v259.zVoxel, function()
- if v259.isDeleted then
- u9 = false;
- p75:ForcedToLeave();
- return;
- end;
- local v260 = { 5601560377, 5601560515, 5601560641 };
- u1.SFX.Play(v260[math.random(#v260)], v259.model.PrimaryPart);
- p75:FaceEntity(v259);
- wait(0.3);
- if not u12(true, false) then
- u17(true, false);
- end;
- u22(true, false);
- p75:WalkToPoint(l__xVoxel__30, l__yVoxel__31, l__zVoxel__32, function()
- u9 = false;
- if p75.stateData.mySeat.isDeleted then
- p75:ForcedToLeave();
- return;
- end;
- p75:SitInSeat(p75.stateData.mySeat);
- if v259.ID == "25" then
- u28 = game.ReplicatedStorage.Assets.Models["Luxury Fork"]:Clone();
- u29 = game.ReplicatedStorage.Assets.Models["Luxury Spoon"]:Clone();
- u28.Parent = p75.model;
- u29.Parent = p75.model;
- local v261 = Instance.new("Weld", u28);
- v261.Part0 = u28;
- v261.Part1 = p75.model.RightHand;
- v261.C0 = CFrame.Angles(-math.pi / 2, 0, 0);
- table.insert(u27, v261);
- local v262 = Instance.new("Weld", u29);
- v262.Part0 = u29;
- v262.Part1 = p75.model.LeftHand;
- v262.C0 = CFrame.Angles(-math.pi / 2, 0, 0);
- table.insert(u27, v262);
- return;
- end;
- u28 = game.ReplicatedStorage.Assets.Models["Default Fork"]:Clone();
- u29 = game.ReplicatedStorage.Assets.Models["Default Spoon"]:Clone();
- u28.Parent = p75.model;
- u29.Parent = p75.model;
- local v263 = Instance.new("Weld", u28);
- v263.Part0 = u28;
- v263.Part1 = p75.model.RightHand;
- v263.C0 = CFrame.Angles(-math.pi / 2, 0, 0);
- table.insert(u27, v263);
- local v264 = Instance.new("Weld", u29);
- v264.Part0 = u29;
- v264.Part1 = p75.model.LeftHand;
- v264.C0 = CFrame.Angles(-math.pi / 2, 0, 0);
- table.insert(u27, v264);
- end);
- end);
- elseif #v235.silverwareTrays > 0 then
- local v265 = false;
- for v266 = 1, #v235.silverwareTrays do
- if math.random() < 0.2 then
- v265 = true;
- end;
- end;
- if v265 then
- local v267 = v235.silverwareTrays[1];
- u9 = true;
- u10 = true;
- u11 = v267.UID;
- p75:StandUp();
- local l__xVoxel__33 = p75.xVoxel;
- local l__yVoxel__34 = p75.yVoxel;
- local l__zVoxel__35 = p75.zVoxel;
- p75:WalkToPoint(v267.xVoxel, v267.yVoxel, v267.zVoxel, function()
- if v267.isDeleted then
- u9 = false;
- p75:ForcedToLeave();
- return;
- end;
- local v268 = { 5601560377, 5601560515, 5601560641 };
- u1.SFX.Play(v268[math.random(#v268)], v267.model.PrimaryPart);
- p75:FaceEntity(v267);
- wait(0.3);
- if not u12(true, false) then
- u17(true, false);
- end;
- u22(true, false);
- p75:WalkToPoint(l__xVoxel__33, l__yVoxel__34, l__zVoxel__35, function()
- u9 = false;
- if p75.stateData.mySeat.isDeleted then
- p75:ForcedToLeave();
- return;
- end;
- p75:SitInSeat(p75.stateData.mySeat);
- if v267.ID == "25" then
- u28 = game.ReplicatedStorage.Assets.Models["Luxury Fork"]:Clone();
- u29 = game.ReplicatedStorage.Assets.Models["Luxury Spoon"]:Clone();
- u28.Parent = p75.model;
- u29.Parent = p75.model;
- local v269 = Instance.new("Weld", u28);
- v269.Part0 = u28;
- v269.Part1 = p75.model.RightHand;
- v269.C0 = CFrame.Angles(-math.pi / 2, 0, 0);
- table.insert(u27, v269);
- local v270 = Instance.new("Weld", u29);
- v270.Part0 = u29;
- v270.Part1 = p75.model.LeftHand;
- v270.C0 = CFrame.Angles(-math.pi / 2, 0, 0);
- table.insert(u27, v270);
- return;
- end;
- u28 = game.ReplicatedStorage.Assets.Models["Default Fork"]:Clone();
- u29 = game.ReplicatedStorage.Assets.Models["Default Spoon"]:Clone();
- u28.Parent = p75.model;
- u29.Parent = p75.model;
- local v271 = Instance.new("Weld", u28);
- v271.Part0 = u28;
- v271.Part1 = p75.model.RightHand;
- v271.C0 = CFrame.Angles(-math.pi / 2, 0, 0);
- table.insert(u27, v271);
- local v272 = Instance.new("Weld", u29);
- v272.Part0 = u29;
- v272.Part1 = p75.model.LeftHand;
- v272.C0 = CFrame.Angles(-math.pi / 2, 0, 0);
- table.insert(u27, v272);
- end);
- end);
- end;
- end;
- if u9 then
- while true do
- wait();
- if not u9 then
- break;
- end;
- end;
- end;
- if not u6 and not u12(false, true) then
- u17(false, true);
- end;
- if not u8 then
- u22(false, true);
- end;
- p75:PlayLoadedAnimation("eating");
- u1.SFX.Play(5205174537, p75.model.PrimaryPart, nil, 0.6);
- if math.random() < 0.5 then
- local v273 = 5029600710;
- else
- v273 = 5029600543;
- end;
- p75.stateData.loopedEatingSound = u1.SFX.Play(v273, p75.model.PrimaryPart, 1 + (math.random() - 0.5) * 0.1, 0.85, 35, nil, true);
- coroutine.wrap(function()
- local v274 = u1.Network.Invoke("WaitForEatTime", p75.ID, p75.UID, u11);
- if not p75.isDeleted and p75.state == "EatingFood" then
- if p75.stateData.loopedEatingSound then
- p75.stateData.loopedEatingSound = p75.stateData.loopedEatingSound:Destroy();
- end;
- p75.stateData.foodOrder:ChangeToDirtyDish();
- p75:StopLoadedAnimation("eating");
- p75:ChangeToReadyToExitState(v274);
- if u28 then
- u28:Destroy();
- u29:Destroy();
- local v275, v276, v277 = ipairs(u27);
- while true do
- v275(v276, v277);
- if not v275 then
- break;
- end;
- v277 = v275;
- v276:Destroy();
- end;
- u27 = {};
- end;
- end;
- end)();
- end)();
- end;
- function v3.PingForFoodDelivery(p86)
- p86:Emoji("ServeEmoji");
- p86:Interact(function(p87)
- if (l__LocalPlayer__3.Character:GetModelCFrame().p - p86.model.PrimaryPart.Position).Magnitude > 12 then
- return;
- end;
- if u1.Variables.MyBakery.isTutorial then
- u1.Signal.Fire("Tutorial_FinishedServing");
- end;
- u1.SFX.Play(5074101610, l__LocalPlayer__3.PlayerGui);
- p87();
- p86:StopEmoji();
- u1.PlayerAnimations.DropModel();
- if l__LocalPlayer__3:FindFirstChild("__ACTIVATED_CARRY") then
- l__LocalPlayer__3.__ACTIVATED_CARRY:Destroy();
- end;
- u1.Network.Fire("AwardBakeryExperienceWithVerification");
- p86:ChangeToEatingState();
- end);
- end;
- function v3.GoToTargetChair(p88)
- local v278 = nil;
- if p88.isDeleted then
- return;
- end;
- if not p88.stateData.seatUID then
- u1.Print("Error: Can't sit customer at chair because it is unassigned", true);
- p88:ForcedToLeave();
- return;
- end;
- if not p88.stateData.tableUID then
- u1.Print("Error: can't sit customer at table because it is unassigned", true);
- p88:ForcedToLeave();
- return;
- end;
- if p88.state ~= "WaitingForSeat" then
- return;
- end;
- p88:SetCustomerState("WalkingToSeat");
- if math.random() < 0.15 or u1.Variables.MyBakery.isTutorial then
- p88:TimedEmoji("HappyEmoji", 1.75);
- end;
- local v279 = p88:GetMyFloor();
- local v280 = p88:EntityTable()[p88.stateData.seatUID];
- v278 = p88:EntityTable()[p88.stateData.tableUID];
- if not v280 or not v278 then
- p88:ForcedToLeave();
- return;
- end;
- p88:WalkToNewFloor(v280:GetMyFloor(), function()
- p88:WalkToPoint(v280.xVoxel, v280.yVoxel, v280.zVoxel, function()
- if v280.isDeleted or v278.isDeleted then
- p88:ForcedToLeave();
- return;
- end;
- p88:FaceEntity(v280);
- wait(0.3);
- if not u1.Variables.MyBakery.isOpen then
- p88:ForcedToLeave();
- return;
- end;
- p88:ChangeToWaitForOrderState();
- end, true);
- end);
- end;
- function v3.EquipLei(p89)
- local v281 = Instance.new("Part");
- v281.Name = "LeiPart";
- v281.formFactor = 0;
- v281.Size = Vector3.new(0, -0.25, 0);
- v281.BottomSurface = 0;
- v281.TopSurface = 0;
- v281.Locked = true;
- v281.CanCollide = false;
- v281.Parent = p89.model;
- game.ReplicatedStorage.Assets.Models.LeiMesh:Clone().Parent = v281;
- local v282 = Instance.new("Weld");
- v282.Part0 = v281;
- v282.Part1 = p89.model.Head;
- v282.C0 = CFrame.new(0, -0.65, 0);
- v282.Parent = v281;
- end;
- local function u36(p90, p91, p92, p93)
- local v283 = p90:GetMyFloor();
- local v284 = u1.Pathfinding.CalculatePath(v283:GenerateObstacleTable(), p90.xVoxel, p90.zVoxel, p91, p93);
- local v285 = {};
- local v286, v287, v288 = ipairs(v284);
- while true do
- v286(v287, v288);
- if not v286 then
- break;
- end;
- v288 = v286;
- table.insert(v285, v283:WorldPositionFromVoxel(v287.x, p90.yVoxel, v287.y));
- end;
- return v284, v285;
- end;
- function v3.WalkToPoint(p94, p95, p96, p97, p98)
- if p94.stateData.busyWalking then
- return;
- end;
- p94.stateData.busyWalking = true;
- p94:PlayLoadedAnimation("walking");
- local v289, v290 = u36(p94, p95, p96, p97);
- local v291 = {};
- coroutine.wrap(function()
- if p94:BelongsToMyBakery() then
- u1.Replication.SendEvent("NPCWalkingFromPointToPoint", p94.UID, v289);
- end;
- p94:WalkThroughWaypoints(v289, v290, p94.xVoxel, p94.zVoxel);
- p94.stateData.busyWalking = false;
- coroutine.wrap(function()
- p94:NetworkMyVoxelPosition();
- end)();
- p94:StopLoadedAnimation("walking");
- p94:PlayLoadedAnimation("idle");
- if p98 then
- p98();
- end;
- end)();
- end;
- function v3.WalkToNewFloor(p99, p100, p101)
- local v292 = p99:GetMyFloor();
- if p100 and v292.floorLevel ~= p100.floorLevel then
- p99:WalkToPoint(v292.floorTransitionXVoxel, p99.yVoxel, v292.floorTransitionZVoxel, function()
- p99:FadeTransparency(1, function()
- p99:TransitionToDifferentFloor(p100);
- p99:FadeTransparency(p99:GetMyTransparency(), function()
- if p101 then
- p101();
- end;
- end);
- end);
- end, false, true);
- return;
- end;
- if p101 then
- p101();
- end;
- end;
- function v3.WalkToPointInQueue(p102, p103, p104, p105, p106)
- p104 = p104 and 0;
- if p102.isDeleted then
- return;
- end;
- if p102.stateData.busyWalking then
- return;
- end;
- p102.stateData.busyWalking = true;
- p102:PlayLoadedAnimation("walking");
- local v293 = p102:GetMyFloor():WorldPositionFromVoxel(p103, p102.yVoxel, p105);
- if p102:BelongsToMyBakery() and p102.stateData.queueGroup then
- local v294 = nil;
- local v295 = #p102.stateData.queueGroup + 1;
- v294 = CFrame.Angles(0, p102:GetMyBakery().baseAngle, 0);
- if v295 == 1 then
- v293 = v293 + (v294 * CFrame.new(2, 0, 0)).p;
- elseif v295 == 3 then
- v293 = v293 + (v294 * CFrame.new(-2, 0, 0)).p;
- end;
- end;
- if p102:BelongsToMyBakery() then
- u1.Replication.SendEvent("NPCWalkingFromPointToPointWithoutPathfinding", p102.UID, p103, p105);
- end;
- coroutine.wrap(function()
- p102.humanoid:MoveTo(v293);
- p102.humanoid.MoveToFinished:Wait();
- p102.xVoxel = p103;
- p102.zVoxel = p105;
- p102:NetworkMyVoxelPosition();
- p102:GetMyFloor():BroadcastNPCPositionChange(p102, p102.xVoxel, p102.zVoxel);
- p102.stateData.busyWalking = false;
- p102:StopLoadedAnimation("walking");
- p102:PlayLoadedAnimation("idle");
- if p106 then
- p106();
- end;
- end)();
- end;
- return v3;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement