Help with group only script

I am trying to make a script so that only players in my group, with a certain rank can see the SurfaceGUI.
Why isn’t this script working?



1 Like

LocalScripts don’t run inside of parts. Instead, put the LocalScript in StarterPlayerScripts, from there, we will access the SurfaceGui, like this:

local player = game.Players.LocalPlayer
local groupId = 11390942
local minRank = 3

local board = workspace.MenuBoard -- Change the path if needed

local isMinRank = player:GetRankInGroup(groupId) >= minRank
board.SurfaceGui.Enabled = not isMinRank

Also, your script disabled the GUI when a player had a certain rank, if this wasn’t your intention, just remove the “not” at “not isMinRank”.

1 Like

why don’t u try using a PlayerAdded function?

local groupid = 11390942
local minrank = 3

    local rank = player:GetRankInGroup(groupid)
    if rank >= minrank then
        script.Parent.Enabled = true
        script.Parent.Enabled = false

and make sure that the frame is enabled…