Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to bypass a nil model?

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

2 comments

0

Explain your problem more, please?

0

? As in the model is named nil, it does not exist, or ???????????????

1 answer

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.

2 comments

0

How do you do that? Just the model.Parent ~= nil?

0

Yes.

This discussion is preserved as it was. New answers, comments, and votes are closed.