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

I'm trying to make a script that looks for a part and if it isn't there it function, Help?

Asked by 4 years ago

this is my script and if you know how to fix it tell me how to please

if game.Workspace.Songs == nil then
0
if game.workspace:FindFirstChild("Songs") == nil then end or if not game.workspace:FindFirstChild("Songs") then end misha123 83 — 4y
0
i will try GameStealerKid 79 — 4y
0
didnt work GameStealerKid 79 — 4y
0
Try my answer and tell me what happens if it does not work. Memotag 226 — 4y

1 answer

Log in to vote
1
Answered by
Memotag 226 Moderation Voter
4 years ago
Edited 4 years ago
if not workspace:FindFirstChild("Songs") then
    -- Code here
end

If it exists then it will return true, if not then it will return false.

Ad

Answer this question