Milkshake Machines

Hello!

I am working on a bakery currently, and have got the milkshake machines done, and all the flavours and milk, but I have no idea how I could script it and YT videos aren’t showing me how I could make it In a advanced way, for example: Milk + Flavour + Blender.

Any ideas or videos that can help me?
Thanks, George.

3 Likes

What exactly do you want to script? The movement or some other functionality?

1 Like

I want to script the functions. To make it that when a cup touches to end of the machines, it fills the cup with the milk, then the flavour, and then the blender changes the name from Milk + Oreo for example, to Oreo Milkshake.

1 Like

My tip would be to break down the problems into smaller parts such as:

  • Detecting a cup
  • Filling a cup
    and so on.
1 Like

Well here is an simple idea, but I might have done the scripting wrong but its and basic idea of what you could do. And I suggest for filling the cup using Tweening .

//–// Not Tested Code:

local Cup = game.StarterPack.Cup
local Humanoid = plr:FindFirstChild("Humanoid")
local plr = game.Players.LocalPlayer
local MilkShakeMachine = game.Workspace.MilkshakeMachine or Workspace.MilkshakeMachine

Cup.Touched:Connect(function(plr))
    Humanoid.WalkSpeed = 0
    --rest of code goes here
end)
2 Likes
  • Detecting a cup

  • Filling cup with milk

  • Filling cup with flavour

  • Blender detects cup with flavours

  • Makes final milkshake

1 Like

You’re asking for the full system; this is not what the category is for.
If you want support show the code you have written till now or atleast the frame work.

Otherwise I have a framework for you.

First when you click on the milk button, an int value is changed to 1
now with another script you can check if the int value is == to 1 and if it is equal to 1 then you can perform the function and vice versa for other stuff like flavours.
Though this is a very hacky method I would recommend you to make it with a module script.

If you have any questions dont hesitate to ask.

4 Likes