I am trying to make it so that when a player joins, it checks if they are in a group, if they are they get put on the White team color team and if they aren't in the group, they get put on the Rust team color team.
This is my script that is in StarterPlayerScripts
game.Players.PlayerAdded:connect(function(p) if p:IsInGroup(3330867) then p.TeamColor = BrickColor.new("White") else p.Teamcolor = BrickColor.new("Rust") end end)
PlayerAdded
on the client. This can be dangerous as you're giving the client power and access to the other player's properties. Put this code in ServerScriptService
as a server script:game:GetService("Players").PlayerAdded:Connect(function(p) -- switch to :Connect, :connect is deprecated if p:IsInGroup(3330867) then p.TeamColor = BrickColor.new("White") else p.Teamcolor = BrickColor.new("Rust") end end)