Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[EMERGENCY] I can't assign a team to a player, what's wrong?

why isnt this working? can u tell me precisely whats wrong

local players, teams = game:GetService("Players"), game:GetService("Teams")
players.PlayerAdded:Connect(function(player)
  if player:GetRankInGroup(5086504) == 199 then
    local team = game:getservice("teams")["Game Developer"]
  else
  end
end)

3 comments

1

Don't tag your post as "EMERGENCY", and definitely don't tag your post as "EMERGENCY" and then say "this doesn't work" with no further information.

0

i never said "this doesnt work"

0

i dont see whats wrong in asking "whats wrong with this script/why isnt this script working" everyone asks it

2 answers

✓ Accepted answer

Do not tag your post as "EMERGENCY". Please read what the first comment said. There is absolutely no point in doing that at all. Since I'm nice, I went ahead and fixed your script.

Please accept this answer if this helped!

local players =  game:GetService("Players")

players.PlayerAdded:Connect(function(player)
	if player:GetRankInGroup(5086504) == 199 then
		player.Team = "Game Developer" -- make sure you have a team called Game Developer
	end
end)

1 comment

0

didnt work but probably because I put it in the wrong place.. where do I put it?

Try doing this:

local players = game:GetService("Players")
local Teams= game:GetService("Teams")

players.PlayerAdded:Connect(function(player)
	if player:GetRankInGroup(5086504) == 199 then
    	player.Team = Teams["Game Developer"]
	end
end)

Just note that Player.Teams is not replicated.

1 comment

0

woah! yours is the first that worked!

This discussion is preserved as it was. New answers, comments, and votes are closed.