Unable to hide other players' characters?
Asked by
5 years ago Edited 5 years ago
Hey there once again,
I am developing a game and I have a skybox that every player spawns in, and I need to make each player look like he's there alone - hide other players.
I tried making a script as follows:
01 | local team = game.Teams [ "Choosing..." ] |
02 | local plr = game.Players.LocalPlayer |
05 | game.ReplicatedStorage.changeTeam:FireServer(team) |
08 | for _,player in pairs (game.Players:GetChildren()) do |
10 | player.CharacterAdded:Connect( function (char) |
11 | for _,cPart in pairs (char:GetChildren()) do |
13 | if not cPart:IsA( 'BasePart' ) then return end |
14 | cPart.LocalTransparencyModifier = 1 |
The other part of code activates, so the script runs, but it doesn't do anything, I still see other players. It is in a LocalScript as suggested, but it doesn't run in localscript nor a normal one.
Any help on fixing my code? (Or suggesting a other way to do it)
Thanks in advance, any tips appreciated.
EDIT-1: I realized the property is only of BaseParts, I also posted my new and whole code