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

How i make a script check for a group rank and destory gui if not in group and certain rank?

How do i make a script check if a player is in a group and the rank is higher than 200 then it makes the gui visible if not in group or certain rank it destroys the gui for them?

1 answer

✓ Accepted answer

I'm glad you asked this question! It can be hard to figure these things out if you don't know where to look. That's why, I am going to tell you to look here. I recommend reading through the whole page, just to see what tools are at your disposal, but under the YieldFunctions, you should find a very useful GetRankInGroup function.

To use any of the functions on that page, you will need to use the : with the () after. PLAYER:GetRankInGroup()

Also, some of the functions take parameters you can find out by clicking on the function. GetRankInGroup has 1 parameter, and that is the ID of the group you want to know their rank in.

PLAYER:GetRankInGroup()

Example script:

repeat wait() until game.Players.LocalPlayer; --Wait for LocalPlayer to load
local player = game.Players.LocalPlayer
local groupID = 3
local rankNumber = PLAYER:GetRankInGroup(3) --This function returns the number rank of the player in the group with groupID = 3

if rankNumber > 200 then -- If their rank exceeds 200
	GUI2Remove:Destroy() --Put the code to destroy the Gui in here.
end

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