So, I am trying to make a vending machine work but it keeps giving me this error.
Foods is not a valid member of Model
I don't know what to do to fix this, so I am asking for help.
The script that is in one of the items is below. By the way, the vending machine has two of the same tools named different. For example
Tool1 or Tool2
local Thetool = script.Parent.Parent.Parent.Foods.Taco
function onClick()
local Tool = Thetool:Clone()
Tool.Parent = game.Workspace
Tool.Handle.Position = script.Parent.Parent.Parent.Position
end
script.Parent.ClickDetector.MouseClick:connect(onClick)
That is from one of the buttons.
