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

How to check if a group owner / co-owner is in a server?

Hello. I am making a Q&A place for WaveStudios.

I want to make it to where the "ask a question" button only works if the group owner or co-owner is in the server.

This is what I have so far:

script.Parent.MouseEnter:connect(function()
	if ?? then -- At "??" put where it can look for the group owner/co-owner
		-- Ignore, I already have this set up here
	end
end)

(The group ID is 1229606 and the user levels are: [Owner: 255][Co-Owner: 254])

1 answer

✓ Accepted answer

You can use the GetRankInGroup method of Player to find their rank in a particular group.

If you want to tell if anyone in the game has a certain rank, iterate through each player:

local player=game.Players.LocalPlayer
local found=false
for _,v in pairs(game.Players:GetPlayers())do
	if v~=player and v:GetRankInGroup(1229606)>=254 then
		found=true
		break
	end
end

1 comment

0

ok, thanks!

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