How to make rank accessory

is it possible to make rank accessory

Can you elaborate on that question?

What do you mean by “rank”? Is it a variable in your game? are you trying to give players with a certain “rank” a specific accessory? OHHh do you mean a players rank in a group?

the players rank in a group :grinning: :smile:

so basically if a player is a certain rank in a group the will wear this

So you want Rank or Role? Rank ~= Role

-- // Services
local Players = game:GetService("Players")

-- // Scripting

Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		if plr:GetRankInGroup(0000) < 1 then
			
		elseif plr:GetRankInGroup(0000) < 2 then
			
		elseif plr:GetRankInGroup(0000) < 3 then
			
		end
	end)
end)
1 Like

image

can i change the signs to equal

Sure, just do == (rank id) And it should work

if the player is a certain role

Bruh i asked it and you don’t said nothing

oh sry i meant to reply to you

-- // Services
local Players = game:GetService("Players")

-- // Scripting

Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		if plr:GetRankInGroup(groupid) == 1 then
			
		elseif plr:GetRankInGroup(groupid) == 2 then
			
		elseif plr:GetRankInGroup(groupid) == 3 then
			
		end
	end)
end)

Ok, this is possible. You will need to get the accessory you want the player of the rank to have and put it in replicated storage. Then you can put a script that detects the players rank and puts the accessory on them. The script would look something like this:
Make sure to put it in serverscriptserrvice

local Players = game:GetService("Players")
local group = 12345 -- insert group ID here
local accessory = game.ReplicatedStorage.hat -- change this to the accessory you want
local function onCharacterAdded(character)
	local plr = game.Players:FindFirstChild(character.Name)
    If plr:GetRankInGroup(group) == 255 then --change 255 to the rank number you want
        local clone = accessory:Clone()
        clone.Parent = character
    end
end
local function onPlayerAdded(player)
	player.CharacterAdded:Connect(onCharacterAdded)
end
 
Players.PlayerAdded:Connect(onPlayerAdded)

this should work, let me know if not.

1 Like

To role version

--//Variables
local Players = game:GetService("Players")
--//Code
Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		if plr:GetRoleInGroup(groupid) == "RoleName" then
			
		elseif plr:GetRoleInGroup(groupid) == "RoleName" then
			
		elseif plr:GetRoleInGroup(groupid) == "RoleName" then
			
		end
	end)
end)

where should i put this :thinking: :thinking:

ServerScriptService :expressionless:

Serverscript service, I edited it btw.

ok :smiley: :grinning: :smile: