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

How do I print everything except these models?

Previously in my old question, I managed to get of how to delete all models but except a couple. But now how do I print the names?

Heres the script:

for i, v in pairs(game.Workspace:GetChildren()) do
    if v.ClassName == "Model" then
        if v.Name ~= "name" or v.Name ~= "name" or v.Name ~= "name" then
        print(**What do I put here now?**)
    end
end

[I know this isn't a request site but legit I tried so many ways but I don't know how.]

I have done print(v) but it prints everything in workspace. I also tried print(v.Name) and it doesn't work.

1 comment

0

if v.Name ~= 'MODEL1' and v.Name ~= 'MODEL2' and v.Name ~= 'MODEL3' then

2 answers

✓ Accepted answer

Try this, and use 'and' instead of 'or' because the 'or' will still print all of them

for i, v in pairs(game.workspace:GetChildren()) do
	if v:IsA("Model") then
		if v.Name ~= 'name' and v.Name ~= 'name' and v.Name ~= 'name' then
			print(v)
		end
	end
end
for i, v in pairs(game.Workspace:GetChildren()) do
    if v.ClassName == "Model" then
        if v.Name ~= "name" then
        print(v.Name)
		end
    end
end

missing an end

1 comment

0

L0L

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