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

Player's torso will not change colors, could anybody help?

Asked by 4 years ago

I tried to make a script that would change a player's torso based off of a player's team. But it would not work. First, I placed the script as a local script into the starter player, then I changed the entire script and made it into a regular script that didn't work out, so I took the script and placed it into the server script service, and it still, will not work. Help please. Here's my script.




game.Players.PlayerAdded:Connect(function(player) local team = player.Team local char = player.Character or player.CharacterAdded:Wait() local torso = char.Torso torso.BrickColor = team.TeamColor team:GetPropertyChangedSignal("TeamColor"):connect(function() torso.BrickColor = team.TeamColor end) end)
0
is it r6 or r15? royaltoe 5144 — 4y
0
r6 jorcorrs 76 — 4y
0
You can just check if it is R6 or R15 by using a function that checks BodyType in Humanoid Geobloxia 251 — 4y
0
I am not looking to change the body type, I am trying to change the torso color. I have the game's settings so it is only R6. jorcorrs 76 — 4y

1 answer

Log in to vote
0
Answered by
royaltoe 5144 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

Use Body Colors:

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        repeat wait() until player.Team
        local team = player.Team

        local bodyColors = character:WaitForChild("Body Colors")
        bodyColors.TorsoColor = team.TeamColor


        player:GetPropertyChangedSignal("Team"):Connect(function()
            bodyColors = character["Body Colors"]
            team = player.Team

            bodyColors.TorsoColor = player.Team.TeamColor
         end)
    end)
end)
Ad

Answer this question