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

How would you find a player's group rank via scripting?

Asked by 7 years ago

For example if I wanted a gear that group staff would get but normal members won't, how would I use Lua to differentiate between a staff member and a normal member?

0
I already know I would use IsInGroup to see that the player IS in the group, but how would I find a specific rank? SPBOnion 30 — 7y
0
Another question: How could I do this with spawns, like a certain rank spawns at a certain SpawnLocation? SPBOnion 30 — 7y

2 answers

Log in to vote
1
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
7 years ago

GetRankInGroup() returns the number rank of the player it's called on. It's between 0 and 255.

if player:GetRankInGroup(groupId) > 5 then --checks if player is above rank 5

GetRoleInGroup will return the name of the player's rank, or "Guest" if they're not in the group.

if player:GetRoleInGroup(groupIs) == "Knight" then --checks if their rank is knight
0
Thanks! SPBOnion 30 — 7y
Ad
Log in to vote
1
Answered by
itsJooJoo 195
7 years ago
Edited 7 years ago

You can use the GetRankInGroup to find a players rank in a group and decide what happens off of that

0
To get the actual title of the rank, use GetRoleInGroup. M39a9am3R 3210 — 7y

Answer this question