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

3 comments
I have never used that before how do you use that instead?
i finally fixed this problem. i had 2 DrinkandFood folders in my Lighting.... lol... oops! ( so how do i change to use the ReplicatedStorage instead?
All you need to do is move the the stuff you have stored in lighting and move it into replicated storage, change the variables, and bam. Honestly you can do a few cool things, with it, but for now, just move everything over. The wiki has an article on it if you're really interested