I donât believe you can in lua, if overhead isnât a problem then the best other option is iterating through all your parts
local success = true
for _, TargetPart in model:GetChildren() do
if TargetPart.Transparency == 1 then continue; end -- just avoiding another scope here, you can change this if you don't like it
success = false
break
end
if success then
-- blah blah
end
So I tried to use that and adapt it to my script and I added a new model to test it out, made the part transparent, and it still donât end up with success, so Idk if I did anything wrong.
Here is my script if you want to check it out :
local ReplicatedStorage = game.ReplicatedStorage.KeysRemote.KEYCHECKER
local ProximityPrompter = script.Parent
ProximityPrompter.Triggered:Connect(function(player)
local success = true
for _, TargetPart in game.Workspace.test:GetChildren() do
if TargetPart.Transparency ~= 1 then continue;
end
success = false
print("failed")
break
end
wait(2)
if success then
print("Succes")
else
print("not success")
end
end)
oh sorry I misread your post, the code I provided was checking if all the parts arenât transparent, you can replace the ânot equal toâ operator ~= with an âequal toâ operator == to fix it