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

How to make a certain Group rank result in certain team/ Changes to another team of in other group?

Asked by 5 years ago
Edited 5 years ago

Hey guys can someone please help mw out here, How can I make it so if someone is a certain rank in my group it will team them a certain team in game, For example this is a army group and they are a rank power 227 or lower (E1) so in game they get ranked Basic Training but if they are rank power 238 or higher (E7) they get the team US Military but then if they match the requirements and are in their own group such as if they match the (Special Forces operator and they are in the Special forces group and they are in the main army group with a rank of (255) general how do I make it so it teams them Special Forces but if they have no division they are only in main group it teams them Army personnel. Can someone please help me if you can find a way because I cannot. Thank you all!

1 answer

Log in to vote
0
Answered by
Mr_Unlucky 1085 Moderation Voter
5 years ago
game:GetService("Players").PlayerAdded:Connect(function(Player)
    if Player:IsInGroup(GROUPIDHERE) then
        Player.TeamColor = BrickColor.new(BRICKCOLORHERE)
    else
        Player.TeamColor = BrickColor.new(BRICKCOLORHERE)
    end
end)

In the code above we have an event that fires every time a player joins. Once they join we'll check if they are in the group, and if so we change their team to the one for your group. If not, we'll make them join the enemy team instead.

Change the "BRICKCOLORHERE" and "GROUPIDHERE" accordingly.

0
Where do I put that script and for it can you add a place where it asks for a main group ID as if they are piwer 227 you get the Basic Training rank but if above 238 you get The army rank but if in the other group which you gave it overrides. Is that possible? AureumMagnus 2 — 5y
0
Oh, put the script into ServerScriptService. And for the GetRankInGroup part, make a variable and then make a conditional to see if they are a certain rank and then afterwards change their TeamColor using BrickColor.new() Mr_Unlucky 1085 — 5y
0
Okay thanks! AureumMagnus 2 — 5y
Ad

Answer this question