Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Unable to hide other players' characters?

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

2 comments

0

when is this code being called? If it is just in the script like this then it will only ever run ONCE

0

It is in a localscript, so it should call when a player joins the game. And the changeTeam event fires successfuly, so as I said, the script 100% gets ran

1 answer

✓ Accepted answer

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!

2 comments

0

I guess I have to do it this way. Thanks!

0

Np

This discussion is preserved as it was. New answers, comments, and votes are closed.