How can I make a player who types /hidetags hide my custom name tags

`type or paste code here`

Add this inside the Players.PlayerAdded function

player.Chatted:Connect(function(msg)
	if msg == "/hidetags" then
		local hrp = plr.Character and plr.Character:FindFirstChild'HumanoidRootPart'
		if hrp then
			hrp.OverheadGui.Enabled = false
		end
	elseif msg == "/unhidetags" then
		local hrp = plr.Character and plr.Character:FindFirstChild'HumanoidRootPart'
		if hrp then
			hrp.OverheadGui.Enabled = true
		end
	end
end)

fixed
300000000000000000000000000000000

No, I mean, inside the PlayerAdded, but outside the CharacterAdded.

Players.PlayerAdded:Connect(function (player)
	player.Chatted:Connect(function(msg)
		if msg == "/hidetags" then
			local hrp = plr.Character and plr.Character:FindFirstChild'HumanoidRootPart'
			if hrp then
				hrp.OverheadGui.Enabled = false
			end
		elseif msg == "/unhidetags" then
			local hrp = plr.Character and plr.Character:FindFirstChild'HumanoidRootPart'
			if hrp then
				hrp.OverheadGui.Enabled = true
			end
		end
	end)
	connections[player] = player.CharacterAdded:Connect(function (character)
		local newOverhead = overHeadTemplate:Clone()
		
		newOverhead.PlayerName.Text = player.Name
		
		
		for _, info in pairs (rankInformation) do
			local isPlayerInDivision = player:IsInGroup(info.groupId)
			
			if isPlayerInDivision then
				newOverhead.Group.Text = info.name
				newOverhead.Group.TextColor3 = info.color
				newOverhead.Group.Visible = true
				
				newOverhead.Rank.Text = player:GetRoleInGroup(info.groupId)
				newOverhead.Rank.Visible = true
			end
		end

Thank you very much for your help I appreciate it !