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

Tried to use GetRoleInGroup, what did I do wrong?

game.Players.PlayerAdded:Connect(function(player)
 local Rank = player:GetRoleInGroup(4937707)
if Rank == (150) then
	print("test")
end
end)

It doesn't print anything on my screen.

2 comments

0

perhaps try printing the Rank outside the if statement..?

0

Idk.. Neither of GetRoleInGroup or GetRankInGroup worked..

2 answers

✓ Accepted answer

Maybe this could work?

game.Players.PlayerAdded:Connect(function(player)
	local Rank = player:GetRankInGroup(4937707)
	print(Rank)
	if Rank == 150 then
	    print("test")
	end
	print("2")
end)

you can remove the print statements i just used it to get info. it worked for a random group i was in / you just needed to remove the brackets around 150

or you could try:

game.Players.PlayerAdded:Connect(function(player)
	local Rank = player:GetRoleInGroup(4937707)
	print(Rank)
	if Rank == "ROLENAME" then
	    print("test")
	end
	print("2")
end)
game.Players.PlayerAdded:Connect(function(player)
 local Rank = player:GetRankInGroup(4937707)
if Rank == (150) then
    print("test")
end
end)

You were using the wrong function, use GetRankInGroup not GetRoleInGroup.

1 comment

0

Still not working..

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