Mafnorr
(Mafnor)
November 26, 2022, 4:34pm
1
I am trying to make my avatar invisible but whenever i do the hats stay visible, how can i fix it.
for _, descendant in pairs(char:GetDescendants()) do
if descendant:IsA("BasePart") or descendant:IsA("Decal") then
descendant.Transparency = 1
end
end
DasKairo
(Cairo)
November 26, 2022, 4:36pm
2
for _,i in pairs(char:GetDescendants()) do
if string.match(i.ClassName, "Part") then -- Checks if the Item has "Part" inside of its Class
i.Transparency = 1
end
end
Mafnorr
(Mafnor)
November 26, 2022, 4:37pm
3
I tried the code and it still doesnt work for me?
DasKairo
(Cairo)
November 26, 2022, 4:38pm
4
try printing the items by doing print(i), are you sure this is a LocalScript?
Mafnorr
(Mafnor)
November 26, 2022, 4:39pm
5
I never said it was a local script im doing this in a server script
DasKairo
(Cairo)
November 26, 2022, 4:40pm
6
Why are you doing it inside a Server Script?
Are you trying to make everyone invisible or just you?
Mafnorr
(Mafnor)
November 26, 2022, 4:41pm
7
I am trying to make myself invisible on the server also the code only prints out body parts
DasKairo
(Cairo)
November 26, 2022, 4:43pm
8
Put this inside StarterCharacterScripts
local Character = script.Parent
for _,i in pairs(Character:GetDescendants()) do
if string.match(i.ClassName, "Part") or i:isA("Decal") then
print(i)
i.Transparency = 1
end
end
if you see Handle in the output, should be working
Mafnorr
(Mafnor)
November 26, 2022, 4:45pm
9
Nope doesnt work its still the same.
DasKairo
(Cairo)
November 26, 2022, 4:46pm
10
Works for me (Set to .9 to be visible)
Are you sure you are putting this correctly?
Mafnorr
(Mafnor)
November 26, 2022, 4:47pm
11
I checked and it also works for me but only if i change my avatar to r15 which my game uses r6
DasKairo
(Cairo)
November 26, 2022, 4:48pm
12
Should still work, it gets all the Items that has “Part” inside its Class
GuySalami
(GuySalami)
November 26, 2022, 4:49pm
13
Instead, check if it’s a BasePart
DasKairo
(Cairo)
November 26, 2022, 4:49pm
14
Its better to check if its a Part, string.match is looking for all objects that have Part in it’s class
Mafnorr
(Mafnor)
November 26, 2022, 4:50pm
15
Well check for yourself if you switch the setting to r6 it stops working
GuySalami
(GuySalami)
November 26, 2022, 4:50pm
16
No, most properties of a part are inherited from BasePart, you should use BasePart over a string match.
GuySalami
(GuySalami)
November 26, 2022, 4:52pm
18
This is the best answer, also checks for decals that I forgot about.
DasKairo
(Cairo)
November 26, 2022, 4:52pm
19
I tested both, they both work the exact same
Mafnorr
(Mafnor)
November 26, 2022, 4:52pm
20
That still doesnt make the accesories invisible on r6 tho
Dobalek
(Dobalek)
November 26, 2022, 4:53pm
21
Give me a second, I’m gonna check it.