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

How do you make an auto team script for one specific rank for a group?

Asked by 5 years ago
Edited 5 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.

So I am trying to let people from my group join a game, and get a specific rank, but every script that I do use, it lets people from different ranks also go into that certain team. I do not like having people from a completely different rank allowed to go onto a certain team in game. I only want that ONE rank to be able to go onto that team.

game.Players.PlayerAdded:connect(function(player)
    if player:GetRankInGroup(4183500)>= 8 then
    end
end)
0
Please post your code together your your thread. Isaque232 171 — 5y
0
Ok PxnnPenguinx 10 — 5y
0
It’s at the bottom of the Answer, near “Report” and the Comments section. it’ll also be prompted to you on the Right. Ziffixture 6913 — 5y

2 answers

Log in to vote
0
Answered by
Isaque232 171
5 years ago
Edited 5 years ago

If you want only one rank to get to a certain team then you shouldn't use the signal >= as It'll apply for everyone in that group that has a rank equal or above 8, use == instead so It'll check only for the players that is on that specific rank which is 8.

To set the player's team you should use the TeamService and set the player's to the specific team you want from there. Your code would be:

Also try to use :Connect more as :connect is deprecated.

local TeamService = game:GetService("Teams")

game:GetService("Players").PlayerAdded:Connect(function(Player)
    if Player:GetRankInGroup(4183500) == 8 then
        Player.Team = TeamService["YourTeamName"] -- Put the name of the Team.
    end
end)

I suggest to take a look at this Team article as it explains, gives some examples of what you can do with the Team property which will for sure help you with some issues related to that!

Hopefully this helps you with your issue, make sure to accept it if it did solve it!

0
You 100% answered my question! Thank you! PxnnPenguinx 10 — 5y
0
Np :D Make sure to accept the answer if it solved your question! Isaque232 171 — 5y
0
Where do I go to accept? Sorry I just joined the website PxnnPenguinx 10 — 5y
0
Oof, I don't really know either since I never actually made a question, there might be a button around the post that lets your do that. Isaque232 171 — 5y
0
It’s not a Signal, it’s called an Operator Ziffixture 6913 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

So I know exactly what you want. You want on player entered, the player would be set into a specific team rank. Here is the script to use(make sure its server side script):

game.Players.PlayerAdded:connect(function(player)
    if player:GetRankInGroup(4183500)== 8 then
player.TeamColor = BrickColor.new("TeamColorHere")
elseif  player:GetRankInGroup(4183500)== 9 then
 player.TeamColor = BrickColor.new("TeamColorHere")
elseif -- keep repeating this
    end
end)

Answer this question