I want to make a script that turns the player invisible, but everything other than the hat is not being invisible. When in the explorer, if I just press the Handle of the accessory and change transparency to 1, it get's invisible, but for some odd reason it wont in this for loop
for i, v in pairs(character:GetDescendants()) do if v:IsA('BasePart') then physics:SetPartCollisionGroup(v, 'Player') v.Transparency = 1 elseif v:IsA('Decal') then v.Transparency = 1 end end
I've tried other things too. I checked if v:IsA('Accessory')
then did v.Handle.Transparency = 1
, I tried if v.Name == 'Handle'
, and I also tried what is above, if v:IsA('BasePart')
.
I'm not exactly sure what' you're doing wrong but try this!
for _,v in pairs(Character:GetChildren()) do if v.ClassName == "Accessory" then v.Handle.Transparency = 1 end end
I can't tell if it's the descendant's function messing you up, or the collision group.