script.Parent.ClickDetector.MouseClick:Connect(function(player) local cup = game.Lighting.Cup cup:Clone() cup.Parent = player.Backpack end)
What I've tried to create here is a cup dispenser. After clicking the cup, a tool version of the cup from game.Lighting should clone and become a child of my backpack, but it won't be cloned, so it won't work after I've clicked it once. Have I done this incorrectly? Is it too simple?
It should be this
script.Parent.ClickDetector.MouseClick:Connect(function(player) local cup = game.Lighting.Cup:Clone() cup.Parent = player.Backpack end)
Before you were setting the parent of the original because you didn't save the clone in a variable