A problem with my Hand To System

Hello!
I am having problems with my Hand To System.

Here is my original code:

local config = {
	GroupId = 5320402,
	MinRank = 3,
}

local GText = Gui.Text
local GTitle = Gui.Title

local function sendMsg(Title,Text)
	GText.Text = Text
	GTitle.Text = Title
	wait(4)
	Gui.Visible = false
end

game.Players.PlayerAdded:Connect(function()
	if game.Players.LocalPlayer:GetRoleInGroup(config.GroupId) >= config.MinRank then
		sendMsg('RoGet - HandToSystem Loaded','Press [H] To open!')
	else
		print('The player is not in the group or the Rank!')
		Gui.Visible = false
	end
end)

And this is my output

So If I try another way,

local GText = Gui.Text
local GTitle = Gui.Title

local function sendMsg(Title,Text)
	GText.Text = Text
	GTitle.Text = Title
	wait(4)
	Gui.Visible = false
end

game.Players.PlayerAdded:Connect(function()
	if game.Players.LocalPlayer:GetRoleInGroup(5320402) >= 3 then
		sendMsg('RoGet - HandToSystem Loaded','Press [H] To open!')
	else
		print('The player is not in the group or the Rank!')
		Gui.Visible = false
	end
end)

I will get the same results
Is there a way to fix this problem?
I need to fix my Hand To System.

GetRoleInGroup returns the name of the rank, not its placement in the hierarchy. Replace it with GetRankInGroup.

Well, I tried that and it did not work!

local GText = Gui.Text
local GTitle = Gui.Title

local function sendMsg(self,Title,Text)
	self.GText.Text = Text
	self.GTitle.Text = Title
	wait(4)
	self.Gui.Visible = false
end

game.Players.PlayerAdded:Connect(function()
	if game.Players.LocalPlayer:GetRoleInGroup(5320402) >= 3 then
		sendMsg('RoGet - HandToSystem Loaded','Press [H] To open!')
	else
		print('The player is not in the group or the Rank!')
		Gui.Visible = false
	end
end)

Well, I tried using that but it does not work.

also, first code config is a lua keyword