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

Group rank and team based uniform?

I have a question, how do I make a Group only uniform based on the team? For example, if you joined the Blue team (which have group bound) you'll get the uniform based on rank, but if you join Red Team, you'll not get the uniform because you're not in the Red team's Group?

3 comments

0

I want kindly remind you that this is not a REQUEST site. In case, you will try to figure out, it yourself and have any bugs or errors then post them here or as a new question. Add me at discord and I will help you in my free time.

0

Note: There are a million ways to achieve what you want to. My discord is: ErtY#9909

0

Ah okay thanks thanks

2 answers

Example (If it is a roblox group) :

game.Players.PlayerAdded:Connect(function(Player)
  Player.CharacterAdded:Connect(function(char)
    if Player:GetRankInGroup(GroupId) == 255 and Player.TeamColor == game.Teams.Red.TeamColor then -- Change GroupId to group id
                 print("Player is the owner of the red group")
           end
    end)
end)

Just an example, if it is what you needed, for shirt changing you have to search for player shirt in character instance and change the id

9 comments

0

Where do i change the ID?

0

Player:GetRankInGroup(GroupId) Change GroupId

0

I've tried to Modify it by myself, but it didnt work like, even tho im not in that rank, im still getting the lower rank uniform, maybe if u have discord, I can message u on there

0

Weird, it should work. By the way, you have to change 255 to a rank ID from the group you want the player to be

0

I did, but whenever im in Guest rank (testing with alt), I get the 255 rank Uniform

0

plr:GetRankInGroup() == 0 will give a shirt to guests

0

yes im trying to give it to guest, didnt even give to guest, it gives to Owner of group

Hiya! o/

I'd go through this by creating a folder somewhere (ideally ReplicatedStorage) where it contains the rank's uniforms in different folders.

Hierarchy Breakdown

The backend would listen for when the player changes their team

Player:GetPropertyChangedSignal("Team"):Connect(function()
	-- Here I would get the player's team, and then rank in their group from that.
	local Rank = 256
	-- Then I would get the Folder for the rank
	local Uniforms = game.ReplicatedStorage.Uniforms:FindFirstChild(Player.Team.Name):FindFirstChild(Rank)
	-- Once I have the folder, loop through all children and replace any clothing in the character with the ones
	-- supplied in the folder.
	for __INDEX, Object in ipairs(Uniforms:GetChildren()) do
		-- Get the type of the object, and do stuff™
	end
end)

This system allows for easy expandability with clean code!

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