I have a line in one of my scripts that only adds a client instance to a table if it’s not a sound or another ClassName, however it still ends up adding all the default roblox sounds for animations with this line of code and I don’t know why:
for i,v in pairs(playerChar:GetDescendants()) do -- defining descendantsTable
if not v:IsA("Animation") or not v:IsA("StringValue") and not v:IsA("ObjectValue") and not v:IsA("Sound") then
descendantsTable[v.Name] = true
end
end
I don’t think you can use and, or in the same line.
for i,v in pairs(playerChar:GetDescendants()) do -- defining descendantsTable
if not v:IsA("Animation") and not v:IsA("StringValue") and not v:IsA("ObjectValue") and not v:IsA("Sound") then
descendantsTable[v.Name] = true
end
end
for i,v in pairs(playerChar:GetDescendants()) do -- defining descendantsTable
if not (v:IsA("Animation") or v:IsA("StringValue")) and not v:IsA("ObjectValue") and not v:IsA("Sound") then
descendantsTable[v.Name] = true
end
end