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

How would I get the string name of a role, from a group?

Asked by 8 years ago

Maybe that isn't the best way to ask it, but what I need to do is check if a player is of a certain rank in a group, using strings instead of the role value. I do not have access to the group admin, I'm scripting something for a friend, and he can't get me the role values. I saw this used in an old theater game, but I've since forgotten how it was done. Any help?

2 answers

Log in to vote
2
Answered by 8 years ago

There is a function in Playercalled GetRoleInGroup(), which is similar to GetRankInGroup()but returns a string rather than a number. Here is a more detailed description.

Ad
Log in to vote
2
Answered by
Scout9 17
8 years ago

use

 if player:GetRoleInGroup(id) == "rankname?" then
-- stuff here
end

or

if player:GetRankInGroup(id) == 255 then 
print("player is owner of group")
end

GetRoleInGroup() gets/return the rank as a stringvalue while theGetRankInGroup() does it is as a number value.

Answer this question