cheshnut
(ruby)
#1
Hi, How can i turn everything inside a part invisible?
I would like to make everything inside rightarm (including all childrens of flashlight) invisible using a script.
for _, v in pairs(viewmodel.RightArm:GetChildren()) do
if v:IsA("Part") then
v.Transparency = 1
end
end
Usually works when it’s just a part but since this is a group, it doesn’t work. Can somebody please help me? Thanks
3 Likes
azqjanna
(azqjanna)
#2
function Invis(inst)
for _, v in inst:GetChildren() do
if v:IsA("BasePart") then
v.Transparency = 1
end
Invis(v)
end
end
Invis(viewmodel)
2 Likes
Maybe it doesnt work because of the “if v:IsA(“Part”) then” statement, try to remove it
2 Likes
for _, v in pairs(viewmodel.RightArm:GetDescendants()) do
if v:IsA("BasePart") then
v.Transparency = 1
end
end
3 Likes
cheshnut
(ruby)
#5
ViewmodelModule:13: Transparency is not a valid member of Model
1 Like
Keep in mind for next time when you mean ALL children, the specific name for that is all the descendants
4 Likes
system
(system)
Closed
#8
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.