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

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

Asked by 9 years ago

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

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
9 years ago

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
0
ok, thanks! GlitchMasta47 7 — 9y
Ad

Answer this question