Any errors, or any reason on your behalf why its not working
He just forgot to call the function when a player joins. Try this:
local Teams = game:GetService("Teams")
local function guestTeamJoin(player)
if not Teams:FindFirstChild("Guest") then
local guestTeam = Instance.new("Team")
guestTeam.Parent = game:GetService("Teams")
guestTeam.Name = "Guest"
guestTeam.TeamColor = BrickColor.new("Really red")
guestTeam.AutoAssignable = true
player.TeamColor = BrickColor.new("Really red")
local guestSpawnLocation = Instance.new("SpawnLocation")
guestSpawnLocation.Parent = game:GetService("Teams")
guestSpawnLocation.BrickColor = BrickColor.new("Really red")
guestSpawnLocation.Color = Color3.fromRGB(255, 0, 0)
guestSpawnLocation.Neutral = true
end
end
game.Players.PlayerAdded:Connect(guestTeamJoin)
1 Like
local Teams = game:GetService("Teams")
local function guestTeamJoin(player)
if not Teams:FindFirstChild("Guest") then
local guestTeam = Instance.new("Team")
guestTeam.Parent = game:GetService("Teams")
guestTeam.Name = "Guest"
guestTeam.TeamColor = BrickColor.new("Really red")
guestTeam.AutoAssignable = true
local guestSpawnLocation = Instance.new("SpawnLocation")
guestSpawnLocation.Parent = game:GetService("Teams")
guestSpawnLocation.BrickColor = BrickColor.new("Really red")
guestSpawnLocation.Color = Color3.fromRGB(255, 0, 0)
guestSpawnLocation.Neutral = true
end
player.TeamColor = BrickColor.new("Really red")
end
game.Players.PlayerAdded:Connect(guestTeamJoin)
change the players team outside the if statement
1 Like
You could probably create the team before playerâs even join, so you donât even need the playeraddedfunction. Then it will auto assign them when they join. Try this:
local guestTeam = Instance.new("Team")
guestTeam.Parent = game:GetService("Teams")
guestTeam.Name = "Guest"
guestTeam.TeamColor = BrickColor.new("Really red")
guestTeam.AutoAssignable = true
local guestSpawnLocation = Instance.new("SpawnLocation")
guestSpawnLocation.Parent = game:GetService("Teams")
guestSpawnLocation.BrickColor = BrickColor.new("Really red")
guestSpawnLocation.Color = Color3.fromRGB(255, 0, 0)
guestSpawnLocation.Neutral = true
Uh it still doesnât work ⌠I need the playerâs team name and color to be the one I created by default
local Teams = game:GetService("Teams")
local guestTeam = Instance.new("Team",Teams)
guestTeam.Name = "Guest"
guestTeam.TeamColor = BrickColor.new("Really red")
guestTeam.AutoAssignable = false
local guestSpawn = Instance.new("SpawnLocation",workspace)
guestSpawn.TeamColor = guestTeam.TeamColor
guestSpawn.BrickColor = BrickColor.new("Really red")
game:GetService("Players").PlayerAdded:Connect(function(player)
player.Team = guestTeam
end)
The latter is in case you want to add more teams.
Change âguestTeamâ to the team you want.
1 Like
Thank you! I was missing that of parentar to workspace haha
1 Like