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

Why is this script not working?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
game.Players.PlayerAdded:connect(function(newPlayer)
    if newPlayer:IsInGroup() then -- i put a working ID but still now working
        Player.TeamColor = BrickColor.new("Really red") -- the team color
    end
end

Why is this script not working , i am sure that team color is "Really red" and i am sure that the ID i put is working .... What did i write wrong?

1 answer

Log in to vote
0
Answered by 10 years ago

"Player" is never defined.

game.Players.PlayerAdded:connect(function(player)
    local colors = {[group_id here] = BrickColor.new("Really red"), [312312] = BrickColor.new("White")} -- Second is just an example. 
    for i, v in next, colors do
        if player:IsInGroup(i) then
            player.TeamColor = v
        end     
    end
end)
Ad

Answer this question