I want to make it so that the staff in my group can access this, but not guests. So 5 and above for my groups ranks.

function onChatted(msg, recipient, speaker) 
local source = string.lower(speaker.Name) 
local msg = string.lower(msg) 
	
if (msg == string.lower ('!open1A')) then 
	script.Parent.PartA.CanCollide = false
	script.Parent.PartA.GUIpart.OpenGUI.Enabled = true
	script.Parent.PartA.GUIpart.ClosedGUI.Enabled = false
elseif (msg == string.lower ('!close1A')) then 
	script.Parent.PartA.CanCollide = true
	script.Parent.PartA.GUIpart.ClosedGUI.Enabled = true
	script.Parent.PartA.GUIpart.OpenGUI.Enabled = false
elseif (msg == string.lower ('!close1B')) then 
	script.Parent.PartB.CanCollide = true
	script.Parent.PartB.GUIpart.ClosedGUI.Enabled = true
	script.Parent.PartB.GUIpart.OpenGUI.Enabled = false
elseif (msg == string.lower ('!open1B')) then 
	script.Parent.PartB.CanCollide = false
	script.Parent.PartB.GUIpart.OpenGUI.Enabled = true
	script.Parent.PartB.GUIpart.ClosedGUI.Enabled = false
	end
end
game.Players.ChildAdded:connect(function(plr)
	plr.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, plr) end) 
end)

What can I do?