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.

Code:

game.Players.PlayerAdded:Connect(function(player)
	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
	end
	if player.UserId == "447630761" or "1243445757" or "1083321076" then
		player.Team = ownerFriendTeam
	end
	if player.UserId == "" then
		player.Team = headAdminTeam
	end
	if player.UserId == "" then
		player.Team = adminTeam
	end
	if player.UserId == "" then
		player.Team = moderatorTeam
	end
	if player.UserId == "" then
		player.Team = builderTeam
	end
end)

Teams:
image

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