I want to make all people who are not on the player's team invisible and able to be walked through. I made a function to set the other teams' characters to invisible, but it is not working to set CanCollide to false. Am I doing something wrong?
this is the code for my function
1 | local function setInvis(character, value) |
2 | if character then |
3 | for i, v in pairs (character:GetDescendants()) do |
4 | if v:IsA( "Part" ) or v:IsA( "Decal" ) or v:IsA( "MeshPart" ) then |
5 | v.Transparency = value |
6 | end |
7 | end |
8 | end |
9 | end |