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?
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
Hiya! o/
I'd go through this by creating a folder somewhere (ideally ReplicatedStorage) where it contains the rank's uniforms in different folders.
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!