ok, I have designed a few machines and I have one that works.
I wanted a bigger one so a made one 2x the size ( everything is made the same)
I used the same script.
the small one works , but the large one don't.
can anyone see what is wrong with this so the large one will work.
I don't understand why the small one works but the large one wont.
it keeps giving me an error
21:28:03.959 - Workspace.MyVendingMachineThree.ImportantParts.Script:2: attempt to index a nil value
21:28:03.959 - Stack Begin
21:28:03.959 - Script 'Workspace.MyVendingMachineThree.ImportantParts.Script', Line 2 - global onClicked
21:28:03.960 - Script 'Workspace.MyVendingMachineThree.ImportantParts.Script', Line 11
21:28:03.960 - Stack End
function onClicked(Name, Holder) local DOF = game.Lighting.DrinkandFood:findFirstChild(Name):clone() DOF.Parent = game.Workspace DOF.Handle.CFrame = Holder.CFrame DOF.Handle.Anchored = false end local c = script.Parent:GetChildren() for i = 1, #c do if c[i].className == "Part" then c[i].ClickDetector.MouseClick:connect(function() onClicked(c[i].Name, c[i].Holder)end) end end
thanks for the help
as well here is the path to everything...
Workspace MyVendingMachineThree Lighting
those are the ones needed both the machine and lighting are under workspace right now. but that shouldnt really matter
Are you sure there is a MyVendingMachineThree in lighting? Check for typos. Also you shouldn't store those things in lighting anymore, as roblox has created ReplicatedStorage.