Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

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

Asked by 10 years ago

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)

1
output? Tesouro 407 — 10y
0
My output is messed up from my plugins that im using for the lobby iThunderStrike24 0 — 10y

1 answer

Log in to vote
1
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
10 years ago

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)
Ad

Answer this question