Check the player if is in group (in game)

Like if the player leaves the group it will get updated because I want to make a local script inside the starter gui and I don’t want a demoted player access the GUI.

inside of local script

while true do
	wait(3)
	GUI.Frame.EmployeeTeam.Visible = Player:IsInGroup(Employee)
	GUI.Frame.ManagerTeam.Visible = Player:IsInGroup(Manager)
	-- So I don’t need to make a elseif statement over and over
end
1 Like

What do you need help on exactly?

Check the player if they leaves the group while ingame and if they in the group the GUI will show else the GUI won’t show

Are u trying to do something like this?

local player = game.Players.LocalPlayer
local groups = {}
local check

function check(plr)
	task.wait()
	for i,v in pairs(groups) do
		if plr:IsInGroup(v) then
			print("Init")
		else
			print("NotInGroup")
			GuiUpdate()
			check(plr)
		end
	end
end

check(player)

Yeah but I want to do it manually because the Employee GUI and Manager GUI is not the same

check group rank or role brah
https://create.roblox.com/docs/reference/engine/classes/Player#GetRankInGroup

No I have a seperate group so I dont need to use group rank

try this

while true do
wait(3)
if Player:IsInGroup(Employee) then
GUI.Frame.EmployeeTeam.Visible = true
GUI.Frame.ManagerTeam.Visible = true
end

I believe it caches that information, so not unless they rejoin you can’t detect if they left the group or got demoted.