I am trying to make a GUI that only certain members of a group can access. I have been testing my script and when I check the output I get no errors. I put the code in a Localscript so I do not know why it is not working. Any help would be appreciated, the script is below.
local Person = game.Players.LocalPlayer
local Rank = Person:GetRankInGroup(3350111)
function onPlayerRespawned(newPerson)
if Person:IsInGroup(3350111) then
if Rank < 10 then
Person.PlayerGui.StatusControl:Destroy()
end
else
Person.PlayerGui.StatusControl:Destroy()
end
end
game.Players.PlayerAdded:connect(onPlayerRespawned)

3 comments
Do CharacterAdded instead so it fires everytime the character is added.
Why do you answer in comments ;-;
Well, Im on my phone and I dont feeling like typing too much. I use the comments for more short answers too.