Hi, I own a cafe with LR, MR, HR, and SHR ranks. I would like to make a different uniform for MR+ does anyone know how to? I can provide screenshots of what I don’t understand.
Do you have your current code?
What kind of code?
(20 Characters)
The code that can handle one rank.
Yes.
local Players = game:GetService("Players")
local GroupId = 13986406
local MinRankId = 4
local Shirt = script.Uniform.Shirt.ShirtTemplate
local Pants = script.Uniform.Pants.PantsTemplate
Players.PlayerAdded:Connect(function(Player)
local RankInGroup = Player:GetRankInGroup(GroupId)
if RankInGroup >= MinRankId then
if RankInGroup >== 9 then
local Playercharacter = Player.Character
Playercharacter.Shirt.ShirtTemplate = Shirt
Playercharacter.Pants.PantsTemplate = Pants
end
end)
It’s the code you made, but with the added if statment.
This most efficient method is to use a forloop, however the easier route will be to edit it like this:
if RankInGroup >= MinRankId then
if RankInGroup == 9 then
local Playercharacter = Player.Character
Playercharacter.Shirt.ShirtTemplate = Shirt
Playercharacter.Pants.PantsTemplate = Pants
end
Duplicating the statement and changing the rank as you go.
E.g:
if RankInGroup >= MinRankId then
if RankInGroup >== 9 then
local Playercharacter = Player.Character
Playercharacter.Shirt.ShirtTemplate = Shirt
Playercharacter.Pants.PantsTemplate = Pants
end
if RankInGroup >= MinRankId then
if RankInGroup >== 9 then
local Playercharacter = Player.Character
Playercharacter.Shirt.ShirtTemplate = Shirt
Playercharacter.Pants.PantsTemplate = Pants
end
Once again, not very efficient or nice code, but it gets the job done.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.