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:
local team = game.Teams["Choosing..."] local plr = game.Players.LocalPlayer game.ReplicatedStorage.changeTeam:FireServer(team) for _,player in pairs(game.Players:GetChildren()) do player.CharacterAdded:Connect(function(char) for _,cPart in pairs(char:GetChildren()) do if not cPart:IsA('BasePart') then return end cPart.LocalTransparencyModifier = 1 end end) end
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
Your not alone I had this problem here's there script (This will Make every character but yours disappear, But you can do what you want with it) :
for i,Foundplayer in pairs(game.Players:GetPlayers()) do if Foundplayer.Name ~= player.Name then for i,Child in pairs(Foundplayer.Character:GetChildren()) do if Child:IsA("Part") or Child:IsA("MeshPart") then Child.Transparency = 1 end if Child:IsA("Accessory") then Child.Handle.Transparency = 1 end end end Foundplayer.Character.Head.face.Transparency = 1 end
Hope this Helped!