Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Tried to use GetRoleInGroup, what did I do wrong?

Asked by 5 years ago
Edited 5 years ago
1game.Players.PlayerAdded:Connect(function(player)
2 local Rank = player:GetRoleInGroup(4937707)
3if Rank == (150) then
4    print("test")
5end
6end)

It doesn't print anything on my screen.

0
perhaps try printing the Rank outside the if statement..? InfiniteYield 41 — 5y
0
Idk.. Neither of GetRoleInGroup or GetRankInGroup worked.. fortesss7 40 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Maybe this could work?

1game.Players.PlayerAdded:Connect(function(player)
2    local Rank = player:GetRankInGroup(4937707)
3    print(Rank)
4    if Rank == 150 then
5        print("test")
6    end
7    print("2")
8end)

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:

1game.Players.PlayerAdded:Connect(function(player)
2    local Rank = player:GetRoleInGroup(4937707)
3    print(Rank)
4    if Rank == "ROLENAME" then
5        print("test")
6    end
7    print("2")
8end)
Ad
Log in to vote
0
Answered by 5 years ago
1game.Players.PlayerAdded:Connect(function(player)
2 local Rank = player:GetRankInGroup(4937707)
3if Rank == (150) then
4    print("test")
5end
6end)

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

0
Still not working.. fortesss7 40 — 5y

Answer this question