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

Help on this team colour part script?

Asked by
Mystdar 352 Moderation Voter
10 years ago
local function onTeamChanged(player) 

    wait(1)

    local char = player.Character
    if char == nil then return end

    if player.Neutral then 
        -- Replacing the current BodyColor object will force a reset
        local old = char:findFirstChild("Body Colors")
        if not old then return end
        old:clone().Parent = char
        old.Parent = nil
    else
        local head = char:findFirstChild("Head")
        local torso = char:findFirstChild("Torso") 
        local left_arm = char:findFirstChild("Left Arm") 
        local right_arm = char:findFirstChild("Right Arm") 
        local left_leg = char:findFirstChild("Left Leg") 
        local right_leg = char:findFirstChild("Right Leg") 

        if head then head.BrickColor = BrickColor.new(24) end
        if torso then torso.BrickColor = player.TeamColor end
        if left_arm then left_arm.BrickColor = BrickColor.new(26) end
        if right_arm then right_arm.BrickColor = BrickColor.new(26) end
        if left_leg then left_leg.BrickColor = BrickColor.new(26) end
        if right_leg then right_leg.BrickColor = BrickColor.new(26) end
    end
end

So when they change team their body colours become these, however how would you make it so that a It removes their current Shirts and a hat from the Lighting goes on them and this last forever. Would it be better if it is when they join a game? It removes Shirts and hats?

Answer this question