Trouble in team setting script

I’m creating a script that uses UserIDs to place the people with those UserIDs into specific teams.

The issue is the fact that I am set to be put into the Owner team, but instead it puts me into the Owner’s Friends team. I have absolutely no idea why it is doing this, all teams except for the Visitors team has AutoAssignable off, and in the script, my UserID is only in the Owner’s team as far as I am concerned. My UserID is 909473056. I’m using this account to post the DevForum post though, because I can’t be bothered to do it on my main. P.S: 909473056 is the UserID i am having trouble with.


	local ownerTeam = game.Teams.Owner
	local ownerFriendTeam = game.Teams["Owner's Friend"]
	local headAdminTeam = game.Teams["Head Admin"]
	local adminTeam = game.Teams.Admin
	local moderatorTeam = game.Teams.Moderator
	local builderTeam = game.Teams["Builder (BTools Perms)"]

	if player.UserId == "909473056" or "1312122716" then
		player.Team = ownerTeam
	if player.UserId == "447630761" or "1243445757" or "1083321076" then
		player.Team = ownerFriendTeam
	if player.UserId == "" then
		player.Team = headAdminTeam
	if player.UserId == "" then
		player.Team = adminTeam
	if player.UserId == "" then
		player.Team = moderatorTeam
	if player.UserId == "" then
		player.Team = builderTeam


1 Like

I think you don’t need the while true do loop.

I added that after the problem started happening to see if it was messing up so that I needed to do it again

The game.Players.PlayerAdded event only fires when a player joins the game. The loop is unnecessary.

Ok ill remove it and then edit the post