Vending machine flavours

It didn’t.

  • 30 chars --------------

Does it print any errors in /console or output?

I’m not sure, without it however, the name isn’t changed from milk to mango smoothie.

1 Like

I’ve not looked, it doesn’t work at all the original script works better all that needs to change is that it is looking for a mesh part when the ’ drink ’ thing is a model.

The fact that you’re not sure what h does leads me to believe that you followed a tutorial for this script. Please refer to the tutorial and try going over the steps again.

I took apart a model, and the model has a mesh part however my ’ drink ’ part is a part, not a mesh part.

function tch(h)
if (h.Parent.Name == "Milk") then -- if 'milk' is a model do: if(h.Parent.Parent.Name == "Milk") then
h.Parent.Name = "MangoSmoothie" -- If u want to change the model's name do: h.Parent.Parent.Name = "MangoSmoothie" 
wait(0.5)
h.Parent.BrickColor = script:WaitForChild("Color").Value
h.Parent.Transparency = 0
end
end

Try this

Can you please link the original model you used and I’ll take a look at it? I can’t tell if this is a problem with the model or the script.

https://www.roblox.com/library/940130660/Smoothie-Machine-for-your-cafe

I had no idea how to make it, so I looked at this model and copied what they did.

Nope, doesn’t work at all and doesn’t change the name.

Is there anyway you can use the original model instead of trying to make your own? Or do you have to use your own model in order to get certain results?

Add print statements after every line of code, and from there figure out which line is not functioning

1 Like

Yea, I need to use my own model to get certain results because my machines are differently modelled and I have put hours into modelling them.

1 Like

In that case, I think you should do this:

I’ll try to look for more tutorials, I have a functioning script it is just the brick colouring part.

1 Like

When the brick is colored, does it turn black (0,0,0) or does it turn white (255,255,255)?

Nothing at all happens, that is the issue.

The issue is that it is going to a mesh part when the ’ drink ’ instance is a model, I need help writing the script so instead of a mesh part it is just a normal part.

It is a part, not a mesh part.

image

I’m not talking about drink. I’m talking about “Mango.”
Mango is a Model, not a MeshPart. The error you’re getting in output is that Drink isn’t a valid child of a MeshPart, which is how the script is written. I’m trying to find where the script went wrong though.