So I tried to make this vending machine script where if I press on it, it moves a soda can tool into starterpack. Im fairly new to scripting and its not giving me errors in the output.
local soda = script.Parent.Soda local ClickDetector = script.Parent.ClickDetector local vendingMachineClick = function() soda.Parent = game.StarterPack end ClickDetector.MouseClick:Connect(vendingMachineClick)
Don't put it in the starter pack, put it in the players backpack. If this is a local script, then do this
local Player = game.Players.LocalPlayer local ClickDetector = script.Parent.ClickDetector local VendingMachineClick = function() script.Parent.Soda.Parent = Player.Backpack end
If it's a server script, well you can type this
script.Parent.ClickDetector.MouseClick:Connect(function(Player) script.Parent.Soda.Parent = Player.Backpack end)