local player = game.Players.LocalPlayer
for index, swag in pairs(workspace:GetChildren()) do
if swag.Name == "DylansVendingMachine" then
dank = swag.Buttons.SurfaceGui
end
end
dank.Coke.MouseButton1Click:connect(function()
local memes = game.Lighting.Coke:Clone()
memes.Parent = player.Backpack
end)
dank.MtnDew.MouseButton1Click:connect(function()
local memes = game.Lighting["Mtn Dew"]:Clone()
memes.Parent = player.Backpack
end)
dank.Pepsi.MouseButton1Click:connect(function()
local memes = game.Lighting.Pepsi:Clone()
memes.Parent = player.Backpack
end)
dank.DrPepper.MouseButton1Click:connect(function()
local memes = game.Lighting.DrPepper:Clone()
memes.Parent = player.Backpack
end)
COMMUNITY QUESTION
Why does this only work for one vending machine?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
you should not use Lighting to store models ect use server storage, replicated storage
Alright but that doesn't answer my question