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

This script is not teaming the players?

local groupId = 3237760
local lowranks = "4|Barista","5|Junior Barista","6|Security","10|Head Security"
local midranks = "11|Management","12|Management Team","14|Shift Manager","15|Management","16|Senior Management"
local highranks = "17|Board Of Directors","18|Vice Chairman","19|Chairman Of The Board","Co-Founder","20|Founder","Builder/GFX"


game.Players.PlayerAdded:connect(function(player)
	if player:GetRoleInGroup(groupId) == lowranks then
		player.TeamColor = BrickColor.new("Persimmon")
	elseif player:GetRoleInGroup(groupId) == midranks then
		player.TeamColor = BrickColor.new("Bright red")
	elseif player:GetRoleInGroup(groupId) == highranks then
		player.TeamColor = BrickColor.new("Bright blue")
	else
		player.TeamColor = BrickColor.new("White")
	end
end)

When I play the game in studio it doesn't team me in the "Charman" team, all it does is create a neutral team and puts me there. I tried seeing if I could fix it but I do not have access to the group admin so I can see the ranks like "10,11,12"

3 comments

0

This is in a server script

0

You'll need a table for this. XP Aside from that, why not use GetRankInGroup?

0

I can't use rank in group because I don't know what the permission numbers are, I don't have group admin to check them.

1 answer

✓ Accepted answer

First of all you need a table, which is set out like this:

local lowranks = {"4|Barista","5|Junior Barista","6|Security","10|Head Security"}

And unless you want to use for then I recommend something like this:

local lowranks = {["4|Barista"]=true,["5|Junior Barista"]=true,["6|Security"]=true,["10|Head Security"]=true}

game.Players.PlayerAdded:connect(function(player)
	if lowranks[player:GetRoleInGroup(groupId)] then
		player.TeamColor = BrickColor.new("Persimmon")
	end
end)

This might get annoying for the other tables, but just giving an option. You also need to change groupId to the groupId. Have fun scripting!

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