Problem with Team Spawners! What is going on?

Is there a setting somewhere to turn on team spawners? I have a teams folder with the two teams “Plum” and “Black.” Is there some other setting that might be causing the problem? I am currently watching team spawner videos looking for ideas, but not finding anything new.

Worth a try. I’ll get back to you in a min.
Nope. Same.

I am setting the respawn location both in script and the spawners themselves as team coded. Maybe that is messing things up?

Verify that enabled is activated for the SpawnLocation, when the game does not find a spawn activated for that team or a neutral one, it will move it to another SpawnLocation.

Good thought! But both are already enabled. :frowning:

I think it’s because roblox focuses on the spawner you put 1st

Interesting thought. Assume that is right. Can you think of a way to code around that?

Tried restarting Studio and publishing and playing. Same result. Team Spawners are just not working.

But where is the code that makes you change the team?

That is in the “Launch” code in ServerScriptService as well.

You did turn AutoAssignable false for the teams, right?

Brilliant. No, both teams were on AutoAssignable. So I turned that off. Now it spawns me to a random place. That is really interesting. But what does that tell me?

It also has my team now as “Neutral.”

This is what it does.

Interesting, but it didn’t really solve my problem. It appears as though I am not really moving the character to the Black Team even though it says in the leaderboard that the player has moved. Maybe the leaderboard is wrong?

More Information: With AutoAssignable turned off the code no longer succeeds in assigning a player to a team even though it is running. So why (when AutoAssignable is off) does this code NOT assign players to a team?

Players = game:GetService(“Players”)

local Plum = game.Workspace.Spawns[“Plum Spawn”]
local ReturnSpawner = game.Workspace.ReturnTransports.TransporterA[“Black Spawn”]
local Returning = game.ReplicatedStorage.Returning
local DataService = game:GetService(“DataStoreService”)
local DataStore = DataService:GetDataStore(“AOTeamColor”)
local color

local function playerAdded(player)

local success = pcall(function()
color = DataStore:GetAsync(player.UserId)
print(color)
end)
print(“11”)

player.TeamColor = BrickColor.new(color)
print(player.TeamColor)

print("22")
if player.TeamColor  ~= BrickColor.new("Plum") then
	if player.TeamColor ~= BrickColor.new("Black") then
		player.TeamColor = BrickColor.new("Plum")
end
end
print("33")
print(player.TeamColor)

if player.TeamColor == BrickColor.new("Plum") then
	player.RespawnLocation = Plum
end
print("44")
if player.TeamColor == BrickColor.new("Black") then
	wait(1)
	player.RespawnLocation = ReturnSpawner	
end
end

Players.PlayerAdded:Connect(playerAdded)

MoreData: Have discovered that the code is changing the TeamColor, but NOT the Team. So I am getting “nil” for Team and “Black” for TeamColor. Yes, the Black Team exists in the Teams Folder.

More: okay, changed code to add to teams. So now it adds the player to the correct team. BUT we still have the same problem. My only guess is that the player is spawning BEFORE the team is assigned. Anyway to add a wait before the spawn?

Okay here was the problem. Just in case any of you encounter this problem in the future.

The script was changing the team AFTER the player spawned. I fixed it by disabling the autospawn and adding the LoadCharacter function after the team assignment function.