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

How to bypass a nil model?

Asked by 6 years ago

How do you make it that you bypass a nil model when you need to check with a for iv, in pairs function? So that everything still works after something is nill

0
Explain your problem more, please? GoldenPhysics 474 — 6y
0
? As in the model is named nil, it does not exist, or ??????????????? hiimgoodpack 2009 — 6y

1 answer

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

Just check whether it is not nil, like so:

for _.Model in pairs (Models) do
    if Model ~= nil then
        -->> Code
    end
end

You may want to check if the model's parent is nil, also.

0
How do you do that? Just the model.Parent ~= nil? robloxy0123 30 — 6y
0
Yes. TheDeadlyPanther 2460 — 6y
Ad

Answer this question