Hello, i need change player team color and team name, how could i do that?
local player = game.Players.LocalPlayer
player.Team = "Guest"
player.TeamColor = BrickColor.new("Really red")
Hello, i need change player team color and team name, how could i do that?
local player = game.Players.LocalPlayer
player.Team = "Guest"
player.TeamColor = BrickColor.new("Really red")
Instead of brick color, try color3
player.TeamColor = Color3.new() -- Box of colors should appear, choose which one you like.
I tried it and it didn’t worked
local function guestTeamJoin()
local guestTeam = Instance.new("Team")
guestTeam.Parent = game:GetService("Teams")
guestTeam.Name = "Guest"
guestTeam.AutoAssignable = true
guestTeam.TeamColor = BrickColor.new("Really red")
local player = game.Players.LocalPlayer
player.Team = "Guest"
player.TeamColor = Color3.fromRGB(255,0,0)
local guestSpawnLocation = Instance.new("SpawnLocation")
guestSpawnLocation.Parent = game:GetService("Teams")
guestSpawnLocation.BrickColor = BrickColor.new("Really red")
guestSpawnLocation.Neutral = true
guestSpawnLocation.TeamColor = BrickColor.new("Really red")
end
game.Players.PlayerAdded:Connect(guestTeamJoin)
I need the player’s team name and color to be the one I created by default
make teams?
if you don’t have Team service yet
There’s my team services here
You can’t access the LocalPlayer via a normal script (server script).
Therefore, the Team you are trying to access is nil.
Local Player works only on the client and local scripts.
If you want to change the TeamColor, use BrickColor.
I am also pretty sure that .Team needs to be set to the Team Object (from team service) and not team name.
Keep in mind that if you change teams from Local Scripts then only you can see the change of the team (and not other players).
When do you change the team (on player join, on button click, on touch)?
Team is a property accessed from the Players tab. Thus, your script should look like this:
game.Players[player.Name].Team = "Team" -- Replace this with your team's name.
game.Players[player.Name].TeamColor = BrickColor.new("Color") -- Replace with your team's brickcolor.
local guestTeam = Instance.new("Team")
guestTeam.Parent = game:GetService("Teams")
guestTeam.Name = "Guest"
guestTeam.AutoAssignable = true
guestTeam.TeamColor = BrickColor.new("Really red")
local guestSpawnLocation = Instance.new("SpawnLocation", workspace)
guestSpawnLocation.BrickColor = BrickColor.new("Really red")
guestSpawnLocation.Neutral = true
guestSpawnLocation.TeamColor = guestTeam
local function guestTeamJoin(player)
player.Team = guestTeam
end
game.Players.PlayerAdded:Connect(guestTeamJoin)
i think it makes new team every time player joins
try this in a server script (in ServerScriptService)
it works but got an error
Works! thanks you a lot!!
local function guestTeamJoin(player)
local guestTeam = Instance.new("Team")
guestTeam.Parent = game:GetService("Teams")
guestTeam.Name = "Guest"
guestTeam.AutoAssignable = true
guestTeam.TeamColor = BrickColor.new("Really red")
player.Team = guestTeam
local guestSpawnLocation = Instance.new("SpawnLocation")
guestSpawnLocation.Parent = workspace
guestSpawnLocation.Parent = game:GetService("Teams")
guestSpawnLocation.BrickColor = BrickColor.new("Really red")
guestSpawnLocation.Neutral = true
guestSpawnLocation.TeamColor = BrickColor.new("Really red")
end
game.Players.PlayerAdded:Connect(guestTeamJoin)