I have a script that works in studio, but not in the actual game. What is wrong? It isn't cloning my milk tool into the player's inventory.
local CupTool = game.ServerStorage.Milk
script.Parent.Touched:connect(function(hit)
if hit.Parent.Name == "Empty Cup" then
hit.Parent:Destroy()
CupTool:Clone().Parent = game.Players.LocalPlayer.Backpack
wait()
end
end

1 comment
It is not a local script.