What I had been working on is called the Uniform giver. You press a button on the side of your screen, you get options for LR uniform, MR uniform, and the HR one opens another gui part that gives you Male or Female uniform options. Here is what i have - and both are 2 diff scripts
local par = script.Parent
local remote = par.RemoteEvent
local ShirtId1 = 14548206090
local PantsId1 = 14555518246
local ShirtId2 = 18249142984
local PantsId2 = 18249137510
local MIN_RANK1 = 10
local MIN_RANK2 = 119
local GROUP_ID = 5901406
remote.OnServerEvent:Connect(function(player, info)
local success, roles = pcall(function()
return player:GetRolesInGroup(GROUP_ID)
end)
if not success then
warn("Failed to get roles for player:", player.Name)
return
end
if info == "Button1" then
if player:GetRankInGroup(GROUP_ID) >= MIN_RANK1 then
local character = player.Character
if character then
local shirt = character:FindFirstChild("Shirt")
local pants = character:FindFirstChild("Pants")
if shirt then
shirt:Destroy()
end
if pants then
pants:Destroy()
end
local newShirt = Instance.new("Shirt")
newShirt.ShirtTemplate = "rbxassetid://" .. ShirtId1
newShirt.Parent = character
local newPants = Instance.new("Pants")
newPants.PantsTemplate = "rbxassetid://" .. PantsId1
newPants.Parent = character
end
end
elseif info == "Button2" then
if player:GetRankInGroup(GROUP_ID) >= MIN_RANK2 then
local character = player.Character
if character then
local shirt = character:FindFirstChild("Shirt")
local pants = character:FindFirstChild("Pants")
if shirt then
shirt:Destroy()
end
if pants then
pants:Destroy()
end
local newShirt = Instance.new("Shirt")
newShirt.ShirtTemplate = "rbxassetid://" .. ShirtId2
newShirt.Parent = character
local newPants = Instance.new("Pants")
newPants.PantsTemplate = "rbxassetid://" .. PantsId2
newPants.Parent = character
end
end
end
end)
local par = script.Parent
local remote = par.RemoteEvent
local ShirtIdM = 18240050175
local PantsIdM = 18240063068
local ShirtIdF = 18240497439
local PantsIdF = 18240060981
local MIN_RANK_HR = 125
local GROUP_ID = 5901406
remote.OnServerEvent:Connect(function(player, info)
local success, roles = pcall(function()
return player:GetRolesInGroup(GROUP_ID)
end)
if not success then
warn("Failed to get roles for player:", player.Name)
return
end
print(player.Name, "roles:", roles)
print(player.Name, "rank:", player:GetRankInGroup(GROUP_ID))
local function applyUniform(shirtId, pantsId)
local character = player.Character
if character then
local shirt = character:FindFirstChild("Shirt")
local pants = character:FindFirstChild("Pants")
if shirt then
shirt:Destroy()
end
if pants then
pants:Destroy()
end
local newShirt = Instance.new("Shirt")
newShirt.ShirtTemplate = "rbxassetid://" .. shirtId
newShirt.Parent = character
local newPants = Instance.new("Pants")
newPants.PantsTemplate = "rbxassetid://" .. pantsId
newPants.Parent = character
end
end
if info == "ButtonM" and player:GetRankInGroup(GROUP_ID) >= MIN_RANK_HR then
applyUniform(ShirtIdM, PantsIdM)
elseif info == "ButtonF" and player:GetRankInGroup(GROUP_ID) >= MIN_RANK_HR then
applyUniform(ShirtIdF, PantsIdF)
end
end)
and when testing the output said this:
Failed to get roles for player: jjustnoraa - Server - Script:19
What is happening? Why wont it work?