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

Making a person on a team transparent? (Not Working)

I am currently trying to make a person to where when they join the "Reaper" team they become transparent.

game.Players.PlayerAdded:connect(function(newPlayer)
newPlayer.CharacterAdded:connect(function(Character)
    wait(1)
    if newPlayer.TeamColor == game.Teams.Reaper.TeamColor then
        Character.Head.Transparency = 0.8
        Character.Head.BrickColor = game.Teams.Reaper.TeamColor
        Character.Torso.Transparency = 0.8
        Character.Torso.BrickColor = game.Teams.Reaper.TeamColor
        Character["Left Arm"].Transparency = 0.8
        Character["Left Arm"].BrickColor = game.Teams.Reaper.TeamColor
        Character["Right Arm"].Transparency = 0.8
        Character["Right Arm"].BrickColor = game.Teams.Reaper.TeamColor
        Character["Left Leg"].Transparency = 0.8
        Character["Left Leg"].BrickColor = game.Teams.Reaper.TeamColor
        Character["Right Leg"].Transparency = 0.8
        Character["Right Leg"].BrickColor = game.Teams.Reaper.TeamColor
    end
end)

2 comments

1

output?

0

My output is messed up from my plugins that im using for the lobby

1 answer

✓ Accepted answer

Your main problem is that you forgot the end) to close the anonymous function on line 02.

Also, it would be more efficient to use a for loop to look for anything in the character that's a part, then change it..

You may want to change the BodyColors instead of the parts' BrickColors because if you don't, the part's color may revert back to whatever is in BodyColors after some time. I'll change the BrickColors in my example, but if it glitches you know what to try.

game.Players.PlayerAdded:connect(function(plr)
	plr.CharacterAdded:connect(function(chr)
		wait(1)
		for i,v in pairs(chr:GetChildren()) do
			if v:IsA("BasePart") then
				v.BrickColor = game.Teams.Reaper.TeamColor
				v.Transparency = 0.8
			end
		end
	end)
end)

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