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

How do I change a Player's Team?

Asked by
PixelYT 30
9 years ago

So I'm trying to make a script that will team a player if he is in my group.

Here's what I'm trying.

function onEntered(player)
    wait(1)
    if player:IsInGroup(1240748)then
    player.TeamColor = BrickColor.new("Really Black")
    end
end
game.Players.PlayerAdded:connect(onEntered)

The Team's Color is "Really Black".

Please help!

0
It should be Really black (letter b in black lowercase). Lua is case-sensitive. BlackJPI 2658 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago
function onEntered(player)
    wait(1)
    if player:IsInGroup(1240748)then
    player.TeamColor = BrickColor.new("Really black") --Lua is case sensitive like how MastaJames said. Spell the BrickColor right.
    end
end
game.Players.PlayerAdded:connect(onEntered)

BrickColor Codes and spellings.

Ad

Answer this question