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

I'm trying to make this work but I get "Transparency is not a valid member of Model" what is wrong?

Asked by 4 years ago
if part.Transparency <= .45 then
--Code stuff
end

3 answers

Log in to vote
0
Answered by 4 years ago

Is the part a model? Because models don't have transparency. Try referencing the variable as a a Part.

Ad
Log in to vote
0
Answered by 4 years ago

You are changing the transparency of a model not, a part which isn't possible. Create a variable for the parts inside the model and then change their properties.

local parts = script.Parent:GetChildren() -- Get's the children inside the model

if parts.Transparency <= .45 then
--Code stuff
end
Log in to vote
0
Answered by 4 years ago

I realized I had my code in an area where part was in fact a model so I moved it to the correct position in my code and that fixed the problem.

Answer this question