Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
l7mf 2
4 years ago

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)
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. fredfishy 833 — 4y
0
i never said "this doesnt work" l7mf 2 — 4y
0
i dont see whats wrong in asking "whats wrong with this script/why isnt this script working" everyone asks it l7mf 2 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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)

0
didnt work but probably because I put it in the wrong place.. where do I put it? l7mf 2 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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.

0
woah! yours is the first that worked! l7mf 2 — 4y

Answer this question