Try this one, I have improved on from @i_iiAngel’s script he sent.
-- Replace with the desired shirt ID and your group ID
local staffShirtID = 607785311
local groupID = 12345678 -- Your group ID goes here
local staffRankNumber = 254 -- Staff rank number goes here
local PlayerService = game:GetService("Players")
PlayerService.PlayerAdded:Connect(function(plr)
-- Check player's rank in the group
if plr:IsInGroup(groupID) and plr:GetRankInGroup(groupID) > staffRankNumber then
plr.CharacterAdded:Connect(function(character)
local shirt = character:FindFirstChild("Shirt")
-- Check if the shirt is there
if shirt then
shirt.ShirtTemplate = "rbxassetid://" .. staffShirtID -- Replace the shirt
else
-- If shirt doesn't exist, create a new one
local newShirt = Instance.new("Shirt")
newShirt.ShirtTemplate = "rbxassetid://" .. staffShirtID
newShirt.Parent = character
end
end)
end
end)
I should mention when you set the staff rank number to like 54 for example, anything 54 or higher will receive the staff shirt.
I tried it and it does not work, it just keeps my original shirt on
-- Replace with the desired shirt ID and your group ID
local staffShirtID = 13523043925
local groupID = 17256639 -- Your group ID goes here
local staffRankNumber = 1 -- Staff rank number goes here
local PlayerService = game:GetService("Players")
PlayerService.PlayerAdded:Connect(function(plr)
-- Check player's rank in the group
if plr:IsInGroup(groupID) and plr:GetRankInGroup(groupID) > staffRankNumber then
plr.CharacterAdded:Connect(function(character)
local shirt = character:FindFirstChild("Shirt")
-- Check if the shirt is there
if shirt then
shirt.ShirtTemplate = "rbxassetid://13523043925" .. staffShirtID -- Replace the shirt
else
-- If shirt doesn't exist, create a new one
local newShirt = Instance.new("Shirt")
newShirt.ShirtTemplate = "rbxassetid://13523046235" .. staffShirtID
newShirt.Parent = character
end
end)
end
end)
if plr:GetRankInGroup(17256639) --[[ Set ur group id here ]] > 1 --[[ Set the staff rank number here ]] then
The staff rank number should be the rank number you chose when you made the role. I’m pretty sure if it’s set to 1, everyone has the shirt. This quickly turns into a problem if the group is supposed to have the game’s fans in it (like LSplash or Minitoon’s group).
if plr:IsInGroup(groupID) and plr:GetRankInGroup(groupID) > staffRankNumber then
This line checks if the User is ONLY greater than the staffRankNumber that was assigned earlier. So, if everyone is ranked 1 on the group, no one will have the ability to get the shirt. Try replacing the greater sign (>) with (>=). Example:
if plr:IsInGroup(groupID) and plr:GetRankInGroup(groupID) >= staffRankNumber then
-- Replace with the desired shirt ID and your group ID
local staffShirtID = 13523043925
local groupID = 17256639 -- Your group ID goes here
local staffRankNumber = 1 -- Staff rank number goes here --DON'T CHANGE IT HERE
local PlayerService = game:GetService("Players")
PlayerService.PlayerAdded:Connect(function(plr)
-- Check player's rank in the group
if plr:IsInGroup(groupID) and plr:GetRankInGroup(groupID) >= staffRankNumber then
plr.CharacterAdded:Connect(function(character)
local shirt = character:FindFirstChild("Shirt")
-- Check if the shirt is there
if shirt then
shirt.ShirtTemplate = "rbxassetid://13523043925" .. staffShirtID -- Replace the shirt
else
-- If shirt doesn't exist, create a new one
local newShirt = Instance.new("Shirt")
newShirt.ShirtTemplate = "rbxassetid://13523046235" .. staffShirtID
newShirt.Parent = character
end
end)
end
end)
It’s supposed to be like this. Red underlines mean that there is an error. I love helping people at 1 AM
-- Replace with the desired shirt ID and your group ID
local staffShirtID = 13523043925
local groupID = 17256639 -- Your group ID goes here
local staffRankNumber = 1 -- Staff rank number goes here --DON'T CHANGE IT HERE
local PlayerService = game:GetService("Players")
PlayerService.PlayerAdded:Connect(function(plr)
-- Check player's rank in the group
if plr:IsInGroup(groupID) and plr:GetRankInGroup(groupID) >= staffRankNumber then
plr.CharacterAppearanceLoaded:Connect(function(character)
local shirt = character:FindFirstChild("Shirt")
-- Check if the shirt is there
if shirt then
shirt.ShirtTemplate = "rbxassetid://13523043925" .. staffShirtID -- Replace the shirt
else
-- If shirt doesn't exist, create a new one
local newShirt = Instance.new("Shirt")
newShirt.ShirtTemplate = "rbxassetid://13523046235" .. staffShirtID
newShirt.Parent = character
end
end)
end
end)
Instead of using wait(4), you need to use if not player.Character then player.CharacterAdded:Wait() end. There is no guarantee that the player’s character will be loaded in four seconds or less. It could take a longer amount of time for the player’s character to load.