Yes, here’s the full code if you need it.
local customer = nil
local player = game.Players.PlayerAdded:Wait()
local customers = game.ServerStorage.Customers:GetChildren()
local starts = {"hmm.. dunno what i want yet..", "lovely day for a smoothie, huh?", "surprising this place is open 24 hours.",
"i'm tired.. sure something on your menu will wake me up.", "this place is open 24 hours? i could never.",
"hi there!", "everything looks good..", "hmm.. do you have any recommendations?", "i look like i'm thinking but i already know what i want.",
"what's up?", "this place looks fancy.", "what is up??", "i'm in the mood for a DELICIOUS SMOOTHIE!!", "require smoothie i do."
}
local orders = {"Empty Cup", "Red Cup"}
local endings = {"thank you kindly.", "have a nice day.", "nice doing business with you!", "this is the best day of my WHOLE LIFE.",
"surprisingly nice service, i'll come back tommorrow.", "maybe i'll come back.", "thanks!", "that was quick.",
"THIS SERVICE IS BETTER THAN UNICORNS AND RAINBOWS!!!!", "keep the change."
}
local fails = {"should i just come back tommorrow?", "this isn't what i ordered..", "not quite..", "wow. great. i'm so happy.",
"close enough..", "seriously? i used to come here all the time.", "this is the worst day of my WHOLE LIFE.",
"never again shall i enter the sorrowing pit that is this smoothie prison.", "do i deserve this?"
}
local CS = game:GetService("Chat")
local function chat(part, msg)
CS:Chat(part, msg, Enum.ChatColor.Blue)
part.bass:Play()
end
local function setbeam(boolean)
for i, v in pairs(game.Workspace.OrderBeam:GetChildren()) do
if v:IsA("Beam") then
v.Enabled = boolean
end
end
end
local function waituntilplace(order)
while true do
game.Workspace.OrderBeam.ProximityPrompt.Triggered:Wait()
local itemfound = player.Character:FindFirstChild(order)
if itemfound then
itemfound.Parent = game.Workspace.InBeam
itemfound.Handle.CFrame = CFrame.new(-8.325, 4.278, -0.192)
itemfound.Handle.Anchored = true
task.wait(0.1)
game.Workspace.OrderBeam.ProximityPrompt.Enabled = false
game.Workspace.DeskBell.ClickPart.ClickDetector.MouseClick:Wait()
return true
elseif not itemfound and player.Character:FindFirstChildOfClass("Tool") then
local item2 = player.Character:FindFirstChildOfClass("Tool")
item2.Parent = game.Workspace.InBeam
item2.Handle.CFrame = CFrame.new(-8.325, 4.278, -0.192)
item2.Handle.Anchored = true
game.Workspace.OrderBeam.ProximityPrompt.Enabled = false
game.Workspace.DeskBell.ClickPart.ClickDetector.MouseClick:Wait()
game.SoundService.Fail:Play()
return false
end
end
end
setbeam(false)
local walktrack
local thinktrack
local paytrack
local holdtrack
for i, v in pairs(game.ServerStorage.Customers:GetChildren()) do
task.wait(1)
local Humanoid = v:WaitForChild("Humanoid")
walktrack = Humanoid.Animator:LoadAnimation(script.Walk)
thinktrack = Humanoid.Animator:LoadAnimation(script.Think)
paytrack = Humanoid.Animator:LoadAnimation(script.Pay)
holdtrack = Humanoid.Animator:LoadAnimation(script.HoldDrink)
end
while true do
task.wait(5)
local failed = false
customer = customers[math.random(1, #customers)]
customer.Parent = game.Workspace
customer.Humanoid:MoveTo(Vector3.new(-13.607, 3.939, -0.362))
walktrack:Play()
game.SoundService.SFX.Bell:Play()
customer.Humanoid.MoveToFinished:Wait()
walktrack:Stop()
customer.LookAtPlayer.Enabled = true
task.wait(2)
chat(customer.Head, starts[math.random(1, #starts)])
thinktrack:Play()
task.wait(3)
local order = orders[math.random(1, #orders)]
thinktrack:Stop()
setbeam(true)
chat(customer.Head, "i'll take a "..order..", please.")
game.Workspace.OrderBeam.Ordering.Value = true
game.Workspace.OrderBeam.ProximityPrompt.Enabled = true
if waituntilplace(order) == true then
game.Workspace.OrderBeam.Ordering.Value = false
task.wait(0.1)
game.Workspace.OrderBeam.ProximityPrompt.Enabled = false
chat(customer.Head, endings[math.random(1, #endings)])
local toolinbeam = game.Workspace.InBeam:FindFirstChildOfClass("Tool")
toolinbeam.Handle.Anchored = false
toolinbeam.Parent = customer
holdtrack:Play()
game.ReplicatedStorage.Served:FireClient(player)
setbeam(false)
paytrack:Play()
paytrack.Stopped:Wait()
game.ServerStorage.PaidCash.Parent = game.Workspace
game.Workspace.PaidCash.Collect:Play()
task.spawn(function()
task.wait(2)
game.Workspace.PaidCash.Parent = game.ServerStorage
end)
else
failed = true
game.Workspace.OrderBeam.Ordering.Value = false
task.wait(0.1)
game.Workspace.OrderBeam.ProximityPrompt.Enabled = false
chat(customer.Head, fails[math.random(1, #fails)])
game.Workspace.InBeam:FindFirstChildOfClass("Tool"):Destroy()
customer.Head.AnswerGui.Wrong.ImageTransparency = 0
setbeam(false)
end
customer.LookAtPlayer.Enabled = false
customer.Humanoid:MoveTo(Vector3.new(-71.412, 3.939, -0.362))
walktrack:Play()
customer.Humanoid.MoveToFinished:Wait()
customer.Parent = game.ServerStorage.Customers
customer.Head.AnswerGui.Wrong.ImageTransparency = 1
if failed == false then
customer:FindFirstChildOfClass("Tool"):Destroy()
end
holdtrack:Stop()
walktrack:Stop()
end