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

How to check if multiple parts exist in workspace?

Asked by
ded_srs 30
4 years ago

I'm trying to check if bread_part, ingredient1, ingredient2 are existing in workspace (at the same time)

while true do
    wait(3)
    if game.Workspace:FindFirstChild("bread_part") and game.Workspace.FindFirstChild("ingredient1") and game.Workspace:FindFirstChild("ingredient2") then
        print("condition met")
    end
end

The script works when I'm only looking for one object

while true do
    wait(3)
    if game.Workspace:FindFirstChild("bread_part") then
        print("win condition met")
    end
end

But it doesn't work when I'm checking for 3 objects at once

1 answer

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

*edit

Turns out the script was working after all. Sorry for posting :P

Ad

Answer this question