I assume you want to get the user’s rank, you can do this using Player:GetPlayerInRank, to do this, you should return a function that you can check against the player
return function(player: Player)
local rank = player:GetRankInGroup(id)
-- rank here will be a number that is the user rank
-- for example
if rank == 5 then
print("meow")
end
end
From there, you can call this function from code requiring the module with the player you want to check the rank of
I’m kind of confused on why you’re chaining the GetRankInGroup functions, that will cause an error. And you need to concatenate “” and plr.UserId like “”…plr.UserId otherwise it’ll error - but there isn’t any point in doing that you can just do tostring(plr.UserId).
I dont know what exactly you’re trying to do here, my current guess is that you’re trying to figure out what icon to show based on the user’s rank in a group.
If you want to expand what I sent previously where you can assign an image to a rank, refactor the module to this:
local pins = {
[5] = "rbxassetid://123456",
[6] = "rbxassetid://111",
...
}
return function(player: Player): string
local rank = player:GetRankInGroup(id)
-- rank here will be a number that is the user rank
-- for example
return pins[rank]
end
yeah that would get the plr.userid except i want to make it in that module,
if rank ==5 then
[“”] = {
["} = “rbxassetid://”,
},
if i used anything like if, then, or end it red lines
I saw on your original post you have the if in the if statement is capitalized, make sure it isn’t or else the entire if statement will be underlined red.
You also need to add an end and remove the comma after the table, if you would say what the error says that would be helpful. It’s kinda hard to understand you.