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

I keep getting Transparency is not a valid member of model?

So I am trying to make an object no longer transparent but I keep getting the error message Transparency is not a valid member of Model. My code is here:

Model.Transparency = 0

There are no other things named Model, and I have tried changing the name but to no success. What am I doing wrong?

2 answers

✓ Accepted answer

only parts can become transparent -> there still is a way tho

if u add a script in the model and paste this in the script and it will loop through and determine if v is a part and then make it transparent else just prints in the output 'not needed' if it isn't a part.

for i,v in pairs(script.parent) do
	if v:IsA("Part") then
		v.Transparency = 0
	else
		print'not needed'
	end
end

2 comments

0

Use v:IsA("BasePart") will also turn unions and meshes to transparent.

0

that wont work, pairs() needs a table, not just a model

you need to loop through the model and make each part transparency 0

for _,part in pairs(Model:GetDescendants()) do
	if part:IsA("BasePart") then
		part.Transparency = 0
	end
end

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