So, I'm making a ROBLOX Bakery group, and the script for the Donut Tray in the oven is:
local donut = game.ReplicatedStorage.Donut:Clone()
local baking = game.ReplicatedStorage.Baking:Clone()
script.Parent.ClickDetector.MouseClick:Connect(function(Player)
if Player.Backpack:FindFirstChild("Donut Tray") then
game.ReplicatedStorage.Baking:Clone()
baking.Parent = Player.PlayerGui
Player.Backpack["Donut Tray"]:Destroy()
wait(20)
game.ReplicatedStorage.Donut:Clone()
donut.Parent = Player.Backpack
end
end)
But for some reason, it doesn't work, and nothing in the output is wrong..
Help?

2 comments
Use the "lua" image and put your code inside to format it better
Done.