-
What do you want to achieve? Keep it simple and clear!
So basically, i need to automatically sort uniform by player group rank, like player rank in group = 1 then uniform will be = E1. -
What is the issue? Include screenshots / videos if possible!
Idk how to do that. Also i get this error

-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I can make a long script, but it’s not optimized and it will lag a lot.
My script:
local GroupID = 11357936
local Script = script.Parent
function Click(mouse)
local pName = script.Parent.Parent.Parent.Parent.Parent.Name
local pPlayer = game.Workspace:findFirstChild(pName)
local Player = game.Players:GetPlayerFromCharacter(pPlayer)
local PlayerRank = Player:GetRankInGroup(GroupID)
for j,k in pairs(pPlayer:GetChildren()) do
if k:IsA("Pants") or k:IsA("Shirt") then
k:destroy()
end
end
for i, Rank in ipairs(Script:GetChildren()) do
Rank:clone().Parent = pPlayer
Rank:clone().Parent = pPlayer
end
end
script.Parent.MouseButton1Click:connect(Click)
