Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I'm making a Bakery Group on roblox. A script doesn't work, can anybody help?

Asked by 4 years ago
Edited 4 years ago

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?

1
Use the "lua" image and put your code inside to format it better DarkDanny04 407 — 4y
0
Done. lqveries 17 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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?

0
Wait 20 is the baking time. And, what I want it to do is if you have a Donut Tray, it'll pop up with a gui and destroy your donut tray. The gui has the time it's cooking, and after the time, it'll give you the cooked food. But, it never shows the GUI, and never does anything else either. lqveries 17 — 4y
Ad

Answer this question