Team.PlayerAdded not working?

I’m trying to use team.PlayerAdded on the serverside and nothing is working, even the Roblox Wiki example does not work Team.PlayerAdded.

Any alternatives or answers would be greatly appreciated.

Edited:

game:GetService("Teams").Officials.PlayerAdded:Connect(function()
    print("hi")
end)

I have a collision script that makes Officials not collide with a football. It works if the player joins the game as Officials but it doesn’t if the player joins as Visitors for example then switches team to Officials, so I need to set the collision when a player changes team, which is my use case for this script.

Printing (“hi”) is just to make sure it works, but it doesn’t print at all when I change team with Kohl’s admin or in game. The script is also located in a Server Script in ServerScriptService.

This is what the Teams folder looks like

Hello! That’s odd, could you send script - customized for your use?
(I know that’s the script from wiki, but you need to define Team.

To add on from sebi210, there’s not enough context. Do you have spawns? Do you have teams?

Also, when you set a player’s team, you have to make sure to make Player.Neutral = false.

1 Like

@sebi210 @uJordy @12904 I edited the post, sorry for not providing enough context to begin with.

I see, hmm.
That is weird. Try defining Team as variable and then do the PlayerAdded thing.

Hi,

Okay, I just tested the feature, and it indeed still works.

Suggestions:

  • Look in your logs for earlier errors that prevented your Connect() from ever running.
  • Do a print/warn right above the Connect() to see if it is ever executed.
  • Make sure Team Officials exists–Maybe script errored w/ dot access (team created in code?)
  • In Studio be sure to use TEST->Start and modify Team on Server (as opposed to HOME->Play)

HTH

1 Like

Worked for me in server testing thank you, I think when I tested live version I probably didn’t update the game or something silly. It’s always the simple mistakes that catch us out haha, thank you again.

You most likely saved your place to the cloud instead of publishing it. PlayerAdded for Teams works fine and so does your script.

1 Like