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?
This was just so I could see it. I did not answer it.
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)
You should start formatting your code if you didn't. Don't know why there is a wait(20). That seems unnecessary lol.
What about this is not working correctly? Everything is "correct" in what you are doing but probably wrong for the task that you want. What do you want this code to do?