Okay, so: This is the code:
local donut = game.ReplicatedStorage.Donut:Clone()
local baking = game.ReplicatedStorage.Baking:Clone()
script.Parent.ClickDetector.MouseClick:Connect(function(Player)
Player.Backpack:FindFirstChild("Donut Tray")
game.ReplicatedStorage.Baking:Clone()
baking.Parent = Player.PlayerGui
wait(20)
game.ReplicatedStorage.Donut:Clone()
donut.Parent = Player.Backpack
Player.Backpack["Donut Tray"]:Destroy()
end)
And it says "Donut Tray" is not a valid member of Backpack, but it is, and I really don't understand it, please, any help?
(This is what I want it to do: I want it so you click on it, making it so it bakes it, and it puts a GUI of a timer of how long until you get your item, and then it gives you the Donut. But, for some reason, it doesn't let me destroy the Donut Tray.)
(I fixed it! Ty guys! <3)

3 comments
edit your question, select the code and click in the lua Icon so we can read it propperly
Done.
The reason it might not delete it is that when it is equipped, it goes into the character, so if you have it equipped when it tries to delete it, it won't work