local GROUP_ID = 35929635
-- Rank to Uniform
local RankUniforms = {
[255] = {
Shirt = "rbxassetid://1234567890",
Pants = "rbxassetid://103042840720197"
},
[200] = {
Shirt = "rbxassetid://130216488762885",
Pants = "rbxassetid://103042840720197"
},
[100] = {
Shirt = "rbxassetid://5678901234",
Pants = "rbxassetid://103042840720197"
}
}
-- Uniform based on Rank
local function GetUniformForRank(rank)
local bestMatch = nil
for minRank, uniform in pairs(RankUniforms) do
if rank >= minRank then
if not bestMatch or minRank > bestMatch.rank then
bestMatch = {rank = minRank, uniform = uniform}
end
end
end
return bestMatch and bestMatch.uniform or nil
end
-- Equip the uniform
local function EquipUniform(player)
local rank = player:GetRankInGroup(GROUP_ID)
local uniform = GetUniformForRank(rank)
if not uniform then
warn("No uniform found for rank", rank)
return
end
local character = player.Character or player.CharacterAdded:Wait()
local shirt = character:FindFirstChildOfClass("Shirt")
if not shirt then
shirt = Instance.new("Shirt")
shirt.Name = "Shirt"
shirt.Parent = character
end
shirt.ShirtTemplate = uniform.Shirt
local pants = character:FindFirstChildOfClass("Pants")
if not pants then
pants = Instance.new("Pants")
pants.Name = "Pants"
pants.Parent = character
end
pants.PantsTemplate = uniform.Pants
end
ClickDetector.MouseClick:Connect(function(player)
EquipUniform(player)
end)