Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is this script not working?

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.