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

How do I print everything except these models?

Asked by 6 years ago
Edited 6 years ago

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.

0
`if v.Name ~= 'MODEL1' and v.Name ~= 'MODEL2' and v.Name ~= 'MODEL3' then` TheeDeathCaster 2368 — 6y

2 answers

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

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
Ad
Log in to vote
0
Answered by
GingeyLol 338 Moderation Voter
6 years ago
Edited 6 years ago
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

0
L0L Nep_Ryker 131 — 6y

Answer this question