I have a crate, and in that crate I've created a script (not localscript) that tries to clone a piece of meat that I have in storage and put it in the backpack. Maybe this doesn't make sense since a piece of meat is not a tool, and I need to create some sort of custom inventory storage for how much meat you have? Anyway, this is the code I've tried:
-- Create a click detector in the part in order to be able to detect clicks.
local click_detector = Instance.new('ClickDetector', script.Parent)
-- Give the tool to the player when the button is clicked.
click_detector.MouseClick:connect(function(player)
local newMeat = game.ReplicatedStorage["Meat"]:Clone()
newMeat.Parent = player.Backpack
print("Added meat")
end)
It prints "Added meat" in the debug window when I click the crate, but nothing shows in the backpack.

1 comment
If its not a tool, it wont show up.