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.
99% sure this is a troll dude anyway
local Thetool = game:FindFirstChild("Taco",true) function onClick() local Tool = Thetool:Clone() Tool.Parent = workspace Tool.Handle.Position = script.Parent.Parent.Parent.Position end script.Parent.ClickDetector.MouseClick:Connect(onClick)
This should work if not then "Tool.Handle.Position = script.Parent.Parent.Parent.Position" is your problem and you should check if the script.parent.parent,parent is really a part or union.