Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I get a Player's group rank and compare it?

What I would like to do is find if the player in which clicked the button is in the group AND is higher than a certain rank id. I just cant do the Rank ID part. Any ideas of fixing the following bracketed section?

local a = script.Parent.Parent.Play.Anthem

function OnClicked(player)
	if player:IsInGroup(1152346) and[ player:GetRoleInGroup(1152346) >= 50 ]then
	a:Stop()
	wait()
	end
end

script.Parent.ClickDetector.MouseClick:connect(OnClicked)

1 answer

I believe the function used is 'GetRankInGroup', not 'GetRoleInGroup'.

if player:IsInGroup(1152346) and player:GetRankInGroup(1152346) >= 50 then

1 comment

1

The first half of that conditional is unnecessary: GetRankInGroup returns 0 for non-members.

This discussion is preserved as it was. New answers, comments, and votes are closed.